|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: bug in LibXSLT???
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. All of the output paths (/a/b/c/d etc...) are being output from the same named template each time, which just does this: <xsl:for-each select="ancestor-or-self::*/@name"> simon input.xml
================================
<?xml version="1.0"?>
<grammar>
<start>
<element name="a">
<optional>
<element name="b">
<optional>
<element name="c">
<optional>
<attribute name="d">
<choice>
<value>
standard
</value>
</choice>
</attribute>
</optional>
</element>
</optional>
</element>
</optional>
</element>
</start>
</grammar>bug.xsl ================================ <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" > <xsl:output method="xml" indent="yes"/> <xsl:template match="choice/*">
<other>
<path>
<xsl:call-template name="RNGPathToSelf"/>
</path>
<xsl:apply-templates/>
</other>
</xsl:template> <xsl:template match="value|optional|element|attribute">
<something>
<path>
<xsl:call-template name="RNGPathToSelf"/>
</path>
<xsl:apply-templates/>
</something >
</xsl:template> <xsl:template name="RNGPathToSelf">
<xsl:for-each select="ancestor-or-self::*/@name">
<xsl:text>/</xsl:text>
<xsl:value-of select="."/>
</xsl:for-each>
</xsl:template></xsl:stylesheet> OUTPUT ================================ [simons-tibook:~/Sites/simonwoodside.com/exp] woodside% xsltproc bug.xsl input.xml <?xml version="1.0"?>
<other><path>/c/d/a/b</path>
standard
</other> </something>
</something>
</something>
</something>
</something>
</something>
</something>[simons-tibook:~/Sites/simonwoodside.com/exp] woodside% sabcmd bug.xsl input.xml <?xml version="1.0" encoding="UTF-8"?> <something>
<path>/a</path>
<something>
<path>/a</path>
<something>
<path>/a/b</path>
<something>
<path>/a/b</path>
<something>
<path>/a/b/c</path>
<something>
<path>/a/b/c</path>
<something>
<path>/a/b/c/d</path> <other>
<path>/a/b/c/d</path>
standard
</other> </something>
</something>
</something>
</something>
</something>
</something>
</something>[simons-tibook:~/Sites/simonwoodside.com/exp] woodside% XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|

Cart








