I tried creating DOM_XMLDecl  and insert before. 

It does not work the way you describe.  
here is the code :

        DOM_XMLDecl domDecl;                                    // It
creates a null Dec 
    DOM_Node child = m_Doc.getFirstChild();
        
m_RootElement.insertBefore(&domDecl,child);

I can not find any documentation on DOM_XMLDecl,  but the hpp file. 

Any help will be grateful

> ----------
> From:         Jesse Pelton
> Reply To:     [EMAIL PROTECTED]
> Sent:         Friday, July 13, 2001 6:01 PM
> To:   '[EMAIL PROTECTED]'
> Subject:      RE: DOMPrint: Declaration and Document Type
> 
> To set the docType, you have to do something like:
> 
>   DOM_Document doc;
>   DOM_DOMImplementation impl;
> 
>   DOM_DocumentType docType = impl.createDocumentType(...);
> 
>   doc = impl.createDocument(NULL,             // root element namespace
> URI
>                             "MyRoot"  // root element name
>                             docType); // document type object (DTD)
> 
> As for the XML declaration, try getting the document element with
> getDocumentElement() and using insertBefore() to prepend your XMLDecl.
> 
> This approach worked for me, but I haven't upgraded since 1.2, so
> something
> may have changed. My serializer is also descended a few generations from
> DOMPrint, so it may be that I did something to it as well.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

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

Reply via email to