[Home] [By Thread] [By Date] [Recent Entries]
On 06/11/2013 12:24, henry human wrote:
There is still one issue, cause the root elment is dnamiccaly , sometimes I need to get the root name: <xsl:variable name="Root"> <xsl:value-of select="/node()[1]/name()"/> </xsl:variable> Root is a bad name (since in xpath the root is / which is the parent of the element that you want) you want /*[1] (It is much better to use * rather than node() here otherwise a comment or processing instruction will break your code.) Don't use a variable with content as that generates a temporary tree, you just want a string so use <xsl:variable name="Root" select="/*[1]/name()"/>
That is the standard behaviour for literal result elements, the declared namespace is in scope. You can use exclude-result-prefixes on your xsl:stylesheet element to stop this. David
This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________
|

Cart



