Actions
Bug #2084
closedFailed to execute an XSLT 3.0 stylesheet that uses the 'parse-xml-fragment' function
Start date:
2014-06-02
Due date:
% Done:
100%
Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:
Description
The transformation of an XSLT 3.0 stylesheet that uses the parse-xml-fragment function fails if an external XML parser is provided. The custom XML parser should have an EntityResolver set.
To reproduce the problem you can execute from command line the following transformation:
d:\workspace\eXml>java -Xmx180m -Xss4096k -Xms48m -cp d:\workspace\eXml\lib\saxon9ee.jar;d:\workspace\eXml\lib\custom_parser.jar net.sf.saxon.
Transform -xsl:samples/test.xsl -s:samples/personal.xml -x:ro.sync.exml.test.XMLReaderWrapper
Error
FODC0006: First argument to parse-xml-fragment() is not a well-formed and
namespace-well-formed XML fragment. XML parser reported: I/O error reported by XML parser
processing file:/d:/workspace/eXml/samples/test.xsl: Connection timed out: connect
Transformation failed: Run-time errors were reported
test.xsl
<xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:sequence
select="parse-xml-fragment('<testFragment>test</testFragment>')"/>
</xsl:template>
</xsl:stylesheet>
The custom XML reader, XMLReaderWrapper, could be found as attachment. It is a simple implementation that wraps an XMLReader obtained using SAXParserFactory. The entity resolver has the following implementation:
private EntityResolver entityResolver = new EntityResolver() {
@Override
public InputSource resolveEntity(String publicId, String systemId) throws SAXException,
IOException {
return null;
}
};
Files
Please register to edit this issue
Actions