You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xerces.apache.org by Born Franz <Fr...@blr.spcnl.co.in> on 2000/02/06 17:32:52 UTC
CreateDOMDocument
Maybe I was a little too early in getting CreateDOMDocument and trying to
run it with xerces1.0.1 under VC++5.0.
Especially as I faced the problem, that
DOM_Element rootElem = doc.getDocumentElement();
returned a "0-pointer".
I applied the following changes (#else) and now it works.
DOM_DOMImplementation impl;
DOM_Document doc = impl.createDocument(
0, // root element namespace URI.
"company", // root element name
DOM_DocumentType()); // document type object (DTD).
#if 0
DOM_Element rootElem = doc.getDocumentElement();
#else
DOM_Element rootElem = doc.createElement("company");
doc.appendChild(rootElem);
#endif
----------
Now I'd like to know, how to parse a given DTD separately, so I can use it
for validation of the new created document.
Best regards,
Franz
Re: CreateDOMDocument
Posted by Chih-Hsiang Chou <ch...@jtcsv.com>.
This is a known bug in xerces 1.0.1 and has been fixed.
You can get the fix from CVS (copy and paste the code of
the 2nd constructor in DocumentImpl.cpp) or wait for the
upcoming new release.
Chih-Hsiang Chou
IBM Center for Java Technology - Silicon Valley
chchou@us.ibm.com
----- Original Message -----
From: "Born Franz" <Fr...@blr.spcnl.co.in>
To: <xe...@xml.apache.org>
Sent: Sunday, February 06, 2000 8:32 AM
Subject: CreateDOMDocument
Maybe I was a little too early in getting CreateDOMDocument and trying to
run it with xerces1.0.1 under VC++5.0.
Especially as I faced the problem, that
DOM_Element rootElem = doc.getDocumentElement();
returned a "0-pointer".
I applied the following changes (#else) and now it works.
DOM_DOMImplementation impl;
DOM_Document doc = impl.createDocument(
0, // root element namespace URI.
"company", // root element name
DOM_DocumentType()); // document type object (DTD).
#if 0
DOM_Element rootElem = doc.getDocumentElement();
#else
DOM_Element rootElem = doc.createElement("company");
doc.appendChild(rootElem);
#endif
----------
Now I'd like to know, how to parse a given DTD separately, so I can use it
for validation of the new created document.
Best regards,
Franz