XPat Query

Hello everyone,

I have the following XML file:

<INSTRUMENT_DATA>

<INSTRUMENT TYPE="Balance" DATA_SOURCE="" PARSE_TYPE=""/>

<INSTRUMENT TYPE="HPLC" DATA_SOURCE="" PARSE_TYPE="XML Parsing"/>

<INSTRUMENT TYPE="Empower" DATA_SOURCE="Adapter" PARSE_TYPE="XML Parsing"/>

</INSTRUMENT_DATA>

I want to write an X-Path query to select the TYPE Attribute on all <INSTRUMENT> nodes that have a PARSE_TYPE attribute with value which is NOT "XML Parsing".

So far I have tried this:

/PROVIDER_DATA/INSTRUMENT_DATA/INSTRUMENT/@TYPE[@PARSE_TYPE!='XML Parsing']

I haven't tested it yet (b/c I have to write the code that uses this function)

but I havea feeling that something is missing.

Can anyone tell me if the above line of XPath will do the trick?

Thanks

Susan
[932 byte] By [Suzi167] at [2007-11-20 10:29:59]
# 1 Re: XPat Query
Hello,

I figured out my own problem and here is the solution so other people can use it as well.

/PROVIDER_DATA/INSTRUMENT_DATA/INSTRUMENT[not(@PARSE_TYPE='XML Parsing')]/@TYPE

Susan
Suzi167 at 2007-11-10 3:26:50 >
# 2 Re: XPat Query
You could also use:
/PROVIDER_DATA/INSTRUMENT_DATA/INSTRUMENT[@PARSE_TYPE !='XML Parsing']/@TYPE
jkmyoung at 2007-11-10 3:27:50 >