Antwort: Re: Antwort: DTD to DOM to XML

Joe,

the IBM alphaWork XML4J 3.0.1tells me

--- snip ---
[Fatal Error] _.dtd:_:_: The markup in the document preceding the root element must be well-formed.
org.xml.sax.SAXParseException: The markup in the document preceding the root element must be well-formed.
        at java.lang.Throwable.<init>(Throwable.java:74)
        at java.lang.Exception.<init>(Exception.java:38)
        at org.xml.sax.SAXException.<init>(SAXException.java:45)
        at org.xml.sax.SAXParseException.<init>(SAXParseException.java:53)
        at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1318)
        at org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(XMLDocumentScanner.java:616)
        at org.apache.xerces.framework.XMLDocumentScanner.abortMarkup(XMLDocumentScanner.java:670)
        at org.apache.xerces.framework.XMLDocumentScanner$PrologDispatcher.dispatch(Compiled Code)
        at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.java:381)
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1208)
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1247)
        at com.ibm.xml.parsers.NonValidatingDOMParser.parse(NonValidatingDOMParser.java:231)
--- snip ---

when I feed it a XML DTD (non XML4J specific informations blanked out using "_".).

Look at the first line of the message. It says:
     "The markup in the document preceding the root element must be well-formed.".

So, a XML DTD is not even well-formed. How can it be a XML instance?

I know, citing a computer program is a rather weak argumentation. But I also studied the
"Extensible Markup Language (XML) 1.0" W3C recommendation (Feb 10, 1998).
So, I know the XML DTD can be inlined in the prolog of the associated XML instance.
But as far as I know (sorry, I am not a W3C member) itself is not a XML instance.

BTW, IBM alphaWork did a very good job implementing their XML parser library.
The only bugs I've found so far were:
  - NDATA entity handling in versions prior to 3.0.1
  - notation handling in versions prior to 3.0.1

Carsten

Received on Tuesday, 13 June 2000 09:52:50 UTC