|
Re: XML Manipulation API within WST [message #230120 is a reply to message #230111] |
Tue, 07 April 2009 14:54 |
Eclipse User |
|
|
|
Originally posted by: dcarver.starstandard.org
For most functions, you can use the the standard DOM interferaces to
manipulate the code. Take at the org.eclise.wst.xml.core.tests plugin
and source for examples on how to use the IStructuredModel to get a
model of the document, and then retrieve the DOM document or
(IDOMDocument etc).
From there you can use either the standard DOM interfaces or the
extended IDOMDocument, IDOMNode, IDOMElement, etc interfaces to
manipulate the tree.
You can also use XPath to query and retrieve nodelists which may be
quicker in many cases than walking the tree yourself.
Dave
Cristian wrote:
> Hello,
>
> I would like to manipulate XML files the same way Java source files can
> be manipulated via JDT (using the Abstract Syntax Tree - AST). I
> understood that there is an XML API in WST that cand be used for this
> purpose.
>
> Do you know where I could find some documentation on how to use the XML
> manipulation API that is included in WST (IStructuredModel,
> IDOMDocument, IDOMElement).
>
> Many thanks in advance.
> Cristi.
>
>
>
|
|
|
|
|
Re: XML Manipulation API within WST [message #230140 is a reply to message #230134] |
Tue, 07 April 2009 18:59 |
Eclipse User |
|
|
|
Originally posted by: dcarver.starstandard.org
Cristian wrote:
> I am referring to the
> org.eclipse.wst.xml.core.internal.provisional.document package as well.
>
Provisional means it's being considered for API usage. You can use it
as it's been pretty stable for the last 4 years (that's about how long
it's been in provisional status).
Hopefully we can address some of this in the coming releases to remove
the internal.provisional package markers.
So even though it says discouraged access, you can use it, just realize
at some point the package name will probably change when we take it out
of provisional status.
The other way is to not use the IDOMDocument, IDOMElement, etc, unless
you need to and work off the org.w3c.dom interfaces, which the above extend.
|
|
|
Powered by
FUDForum. Page generated in 0.03442 seconds