[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: xsl:number from="/" level="any"
Thanks for reporting this. Bugs in xsl:number have a habit of lying dormant for years before anyone finds them! Now fixed in the Saxon Subversion repository, and I am adding the test case to the test suite. (Test numbering97 for those interested.) Michael Kay http://www.saxonica.com/ > -----Original Message----- > From: Deborah Pickett [mailto:debbiep-list-xsl@xxxxxxxxxx] > Sent: 09 March 2007 11:42 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: xsl:number from="/" level="any" > > This is in the context of xsl:number with @level="any". > > Reading the XSLT 2.0 recommendation it looks like @from is > allowed to be "/" to indicate a document node. > > Yet I get empty sequences whenever I try it with Saxon 8.8. > > I get the behaviour I expect with @from="/*". > > Here's an example, which uses processing instructions to show > a case where / has more than one child. > > Document: > <?xml version="1.0" encoding="UTF-8"?> > <?thing?> > <top> > <?thing?> > <child> > <?thing?> > <child><?thing?></child> > </child> > <child> > <?thing?> > </child> > </top> > <?thing?> > > Stylesheet: > <?xml version="1.0" encoding="UTF-8"?> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > version="2.0"> > > <xsl:template match="processing-instruction(thing)"> > <xsl:message> > <xsl:text>This thing gets xsl:number "</xsl:text> > <xsl:number count="processing-instruction('thing')" > from="/" level="any"/> > <xsl:text>" from / and xsl:number "</xsl:text> > <xsl:number count="processing-instruction('thing')" > from="/*" level="any"></xsl:number> > <xsl:text>" from /*.</xsl:text> > </xsl:message> > <xsl:apply-templates></xsl:apply-templates> > </xsl:template> > </xsl:stylesheet> > > Output: > This thing gets xsl:number "" from / and xsl:number "" from /*. > This thing gets xsl:number "" from / and xsl:number "1" from /*. > This thing gets xsl:number "" from / and xsl:number "2" from /*. > This thing gets xsl:number "" from / and xsl:number "3" from /*. > This thing gets xsl:number "" from / and xsl:number "4" from /*. > This thing gets xsl:number "" from / and xsl:number "5" from /*.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|