Use:
/*/*/*[@url = $this-page and related_info[@type=''x'] ]
I'd recommend that you get the XPath Visualizer and play with it to learn
XPath the fun way.
=====
Cheers,
Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
"Jerry O" <> wrote in message
news: m...
> Hi -
>
> I am stuck on what might be a simple Xpath expression, I just can't
> visualize the query.
>
> I have a node set that can be the child of any of three nodes. I would
> like to test if a node matching [@url = $this-page] has the child
> <related_info type="x" />.
>
> Here's my XML
> <?xml?>
> <root>
> <silo>
> <level_one url="w123">
> <related_info type="x"/>
> </level_one>
> <level_two>
> <nav_item url="w234">
> <related_info type="x"/>
> </nav_item>
> <nav_item url="x234">
> <related_info type="x"/>
> </nav_item>
> </level_two>
> <level_three>
> <nav_item url="w23w">
> <related_info type="x"/>
> </nav_item>
> <nav_item url="x2ww">
> <related_info type="x"/>
> </nav_item>
> </level_three>
> </silo>
> ...
> </root>
>
> I need to do two things.
>
> 1. See if the related info section exists, so I can adjust widths and
> the like.
> 2. Call a named template to operate on the related_info data.
>
> I'm almost at the point of creating a separate (flatter) XML for the
> related_info and be done with it.
>
> Let me know what you think.
>
>
> Jerry