Subject: RE: [xsl] positional predicates in XPath vs XQL From: "Howard Katz" <howardk@xxxxxxxxxx> Date: Sat, 24 Nov 2001 03:36:42 -0800 |
As I was saying to Chris, a misunderstanding of section 2.4 of the XPath specification on predicates. Howard > -----Original Message----- > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Michael Kay > Sent: Saturday, November 24, 2001 3:04 AM > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: RE: [xsl] positional predicates in XPath vs XQL > > > No, The XPath query /section/para[1] retrieves the first para element of > every section. What made you think otherwise? > > Mike Kay > > > -----Original Message----- > > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx > > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Howard Katz > > Sent: 23 November 2001 23:36 > > To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx > > Subject: [xsl] positional predicates in XPath vs XQL > > > > > > I'm implementing an engine that evaluates XPath. I'm > > currently working on > > the part of the engine that implements positional predicates. I've > > previously worked this out for location paths in XQL, but I think the > > semantics are different in the two languages and want to make sure I > > understand the differences. > > > > In XQL if you say (pretending for the moment that positions > > start from 1 as > > they do in XPath, rather than 0): > > > > /section/para[ 1 ] > > > > and you have a tree that looks like this: > > > > 1 section > > 2 para > > 3 para > > 4 section > > 5 para > > 6 section > > 7 para > > 8 para > > 9 para > > > > you'll get back this nodeset: > > > > <2>, <5>, <7> > > > > You can paraphrase this XQL query as saying, "Give me back > > the 1st child > > node of each <section> element." Similarly, "/section/para[ 2 > > ]" returns > > <3>, <8>, and if you say "/section/para[ 3 ]", you get back > > the single node, > > <9>. > > > > To my understanding, the same location path in XPath only > > returns a single > > node, <2>. Is my understanding correct? > > > > Howard > > > > > > > > > > > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] positional predicates in , Michael Kay | Thread | [xsl] dynamic grouping of tabular d, Dan Diebolt |
RE: [xsl] positional predicates in , Howard Katz | Date | RE: [xsl] getting parsed documents , Chris Bayes |
Month |