[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: OR in test
| (which means set union) can be read as "or" in match patterns, although your template is far more complicated than needed. <xsl:variable name="type"> <xsl:value-of select="@type"/> </xsl:variable> that makes a result tree fragment with a root node a and a text node it would be simpler to just use <xsl:variable name="type" select="@type"/> or simpler still not to have a variable at all and just use @type in the following code instead of $type. <xsl:element name="input"> <xsl:attribute name="name"> <xsl:value-of select="@name"/> </xsl:attribute> <xsl:attribute name="type"> <xsl:value-of select="@type"/> </xsl:attribute> <xsl:apply-templates/> </xsl:element> can much more simply be written <input name="{@name}" type="{@type}"> <xsl:apply-templates/> </input> Also the code in your when clause and in your otherwise clause is the same, i assume that that was a cut and paste error and you meant to have different results in these cases? But do you need that or at all? Your code only seems to use the attributes of input and does not depend on which parent it has so you could use <xsl:template match="input"> You don't appear to need to list a/input etc at all. > and what if in html text is written as TEXT(in capitals). XSLT is case sensitive. You either need to match on something like INPUT|input or if you want to support <InPuT> then you can use something like *[translate(name(),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')='INPUT'] David _____________________________________________________________________ This message has been checked for all known viruses by Star Internet delivered through the MessageLabs Virus Scanning Service. For further information visit http://www.star.net.uk/stats.asp or alternatively call Star Internet for details on the Virus Scanning Service. 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
|