| BachusII on Aug 15, 2006 at 4:01:38 PM (# 1) /books/book[/related/@categoryname='Data' and /related/@categoryname='XML'] ?
ARWolff on Aug 15, 2006 at 4:40:19 PM (# 2)Could you provide a snippet of the XML you hope to query? Your first predicate looks right, if you have a structure like
<books> <book cagtegoryname='XML'>...</book1> <book cagtegoryname='Data'>...</book1> <book cagtegoryname='XML'>...</book1>
<book cagtegoryname='Cooking'>...</book1> <book cagtegoryname='Art History'>...</book1> </books>
mavilym on Aug 15, 2006 at 11:30:28 PM (# 3) This message has been edited.sorry i sent the snippet, but it did not displayed :-( i am sending it again. after converting tag start and elements to their HTML code.
The first query returns all the books i want just book1.
<books> <book name='book1'> <related categoryname='Data'/> <related categoryname='XML'/> </book> <book name='book2'> <related categoryname='Data'/> </book> <book name='book3'> <related categoryname='XML'/> </book> </books> mavilym on Aug 16, 2006 at 1:14:43 AM (# 4)For ex: i want to get "book1" that has both categoryname='Data' and categoryname='XML'. Not just 'XML' or just 'Data' ARWolff on Aug 16, 2006 at 3:38:52 AM (# 5)OK. Bachusll was close.
select = "//books/book[related[@categoryname='Data'] and related[[@categoryname='XML']]"
This selects all book elements who have at least one related child with a categoryname attribute of "Data," and at least one related child with a categoryname attribute of "XML." mavilym on Aug 16, 2006 at 5:11:00 AM (# 6)"//books/book[related[@categoryname='Data'] and related[@categoryname='XML']]"
solved my problem. thanks. darrellblackhawk on Apr 29, 2007 at 7:01:04 PM (# 7)undefined
|