[xml] multiple XPath expressions in one expression



Hello,

I have a question about XPath. I am not sure if
it can do what I want.
Suppose I have a XML file like this one:

<SOFTWARE>
   <TYPE name="office">
      <VENDOR name="Microsoft">
         <PACKAGE name="Office" version="97" />
         <PACKAGE name="Office" version="2000" />
      </VENDOR>
      <VENDOR name="Sun">
         <PACKAGE name="Staroffice" />
      </VENDOR>
      <VENDOR name="Kde">
         <PACKAGE name="KOffice" />
      </VENDOR>
   </TYPE>
   <TYPE name="development">
      <VENDOR name="Microsoft">
         <PACKAGE name="Visual Studio" version="6.0"
/>
      </VENDOR>
      <VENDOR name="Kde">
         <PACKAGE name="KDevelop" version="2.0"/>
      </VENDOR>
   </TYPE>
</SOFTWARE>

Is it possible to run these 2 xpath expressions in one
xpath expression:
/SOFTWARE/TYPE/VENDOR[ name='Microsoft']/PACKAGE[ name='Office']
/SOFTWARE/TYPE/VENDOR[ name='Kde']/PACKAGE

I'd like to have a result where I see all the office
products of Microsoft
and all the products of Kde.
I tried some different approaches but didn't succeed
so far.
is XPath able to run such a query?

Thanks in advance,

Gerry Jacobs

__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]