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

side effects when debugging

Subject: side effects when debugging
From: "Nick Laqua" <Nick.Laqua@xxxxxxxxxxx>
Date: Tue, 12 Aug 2003 17:35:22 +0200
java side effects
> Hi everybody,
> 
> I hope I don't mention a known problem though I checked the xsl faq and the list archives.
> 
> I experienced strange behaviour depending on the debug settings of the processor (see processor version below).
> 
Vendor: Apache Software Foundation
Vendor URL: http://xml.apache.org/xalan-j



> I am using the following stylesheet:
> 
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
>   
> 
>   <xsl:output method="xml" version="1.0" indent="yes"/>
> 
>   <xsl:template match="D">
>       <xsl:for-each select="A">
>       	<xsl:sort select="POSITION" data-type="number" order="ascending"/>
>       	<xsl:element name="PositionNr">
>         	       <xsl:value-of select="POSITION"/>
>       	</xsl:element>  
>       </xsl:for-each>
>   </xsl:template>    
> </xsl:stylesheet>
> 
> 
> 
> The input file looks like this:
> 
> <?xml version = "1.0" encoding = "ISO-8859-1"?>
> <D>
> 	<A>
> 	   <POSITION>5</POSITION>
> 	   <ACTION>1</ACTION>
> 	</A>   	
> 	<A>
> 	   <POSITION>1</POSITION>
> 	   <ACTION>1</ACTION>
> 	</A>   	
> 	<A>
> 	   <POSITION>3</POSITION>
> 	   <ACTION>1</ACTION>
> 	</A>   	
> </D>
> 
> 
> Without debugging options (command line inline), the result looks like this (obviously correct):
> 
> t:/Programme/JRE/1.4.1/bin/java.exe -cp d:/cvsworking/nl/dev/classes/xalan.jar 
>     org.apache.xalan.xslt.Process -in d:/cvsworking/nl/dev/java/newtron/system/impl/a2a/std/ressources/mapping/test/xml/test_sort.xml 
>     -xsl d:/cvsworking/nl/dev/java/newtron/system/impl/a2a/std/ressources/mapping/test/xslt/test_sort.xslt
> <?xml version="1.0" encoding="UTF-8"?>
> <PositionNr>1</PositionNr>
> <PositionNr>3</PositionNr>
> <PositionNr>5</PositionNr>
> 
> 
> But enabling debugging (for instance trace selection events = -TS), the result is different (though using the same input):
> 
> t:/Programme/JRE/1.4.1/bin/java.exe -cp d:/cvsworking/nl/dev/classes/xalan.jar 
>     org.apache.xalan.xslt.Process -TS -in d:/cvsworking/nl/dev/java/newtron/system/impl/a2a/std/ressources/mapping/test/xml/test_sort.xml
>      -xsl d:/cvsworking/nl/dev/java/newtron/system/impl/a2a/std/ressources/mapping/test/xslt/test_sort.xslt
> <?xml version="1.0" encoding="UTF-8"?>
> <PositionNr>1</PositionNr>
> <PositionNr>3</PositionNr>
> <PositionNr>5</PositionNr>
> <PositionNr>5</PositionNr>
> <PositionNr>1</PositionNr>
> <PositionNr>3</PositionNr>
> 
> 
> As you can see, in the second case, firstly all nodes are sorted correctly, but additional the same nodes are added in document order.
> 
> Is this a "design mistake" by me or a bug/something specific to xalan ? In this case, I might post it to some xalan list.
> 
> 
> Thx a lot in advance
> 
> Cheers Nick

 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.