[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: generic template - possible?
Heppa, > I am somewhat new to XSL. I am trying to write a template that will > convert xhtml forms to wml forms. > I want to write a generic conversion that will convert: > > <FORM method=GET action="http://www.google.com/search"> > <INPUT TYPE=text name=q size=12 maxlength=255 value=""> > <INPUT type=submit name=btnG VALUE=" Google "> > </FORM> This is not XHTML... > Is this possible to do with one template?? I just don't seem to know > how to approach this. Can anybody help? <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xhtml="http://www.w3.org/1999/xhtml" exclude-result-prefixes="xhtml"> <xsl:template match="xhtml:form"> <xsl:apply-templates select="xhtml:input" /> </xsl:template> <xsl:template match="xhtml:input"> <input> <xsl:copy-of select="@name | @size | @maxlength" /> </input> </xsl:template> <xsl:template match="xhtml:input[@type = 'submit']"> <do type="accept" label="{normalize-space(@value)}" /> </xsl:template> </xsl:stylesheet> or something like this *IF* your input is XHTML. Cheers, Santtu XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|