[Home] [By Thread] [By Date] [Recent Entries]
On 06/11/2013 15:49, henry human wrote:
That works with the exclude-result-prefixes avoiding the namespace, thanks, but now I face following: Originally I wanted o use the name of the root or the next child to loop over in a for-each as bellow /*[1]/local-name() is a sequence of one string, so why would you want to for-each over it? It is legal and makes . equal to that string but apart from using <xsl:value-of select="."/> to output the string there is not much useful stuff you can do inside the loop.
Again that for-each is iterating over a sequence of length 1, so does nothing useful. In this case the item is a root node / with child a single text node with value the name of the top level element in the original document.
well yes because you are iterating over a sequence of nodes (or sequence of strings) that are not in the original document, so in the string case it's an error to try to select ChildElment1 as strings don't have child nodes and in the $Root case it is not an error it just selects nothing as $Root has no child elements.
That is selecting nodes in your input document. brg David
This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________
|

Cart



