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

Re: bug in LibXSLT???

Subject: Re: bug in LibXSLT???
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Fri, 7 Mar 2003 01:00:35 -0800 (PST)
libxslt omit xml declaration
--- S Woodside <sbwoodside@xxxxxxxxx> wrote:
> On Thursday, March 6, 2003, at 04:09  AM, Daniel Veillard wrote:
> 
> >   Well can you provide a concise example ?
> 
> OK, I reduced the input and code down a lot. It still displays the 
> potential bug. If I'm screwing something up, I'd love to know what.

I managed to simplify your example a little bit more and now we have
another, probably related problem.

This is the source xml document:


<grammar>   
  <start>     
    <element name="a">       
      <optional>         
        <element name="b">           
          <optional>             
            <element name="c">               
              <optional>                 
                <attribute name="d">                   
                </attribute>               
              </optional>             
            </element>           
          </optional>         
        </element>       
      </optional>     
    </element>   
  </start>
</grammar>


This transformation:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
version="1.0" >   
  <xsl:output omit-xml-declaration="yes"/>   
  <xsl:template match="attribute">     
      <path>         
        <xsl:call-template name="RNGPathToSelf"/>       
      </path>       
      <xsl:apply-templates/>     
  </xsl:template>   
  <xsl:template name="RNGPathToSelf">
    <xsl:variable name="vAncestors"
select="ancestor-or-self::*/@name"/>
    <xsl:for-each select="$vAncestors">       
      <xsl:text>/</xsl:text>       
      <xsl:value-of select="."/>     
    </xsl:for-each>   
  </xsl:template>
</xsl:stylesheet>

when applied on the above source xml document produces this result
(surrounding whitespace skipped to conserve space):

<path>/d/c/b/a</path>

As we see, the following code

    <xsl:for-each select="$vAncestors">       
      <xsl:text>/</xsl:text>       
    <xsl:value-of select="."/>     

does not output in document order the values of the nodes contained in
the nodeset.


All other XSLT processors I've tried produce the result as per spec:

<path>/a/b/c/d</path>




=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.