You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xerces.apache.org by ap...@ca.ibm.com on 2000/03/14 20:55:21 UTC

Xerxes-Java defer-node-expansion bug or inconsistency


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
apowell@ca.ibm.com



Re: Xerxes-Java defer-node-expansion bug or inconsistency

Posted by Andy Clark <an...@apache.org>.
apowell@ca.ibm.com wrote:
> 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.

You have to be careful about which version of XML4J you are using
with LotusXSL. I think the LotusXSL documentation should tell you
what version of XML4J to use.

-- 
Andy Clark * IBM, JTC - Silicon Valley * andyc@apache.org