Entities are not resolved properly if document instances of a DTD with
different internal subsets are loaded recursively
------------------------------------------------------------------------------------------------------------------------
Key: XALANJ-2306
URL: http://issues.apache.org/jira/browse/XALANJ-2306
Project: XalanJ2
Type: Bug
Components: XSLTC
Versions: 2.7
Environment: Xalan-J 2.7.0 (and earlier versions) especially Java 5.0
Reporter: Michael Hedenus
A stylesheet recursively loads documents via document()-function which are all
instances if a special DTD but have different local subsets. If the subset
contains entity definitions, they are not resolved properly. Here is a use case:
Consider the following stylesheet and three test documents doc1.xml, doc2.xml
doc3.xml
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="document">
Data: <xsl:value-of select="unparsed-entity-uri(@data)"/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="parent">
Parent: <xsl:value-of select="."/>
<xsl:if test="not(normalize-space(text())='')">
<xsl:apply-templates select="document(.)"/>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0"?>
<!DOCTYPE document [
<!NOTATION type PUBLIC "text/plain">
<!ENTITY entity SYSTEM "data1" NDATA type>
<!ELEMENT document (parent)>
<!ATTLIST document data ENTITY #REQUIRED>
<!ELEMENT parent (#PCDATA)>
]>
<document data="entity">
<parent>doc2.xml</parent>
</document>
<?xml version="1.0"?>
<!DOCTYPE document [
<!NOTATION type PUBLIC "text/plain">
<!ENTITY entity SYSTEM "data2" NDATA type>
<!ELEMENT document (parent)>
<!ATTLIST document data ENTITY #REQUIRED>
<!ELEMENT parent (#PCDATA)>
]>
<document data="entity">
<parent>doc3.xml</parent>
</document>
<?xml version="1.0"?>
<!DOCTYPE document [
<!NOTATION type PUBLIC "text/plain">
<!ENTITY entity SYSTEM "data3" NDATA type>
<!ELEMENT document (parent)>
<!ATTLIST document data ENTITY #REQUIRED>
<!ELEMENT parent (#PCDATA)>
]>
<document data="entity">
<parent></parent>
</document>
New transform doc1.xml with the stylesheet. The result is:
Data: file:///D:/Michael/xslt/test/data1
Parent: doc2.xml
Data: file:///D:/Michael/xslt/test/data1
Parent: doc3.xml
Data: file:///D:/Michael/xslt/test/data1
Parent:
The result should be:
Data: file:///D:/Michael/xslt/test/data*****1****
Parent: doc2.xml
Data: file:///D:/Michael/xslt/test/data*****2****
Parent: doc3.xml
Data: file:///D:/Michael/xslt/test/data*****3****
Parent:
This happens only if XSLTC is used but not if the processor runs in
interpretive mode.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]