I have an inconcistency or a bug. With JDK 1.1.7p (VisualAge for Java 3.0)
XML4J 3.0.0, and LotusXSL 0.19.2, this works, but with XML4J 3.0.0 and
LotusXSL 0.20.0 I have problems. It doesn't look like an XSL problem, but
the bug appears with changes to XSL.
I wish to read in an XML file with some entities. The Java code:
DOMParser parser = new DOMParser();
try
{
parser.setFeature( "http://xml.org/sax/features/validation", true);
parser.setFeature(
"http://apache.org/xml/features/dom/defer-node-expansion", false );
parser.setFeature(
"http://apache.org/xml/features/dom/create-entity-ref-nodes", true);
parser.setFeature( "http://xml.org/sax/features/external-general-entities",
true);
parser.setFeature(
"http://xml.org/sax/features/external-parameter-entities", true);
parser.parse( fileName );
} catch (SAXException se) {
System.out.println("sax exception: " + se );
se.printStackTrace();
} catch (IOException se) {
se.printStackTrace();
}
return parser.getDocument( );
The XML file:
<?xml version="1.0"?>
<!DOCTYPE testing [
<!ENTITY servicehelloworld
"
<service name='HelloWorld'>
<classname>HelloWorldService</classname>
<rootUri>http://localhost/</rootUri>
</service>
">
]>
<initialization>
<services>
&servicehelloworld;
</services>
</initialization>
When I have parser.setFeature(
"http://apache.org/xml/features/dom/defer-node-expansion", false ); then
when I print the document (using the FormatterToXML and TreeWalker) I get:
<?xml version="1.0" encoding="UTF-8"?>
<initialization>
<services>
&servicehelloworld;</classname></rootUri>/>
/>
/>
When I set this to true, I get:
<?xml version="1.0" encoding="UTF-8"?>
<initialization>
<services>
</services>
</initialization>
Using 0.19.2 of LotusXSL, I would get good results - the ENTITY would be
included as I'd expect.
Is this a bug or am I doing something wrong?
--
Adrian Powell
[EMAIL PROTECTED]