[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: find the name of the child after root
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. ________________________________________________________________________
|
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
|