[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Probelm with xsl:value-of in CSV to XML transform
<xsl:when test="name()='classdate'"> don't do that (name() isn not namespace aware and is probably slow) do <xsl:when test="self::classdate"> but if you have a template consisting of a xsl:choose like this it's usually better to change to to be match="classdate" <xsl:element name="classdate"> or more simply <classdate> you only need xsl:eleemnt if you calculate the element name dynamically. <xsl:value-of select="sortdate"/> sortdate is your sister not your child, <xsl:value-of select="preceding-sibling::sortdate[1]"/> <xsl:value-of select="sortdate"/>, this resulted in <value/> you selected no children of this name <xsl:value-of select="name()='sortdate'"/>, this resulted in <value>false</value> that isn't the name() evaluates to classdate here and thse strings are not equal <xsl:value-of select="/root/row/sortdate"/>, this placed all instances of the whih is what you selected (in xslt 1 you'd just get the value of teh first one) ah you have whol esheet <xsl:for-each select="node()"> <xsl:choose> yes don't do that that is just implementing template application by hand, just do <xsl;apply-templates/> and replace each when clause by a template so <xsl:template match="daytime[.='yes']'"> <xsl:copy> <items> <item> <label>yes</label> <value>**DAYTIME CLASS**</value> </item> </items> </xsl:copy> </xsl:template> etc > disable-output-escaping="yes">]]></xsl:text> d-o-e is evil, espeecially doing what youu have there as if there are any < or & in your strings the CDATA section will corrupt the output (and if there are not, it does nothing) David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________
|
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
|