Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » How to set the docType of an IDOMDocument
How to set the docType of an IDOMDocument [message #486573] Fri, 18 September 2009 09:21 Go to next message
Fred Bricon is currently offline Fred BriconFriend
Messages: 14
Registered: July 2009
Junior Member
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,


Fred Bricon
Re: How to set the docType of an IDOMDocument [message #486667 is a reply to message #486573] Fri, 18 September 2009 14:47 Go to previous messageGo to next message
Nick Sandonato is currently offline Nick SandonatoFriend
Messages: 126
Registered: July 2009
Senior Member
Fred Bricon wrote:
> 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.
Re: How to set the docType of an IDOMDocument [message #486795 is a reply to message #486667] Sat, 19 September 2009 06:15 Go to previous message
Fred Bricon is currently offline Fred BriconFriend
Messages: 14
Registered: July 2009
Junior Member
It works fine, thanks Nick.

regards


Fred Bricon
Previous Topic:XSLT extensions
Next Topic:Re: HELP installing org.eclipse.wst.common.emf
Goto Forum:
  


Current Time: Tue Mar 19 10:40:19 GMT 2024

Powered by FUDForum. Page generated in 0.01841 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top