Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsHow to set the docType of an IDOMDocument
https://www.eclipse.org/forums/index.php/mv/msg/154459/486573/#msg_486573
I'm trying to create / update an XML file using the SSE API.
After loading an IDOMModel (using StructuredModelManager.getModelManager().getNewModelForEdit or getModelForEdit ) I need to add a doctype, or update it if needed.
IDOMDocument has a createDocType method but I haven't found a way to attach this new docType to the IDOMDocument.
Also, if IDOMDocument.getDocType is not null, how can I update its value?
thanks,
regards,]]>Fred Bricon2009-09-18T09:21:58-00:00Re: How to set the docType of an IDOMDocument
https://www.eclipse.org/forums/index.php/mv/msg/154459/486667/#msg_486667
> Hi,
>
> I'm trying to create / update an XML file using the SSE API.
> After loading an IDOMModel (using
> StructuredModelManager.getModelManager().getNewModelForEdit or
> getModelForEdit ) I need to add a doctype, or update it if needed.
>
> IDOMDocument has a createDocType method but I haven't found a way to
> attach this new docType to the IDOMDocument.
>
> Also, if IDOMDocument.getDocType is not null, how can I update its value?
>
> thanks,
>
> regards,
Hi Fred,
You should be able to insert the doctype node into the DOM just like any
other node (e.g., using your IDOMDocument reference,
document.appendChild(docType) or document.insertBefore(docType,
referenceNode)).
If you're editing an existing doctype, you can change the public and
system ID's via docType.setPublicId(id) and docType.setSystemId(id),
respectively. In order to change the root element name, you will have to
create a new doctype, remove the old doctype, and add the new doctype to
the document.]]>Nick Sandonato2009-09-18T14:47:30-00:00Re: How to set the docType of an IDOMDocument
https://www.eclipse.org/forums/index.php/mv/msg/154459/486795/#msg_486795
regards]]>Fred Bricon2009-09-19T06:15:06-00:00