[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: XPath2 preceding / following axis and attributes

Subject: RE: XPath2 preceding / following axis and attributes
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 10 Jan 2006 10:53:42 -0000
svchost virtual memory
I think the results here are correct. The text node "205" is a descendant of
the element containing the attribute, but it's not a descendant of the
attribute, so it is included in the result. 

Or have I misunderstood?

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Dimitre Novatchev [mailto:dnovatchev@xxxxxxxxx] 
> Sent: 10 January 2006 10:11
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re:  XPath2 preceding / following axis and attributes
> 
> On 1/10/06, Michael Kay <mike@xxxxxxxxxxxx> wrote:
> > > In fact, it is easy to see that the following two XPath 
> expressions
> > > are equivalent:
> > >
> > >       someElement/@someAttribute/following::someNodeTest
> > >
> > > and
> > >
> > >      someElement/following::someNodeTest
> >
> > No, I don't think that's correct. The former includes descendants of
> > someElement, the latter doesn't.
> 
> If so, then Saxon 8.6.1 produces an unexpected result:
> 
> When this transformation:
> 
> <xsl:stylesheet version="2.0"
>  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> >
> 
>  <xsl:output omit-xml-declaration="yes" indent="yes"/>
> 
>  <xsl:template match="/">
>    <xsl:sequence select=
>     "/*/Sample/Data[1]/@category/following::node()"
>     />
>  </xsl:template>
> </xsl:stylesheet>
> 
> 
> is applied with Saxon 8.6.1on this source xml document:
> 
> <Performance>
>   <Sample timestamp="Wednesday, November 30, 2005 5:10:02 PM">
>     <Data category="Memory" counter="Available MBytes" 
> instance="">205</Data>
>     <Data category="Process" counter="Private Bytes"
> instance="lsass">1.397146E+07</Data>
>     <Data category="Process" counter="Virtual Bytes"
> instance="svchost">6.877594E+07</Data>
>     <Data category="Process" counter="Virtual Bytes"
> instance="winword">5.653791E+08</Data>
>   </Sample>
>   <Sample timestamp="Wednesday, November 30, 2005 5:10:04 PM">
>     <Data category="Memory" counter="Available MBytes" 
> instance="">192</Data>
>     <Data category="Process" counter="Private Bytes"
> instance="lsass">1.403699E+07</Data>
>     <Data category="Process" counter="Virtual Bytes"
> instance="svchost">6.877594E+07</Data>
>     <Data category="Process" counter="Virtual Bytes"
> instance="winword">5.653791E+08</Data>
>   </Sample>
> </Performance>
> 
> the following result is produced:
> 
> 205
>     <Data category="Process" counter="Private Bytes"
> instance="lsass">1.397146E+07</Data>1.397146E+07
>     <Data category="Process" counter="Virtual Bytes"
> instance="svchost">6.877594E+07</Data>6.877594E+07
>     <Data category="Process" counter="Virtual Bytes"
> instance="winword">5.653791E+08</Data>5.653791E+08
> 
>   <Sample timestamp="Wednesday, November 30, 2005 5:10:04 PM">
>     <Data category="Memory" counter="Available MBytes" 
> instance="">192</Data>
>     <Data category="Process" counter="Private Bytes"
> instance="lsass">1.403699E+07</Data>
>     <Data category="Process" counter="Virtual Bytes"
> instance="svchost">6.877594E+07</Data>
>     <Data category="Process" counter="Virtual Bytes"
> instance="winword">5.653791E+08</Data>
>   </Sample>
>     <Data category="Memory" counter="Available MBytes" 
> instance="">192</Data>192
>     <Data category="Process" counter="Private Bytes"
> instance="lsass">1.403699E+07</Data>1.403699E+07
>     <Data category="Process" counter="Virtual Bytes"
> instance="svchost">6.877594E+07</Data>6.877594E+07
>     <Data category="Process" counter="Virtual Bytes"
> instance="winword">5.653791E+08</Data>5.653791E+08
> 
> 
> So, is this a Saxon 8.6.1 bug in handling the "following" axis?
> 
> --
> Cheers,
> Dimitre Novatchev
> ---------------------------------------
> To avoid situations in which you might make mistakes may be the
> biggest mistake of all.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.