Subject: Re: [xsl] OR in test From: David Carlisle <davidc@xxxxxxxxx> Date: Thu, 4 Jul 2002 14:20:39 +0100 |
| (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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] OR in test, Michael Kay | Thread | RE: [xsl] OR in test, TSchutzerWeissmann |
Re: [xsl] OR in test, Vasu Chakkera | Date | [xsl] accessing (xml) objects from , s s |
Month |