How to Use WHERE condition in Xpath

One Star

How to Use WHERE condition in Xpath

Hi,
I want to fetch city based on the <AddressType> and <Name> based on <AddressType> and @sequence . Can any one let me know how to get it in the Xpath.
conditions are:
LegalEntity/Address/City and
LegalEntity/Address/Name AND @sequence=1
Please find the xml file details below:

<LegalEntity>
<Address>
<audit:Activity creation-date="2003-09-26T20:32:47.836" creation-user="global" update-date="2006-11-03T16:51:23.110" update-user="pc09123" />
<AddressType>PRMB</AddressType>
<City>HAMILTON</City>
<Country>BMU</Country>
<Name sequence="1">REFCO CAPITAL MARKETS, LTD</Name>
<Street sequence="1">ROSEBANK BUILDING</Street>
<ZipCode>HM 11</ZipCode>
</Address>
<Address>
<audit:Activity creation-date="2006-10-23T13:16:37.210" creation-user="pc09123" update-date="2006-10-23T13:16:37.210" update-user="pc09123" />
<AddressType>MAIL</AddressType>
<City>NEW YORK</City>
<Country>USA</Country>
<Name sequence="1">REFCO CAPITAL MARKETS LTD</Name>
<Street sequence="1">200 LIBERTY STREET</Street>
<ZipCode>10281</ZipCode>
</Address>
</legalEntity>
Employee

Re: How to Use WHERE condition in Xpath

Hi tvs,
Please refer to this page for examples of xpath expressions:
http://msdn.microsoft.com/en-us/library/ms256086.aspx
One Star

Re: How to Use WHERE condition in Xpath

Hi,
Here's an example specific to Talend. http://bekwam.blogspot.com/2011/05/talend-open-studio-walkthrough-using.html There are some more TOS xpath posts on the blog if you search for 'xpath'.
-Carl