How to add DTD (doctype) information in a XML document

EmerikEmerik Member Posts: 50
Hi all,

I have made a XML document with the following code:
CREATE(XMLdocOut);

XMLdocOut.loadXML('<?xml version="1.0" encoding="UTF-8" ?><Root_Node/>');
XMLCurrNode := XMLdocOut.documentElement;
XMLNodeTEMP := XMLCurrNode.ownerDocument.createNode('element', 'Name_1st_Node', '');
XMLNodeTEMP.text := 'Value_1st_node';
XMLCurrNode.appendChild(XMLNodeTEMP);
XMLCurrNode := XMLNodeTEMP; 

etc...

This results in a XML file like the following:
<?xml version="1.0" encoding="UTF-8"?>
<Root_Node><Name_1st_Node>Value_1st_node</Name_1st_Node></Root_Node>

But how can you insert DTD information tags like <!DOCTYPE xxxx> between the <?xml> tag and the root node?

Example:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xxxx>
<Root_Node><Name_1st_Node>Value_1st_node</Name_1st_Node></Root_Node>

I've been searching the forum for answers, but had no luck :-(

Can anyone out there help me, please? Thank you.

Best regards,
Emerik
Sign In or Register to comment.