Ok, but it doesn't work with node() or processing-instruction() either

<a>
  <b/>
  <?toc order-by="x"?>
  <c/>
</a>

c.selectSingleNode("preceding-sibling::*") returns b
c.selectSingleNode("preceding-sibling::node()") returns b
c.selectSingleNode("preceding-sibling::processing-instruction()")
returns null

/Mattias

> -----Original Message-----
> From: [EMAIL PROTECTED]
[mailto:jaxen-interest-
> [EMAIL PROTECTED]] On Behalf Of James Strachan
> Sent: den 19 april 2002 12:44
> To: Mattias Reichel; 'bob mcwhirter'
> Cc: [EMAIL PROTECTED]
> Subject: Re: [Jaxen] Possible bug with processing instructions
> 
> From: "Mattias Reichel" <[EMAIL PROTECTED]>
> > Hmm,
> >
> > Switching to preceding axis for clarity, but issue is the same.
> >
> > From Michael Kay's XSLT Programmers Reference 2nd Edition by Wrox
Press,
> > page 364:
> >
> > preceding:
> > This selects all the nodes that appear before the origin node,
excluding
> > the ancestors of the origin, in reverse document order. If the
origin is
> > an element node, this effectively means that it contains all the
text
> > nodes, element nodes, comments, and processing instructions in the
> > document that finish before the start tag of the origin element. The
> > preceding axis will never contain attribute or namespace nodes.
> >
> > Is he dead wrong here or what?
> 
> The XPath spec also says...
> 
> the preceding-sibling axis contains all the preceding siblings of the
> context node; if the context node is an attribute node or namespace
node,
> the preceding-sibling axis is empty
> 
> 
> The issue is how does the '*' node test filter the axis.
> 
> So the preceding-sibling axis contains all previous nodes of any type.
> Though using "*" filters the axis to just elements. Using node() will
see
> all node types. Using processsing-instruction() will only see PIs etc.
> 
> I think this is correct. Am about to build some more test cases to
check
> this is how Jaxen behaves...
> 
> James
> 
> 
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
> 
> 
> _______________________________________________
> Jaxen-interest mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jaxen-interest



_______________________________________________
Jaxen-interest mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jaxen-interest

Reply via email to