| Author |
XSL: cycle every element
|
Marco Rossi
Greenhorn
Joined: Jul 01, 2011
Posts: 28
|
|
Hi all,
I need to verify if any element of an XML file contains an attribute called "id"; for example:
And this is what I wrote but it seems not working
When I print $currentNode I would like to get printed the name of the node.
Thanks
Marco
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 13842
|
|
I don't know what that "$xmlfile" variable might be, but you are only looking at its children in that code, not all of its descendants.
Why don't you just write an XPath expression which selects all nodes with an "id" attribute? That would be far easier than writing your own code to search the document.
|
 |
g tsuji
Ranch Hand
Joined: Jan 18, 2011
Posts: 225
|
|
@Marco Rossi
Instead of this:
>select="$currentNode"
do this
|
 |
 |
|
|
subject: XSL: cycle every element
|
|
|