I'm sending some old school dtd-based XML through a SAX parser mostly
just to assemble it from the dozens of xml files included in the
top-level file as entities, using the old
identity-transform-to-serialize techique:

    t.transform(new SAXSource(parser, new InputSource(inStream)), new
StreamResult(outputStream));

then sending the resultant serialized bytes over the wire to another app
which will parse it again. Both parsers are Xerces-J 2.8.1. The problem
I'm running into is the XML going in has entities that look like:

  <!ENTITY wan-gw
     '<systemitem class="systemname">wan-gw</systemitem>'              >

coming out of the serialization it looks like

<!ENTITY wan-gw "<systemitem class="systemname">wan-gw</systemitem>">

Which Xerces rejects with a

    The declaration for the entity "wan-gw" must end with '>'.

My memory of entity syntax is spotty because I haven't used them in
years, but I'm assuming the problem is that with double quotes inside
the entity text, single quotes are required to quote it, but the
serializer is just assuming double quotes.

So my questions are:

1) Should  this be considered a bug?

2) Is there a way to tell the serializer which kind of quotes to use
(which I assume won't really help if there are other cases with the
single quotes in the entity text).

3) Is there a better way to write that entity in the first place? Some
better way to escape the double quotes?


Thanks,

Eric

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to