Benson Margulies <bimargul...@gmail.com> wrote on 11/17/2009 12:28:17 PM:

> Two things.
>
> A resolver works as advertised, thanks.
>
> But.
>
> Setting the 'CharacterData' in the LSInput to an empty string
> doesn't work. Sticking an XML Comment in there worked (temporarily,
> I just want no DTD at all. I'll resolve to an actual DTD when I fix
> 2dozen other stupid mistakes I've made today.)

To the LSParser, the empty string has the same meaning as null when reading
from an LSInput.>

======================

>From the spec [1]:

The LSParser will look at the different inputs specified in the LSInput in
the following order to know which one to read from, the first one that is
not null and not an empty string will be used:

   1. LSInput.characterStream
   2. LSInput.byteStream
   3. LSInput.stringData
   4. LSInput.systemId
   5. LSInput.publicId

======================

When I said specify a 0 byte stream I really meant something like:

LSInput input = ...;
input.setByteStream(new java.io.ByteArrayInputStream(new byte[0]));

or

LSInput input = ...;
input.setCharacterStream(new java.io.StringReader(""));

Thanks.

[1]
http://xerces.apache.org/xerces2-j/javadocs/api/org/w3c/dom/ls/LSInput.html

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrgla...@ca.ibm.com
E-mail: mrgla...@apache.org

Reply via email to