all groups > dotnet xml > may 2005 >
You're in the

dotnet xml

group:

XPath exclusion expression


XPath exclusion expression Marc Jennings
5/26/2005 12:00:00 AM
dotnet xml:
Hi there,

I have an XML document that I am trying to pull some information from.
The structure is similar to the following.

[quoted text, click to view]

I can select each item that is not of type "SubcategoryLevel1"
individually with

[quoted text, click to view]

etc, but I cannot be sure how many of these fields will exist in the
file.

Is it possible to select all child nodes of <pricelist> that do NOT
have a name of "subcategoryLevel1". Something like

[quoted text, click to view]

(which I know already doesn't work)

Any help gratefully accepted.

Thanks
Re: XPath exclusion expression Martin Honnen
5/26/2005 12:00:00 AM


[quoted text, click to view]


[quoted text, click to view]

Here is how:
/pricelist/*[not(self::subcategoryLevel1)]

--

Martin Honnen --- MVP XML
Re: XPath exclusion expression Marc Jennings
5/26/2005 12:00:00 AM
Thankyou Martin. You saved me several more hours of Googling!

On Thu, 26 May 2005 13:34:12 +0200, Martin Honnen <mahotrash@yahoo.de>
[quoted text, click to view]
AddThis Social Bookmark Button