You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Dave Connet <co...@entelos.com> on 2000/09/21 22:04:41 UTC

DOMPrint creates invalid xml

The following xml shows the problem (I'm using the 9/20 build on NT):
<?xml version="1.0"?>
<!DOCTYPE Test [
<!ELEMENT Test (Ele1, Ele2)>
<!ELEMENT Ele1 (#PCDATA)* >
<!ATTLIST Ele1 ReadOnly (y|n) "n">
<!ELEMENT Ele2 (#PCDATA)* >
]>
<Test>
<Ele1 ReadOnly="y">Data</Ele1>
<Ele2/>
</Test>

DOMPrint produces:
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE Test[
<!ELEMENT Test (Ele1,Ele2)>
<!ELEMENT Ele1 (#PCDATA)*>
 <!ATTLIST Ele1 ReadOnly ENUMERATION>
<!ELEMENT Ele2 (#PCDATA)*>
]>
<Test>
<Ele1 ReadOnly="y">Data</Ele1>
<Ele2/>
</Test>

I found that the ENUMERATION string is written in DOMParser::attDef. Is
there a different way an inline DTD should be printed (other than calling
getInternalSubset() as DOMPrint does)?

I did work around the problem by creating a temporary external DTD that I
clean up later. I've now been using the xerces stuff for about a week - I'm
trying to convert some MSXML code - it works pretty well except for the
above and that the xalan transform doesn't seem to work right...

Dave Connet
connet@entelos.com
Entelos, Inc.