I am trying to insert the DocType node into an XML document. I tried created
the Document with DOMImplementation and passing the DocType in as a
parameter. However, when I display the document, I get the following:
<?xml version="1.0" encoding="UTF-8"?>
<webservices/>
When what I'm looking for is:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE WebServices SYSTEM "webservices.dtd">
//Creation of doctype
DocumentType docType =
domImplementation.createDocumentType("ContentSyndicationWebService","content
syndicationwebservice","contentsyndicationwebservice.dtd");
//Creation of document
document =
domImplementation.createDocument(nameSpaceURI,"webservices",docType);
Am I taking the right approach? Can anyone point me in the right direction?
Your help is appreciated,
Miguel