This asks the parser to start with the root "TaskManager" element, which also should be the first element in the document because we used the "/" preceding the element name. The TaskManager element should have a child element "Project",
whose identity is insignificant... the only criteria is that TaskManager have a child element Project. Similarly, Project must have a child element "Job". The criteria you are specifying (kind of like a WHERE clause in SQL) is that the Job element must have
an "id" attribute with value 4. If all of these criteria in the path are met, then a pointer to the "Job" element node is returned. From there, you can access its child elements or any descendant, or even ask it for its parent or ancestors. XPath is a very
powerful language, but requires breaking out of the SQL mindset of returning tabular resultsets. XPath returns pointers to nodes.
kaevans
Participant
1150 Points
230 Posts
Microsoft
Re: querying xml data
Sep 05, 2003 11:16 AM|LINK