Serialize document with internal DTD using DOMWriter ( Xerces )

S

Simon

Hi,

I'm trying to serialize an XML document to a file using XERCES-C++
2.1.0 . The Document contains an internal DTD.

The DTD contains some elements with default values like the following
snippet:

<!ELEMENT SFLOPTRECPATTERN (#PCDATA)>
<!ATTLIST SFLOPTRECPATTERN
string CDATA "&quot;&quot; &quot;/&quot; &quot;-&quot; 0 9"
....and the document contains some elements like this one:

<SFLOPTRECPATTERN string="&quot;&quot; &quot;/&quot; &quot;-&quot; 0
9"/>

My problem is:

when I parse the file, and later try to serialize it with DOMWriter's
writeToString-method, it breaks my internal DTD.
The above snippet will now look like this ( later resulting in a
parser error ),

<!ELEMENT SFLOPTRECPATTERN (#PCDATA)>
<!ATTLIST SFLOPTRECPATTERN
string CDATA """ "/" "-" 0 9"
while the corresponding element still remains correct:

<SFLOPTRECPATTERN string="&quot;&quot; &quot;/&quot; &quot;-&quot; 0
9"/>

Can anyone tell me, how I could prevent DOMWriter from changing my
&quot; to " in a DTD?

Regards,

Simon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top