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 Gennady Khokhorin <go...@aerometric-ak.com> on 2007/12/05 23:52:56 UTC

newbie question: how to create empty xml from DTD

Hello, all.
I started shaking Xerces and can not figure out how to create an empty
xml from DTD file?
Also in addition to .dtd I want to include <?xml-stylesheet node. How I
can do it?
Thank you for advice.
Gennady

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


RE: newbie question: how to create empty xml from DTD

Posted by Jesse Pelton <js...@PKC.com>.
If you want to create a sort of template document that includes, say,
any required elements in the DTD, Xerces provides no convenient method.

If you just want to create an instance document that refers to your DTD
and has an xml-stylesheet processing instruction, you'll need to call
DOMImplementation::getImplementation() to get an implementation pointer,
then use DOMImplementation::createDocumentType() to create a document
type that you then pass to DOMImplementation::createDocument().  You
should be able to create the processing instruction node using
DOMDocument::createProcessingInstruction() and append it with
DOMNode::appendChild().  You'll probably want to use
DOMDocument::getDocumentElement() to get the document's root element.

-----Original Message-----
From: Gennady Khokhorin [mailto:gok@aerometric-ak.com] 
Sent: Wednesday, December 05, 2007 5:53 PM
To: c-dev@xerces.apache.org
Subject: newbie question: how to create empty xml from DTD

Hello, all.
I started shaking Xerces and can not figure out how to create an empty
xml from DTD file?
Also in addition to .dtd I want to include <?xml-stylesheet node. How I
can do it?
Thank you for advice.
Gennady

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org