> It sounds like the kind of scenario where the solution might be to
bring the XML into your own XPathNavigator instance. From there you
can find the data you need with something like:
I've actually just started down that path
XPathDocument doc = new XPathDocument("<xml filename>");
XPathNavigator navigator = doc.CreateNavigator();
XPathNodeIterator iterator = nav.Select("<xpath expression>";
I've gotten that far, but hit a snag:
Dim xpd As XPathDocument = New XPathDocument(filename)
'create the associated navigator
Dim xpn As XPathNavigator = xpd.CreateNavigator()
xpn.Select("//template(parent(descendant-or-self::id = '" & pageID & "')")
Here's what I'm trying to do:
The XML is the site navigation. It's hierarchical, obviously. I pass a
'pageID' variable to the page that I then use in the XML transformation to
find out the 'active' link and open up the nodes accordingly.
Another bit of information stored the xml file is the specific template
variable I am using for each page. This template is inherited from the
'parent' node. So, the structure is a bit like this:
items
item
id = 1
template = purple
item
id = 2
item
id = 3
etc.
So, I'd like to be able to open the xml file and find the root item's
template value that belongs to the node with the current active item who's
id = the current value of the page.
(I hope that makes sense ;o)
I *think* my statement needs to be something like this:
//template(parent(descendant-or-self::id = '$currentID'))
Does that look about right? I'm in a bit of a hurry to get out the door, so
my syntax above might be incorrect. That said, the problem is that I'm not
sure how to pass the 'currentID' to the document using an xmlnavigator. I
can do it with the transform, but can I do it with the navigator?
-Darrel