Hey,
What would be the best way to add a doctype declaration tag to a document
that doesn't have one?
I've tried this, but it doesn't work, gives some sort of unhandled error:
DOMNode *theRootNode;
theRootNode = //somehow find the node we should insert before, how
do i find this node?
DOMNode *theDocTypeNode;
theDocTypeNode = doc->createDocumentType(XMLString::transcode(
"collection" ), 0, XMLString::transcode( gDtdFile )) ;
doc->insertBefore(theDocTypeNode,theRootNode);
Also, is there an 'insertAfter' function?