Welcome to WebmasterWorld Guest from 54.158.187.118

Forum Moderators: open

Message Too Old, No Replies

XPath Anyone ?

     
4:56 pm on Jul 24, 2013 (gmt 0)

New User

joined:July 30, 2012
posts:6
votes: 0


Hi folks, hope someone can help me.

I have an XML file which i am trying to filter by Brand using XPath, there may be other ways of doing it but the particular application i am using requires XPath.

So if i set the XPath as /Table i get 6000 elements, each one looking something like this :

<Table>
<MatrixID>1533</MatrixID>
<Brand>Bassaya</Brand>
<ProductCode>basagnez</ProductCode>
<ShortDescription>Bassaya Agnez BlackL/XL</ShortDescription>
<Range>Bassaya Agnez</Range>
<StockLevel>Green</StockLevel>
<Colour>Black</Colour>
<Size>L/XL</Size>
<SupplyType>Stock Lines</SupplyType>
<Trade>14.24</Trade>
<RRP>29.99</RRP>
</Table>

Great, but i want to filter out all the Brands except one, i'll say Bassaya for arguments sake as it is in the preview.

So my understanding was that something like this should work

/Table[Brand=Bassaya] .. but it fails.

sorting by price greater than works like this

/Table[RRP>49.99] ... so i guess i'm kinda on the right track, anybody know any better ?

Thanks for your help folks.
9:53 pm on July 28, 2013 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:May 31, 2005
posts:1108
votes: 0


You need to put quotes around Bassaya e.g.
/Table[Brand="Bassaya"]
1:17 pm on Aug 1, 2013 (gmt 0)

New User

joined:July 30, 2012
posts:6
votes: 0


Sorry for the late reply, got the job sorted perfectly. Thank you very much for your help !
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members