xsl-list
[Top] [All Lists]

Re: [xsl] Help with elements nested at different levels

2007-12-30 15:25:45
Vincenzo Menanno wrote:

Ken already emailed me a suggestion where I could just use //Script to get all the script elements... but the problem with that is the CustomMenuCatalog might also have MenuItems with Script elements.

Originally I had this to get me all the script elements...

/FMPReport/File[1]/ScriptCatalog[1]/Script

But that now only gets me to the first Script if it is not within a group.

This however picks up all the entries inside the CustomMenuCatalog

//Script

Any suggestions on how I can get the complete list of all the Script entries even if they are nested 1, 2, 3, ...n levels?

Thanks

Hi Vincenzo,

To find all Script elements having a certain parent in common, you can use:

//parentnodename/Script

i.e.:

//ScriptCatalog/Script

or:

//group/Script

This will rule out any other possibilities. If you want all Script elements that do not have a parent of "CustomMenuCatalog" (assuming it will be at the first level above) you can do this, too:

//*[not(self::CustomMenuCatalog)]/Script

which will give you all Script elements that do not have CustomMenuCatalog as a direct parent.

HTH,

Cheers & Happy New Year,
-- Abel Braaksma

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>