You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Ed Blachman <Ed...@trellix.com> on 2000/10/07 00:19:06 UTC

another conformance bug in parameter handling: import precedence ignored

Tested in xalan-J 1.2D01 -- not the latest, I know :-(.

Given two stylesheets, A and B, where A imports B;
If both A and B declare an xsl:param and give it a value...
The value recognized (all else being equal) should be the one declared in A,
not B, as A has higher import precedence.

This is what saxon and xt do, but not xalan.

(Scott, for all I know this might be just another occurrence of the param
bug I reported a while back... or it might not.)

-- ed

stylesheet A (paramTest2.xslt):
---
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:import href="subsheet.xslt"/>
	<xsl:param name="test" select="'main stylesheet, should have highest
precedence'"/>
	<xsl:output method="xml" version="1.0" encoding="UTF-8"
indent="yes"/>
</xsl:stylesheet>
---

stylesheet B (subsheet.xslt):
---
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" version="1.0" encoding="UTF-8"
indent="yes"/>
	<xsl:param name="test" select="'subsheet, should be overridden by
main sheet'"/>
	<xsl:template match="/">
		<xsl:value-of select="$test"/>
	</xsl:template>
</xsl:stylesheet>
---

testing xml file (dummy.xml):
---
<?xml version="1.0"?>
<dummy/>
---

command lines:
---
xalan:  java -classpath c:\xalan\xalan.jar;c:\xalan\xerces.jar
org.apache.xalan.xslt.Process -in dummy.xml -xsl paramTest2.xslt -out
xalan2.txt
instant saxon:  "d:\Program Files\Instant Saxon\saxon.exe" dummy.xml
paramTest2.xslt > insax2.txt
xt:  java -classpath c:\xt\xt.jar;c:\xalan\xerces.jar
-Dcom.jclark.xsl.sax.parser=org.apache.xerces.parsers.SAXParser
com.jclark.xsl.sax.Driver dummy.xml paramTest2.xslt xt2.txt
---

xalan output:
---
<?xml version="1.0" encoding="UTF-8"?>
subsheet, should be overridden by main sheet
---

saxon output:
---
<?xml version="1.0" encoding="UTF-8" ?>main stylesheet, should have highest
precedence
---

xt output:
---
<?xml version="1.0" encoding="utf-8"?>
main stylesheet, should have highest precedence
---