Hi,

I'm new to xml and xerces. I am trying to generate an xml file from a
database and have been able to generate well-formed xml using xerces, but
the file does not have a DOCTYPE declaration nor the <?xml?> processing
instruction.

I've managed to get a DOCTYPE declaration generated, but it's ugly:

  DOM_DOMImplementation impl;

  DOM_Document xmlDoc_dummy =  impl.createDocument(
    0,                    // root element namespace URI.
    "dummy",   // root element name
    DOM_DocumentType());  // document type object (DTD).


  DOM_DocumentType dtd;
  dtd = xmlDoc_dummy.createDocumentType("mynode SYSTEM \"my.dtd\"");

  DOM_Document xmlDoc =  impl.createDocument(
    0,                    // root element namespace URI.
    "mynode",   // root element name
    dtd);  // document type object (DTD).


But when I use either
createXMLDecl("1.0", "UTF-16", "no");
or
createProcessingInstruction("xml", "version='1.0' encoding='UTF-16'
standalone='no'")

neither appear in the tree, unless I either appendChild() (it is output at
the end of the document) or insertBefore(, xmlDoc.getDocumentElement() (the
processing instruction is now before the data, but after the dtd!

Any help would be greatly appreciated.

BTW: it was nearly impossible doing this using MSXML too. But I did find a
way.
--
Jeff Paquette
paquette at mediaone.net
http://www.atnetsend.net



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to