[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: accessing xml using node name
<xsl:value-of select="self::node()/node()[number($columnRow)]" That could be written more simply as <xsl:value-of select="*[number($columnRow)]" there's no need to start a path with self::node() as relative paths always are taken relative to the current node (ie, self::node()) * isn't equivalent to node() in teh next step but I suspect that you intend * (ie counting element position) if you use node() then the osition will be affecteded by any indentation or comments in your source file. <xsl:with-param name="id"><xsl:value-of select="$id"/></xsl:with-param> You have several instances of this, it's generally a bad idea to use param with-param or variable with content like this unless you really need it. the above makes $id into a result tree fragment corresponding to a root node with achild text node the string value of the old value of $id. This is relatively expensive to construct and less useful as 4id is no longer a node set so you can not use it in XPath steps. <xsl:with-param name="id" select="$id"/> is simpler to type and makes $id have the same value as the old value of $id so it's much more efficient and generally more useful. <xsl:value-of select="self::node()/node()[number($list)]"/> typically your list is a comma separated list of values so number($list) will be NaN and tge XPath will not select anything. You need to check if it contains a , and if so just take the first number with substring-before before using number(). David ________________________________________________________________________ This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________
|
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
|