Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Ignoring elements from XML
Ignoring elements from XML [message #1262890] Tue, 04 March 2014 03:16 Go to next message
Pascal Rapicault is currently offline Pascal RapicaultFriend
Messages: 333
Registered: July 2009
Location: Ottawa
Senior Member
Hi,

I have an XML document with a really awkward shape. I've generated an EMF model from the XSD of that document, and the resulting model is equivalently awkward, no real surprise.
Since I would like to have a sane EMF model and given I'm stuck with the XML format, is there any feature in EMF that could help me read in this XML document? (I don't need to do the serialization)

The things that I'm mostly interested in doing is ignore elements from the original XML file since these elements are just adding noise to the model. Is this at all possible? I've looked into annotating the original XSD but no luck so far.

Thanks

Pascal
Re: Ignoring elements from XML [message #1263187 is a reply to message #1262890] Tue, 04 March 2014 08:56 Go to previous messageGo to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 295
Registered: March 2012
Senior Member
On 04/03/2014 04:16, Pascal Rapicault wrote:
> The things that I'm mostly interested in doing is ignore elements from
> the original XML file since these elements are just adding noise to the
> model. Is this at all possible? I've looked into annotating the original
> XSD but no luck so far.

Maybe you can look at the .ecore model, remove the stuff that represents
'noise' and then use "XMLResource.OPTION_RECORD_UNKNOWN_FEATURE" when
loading? Afaiu the noise will still be recorded and be written back when
you save.
Re: Ignoring elements from XML [message #1264223 is a reply to message #1263187] Wed, 05 March 2014 04:07 Go to previous message
Pascal Rapicault is currently offline Pascal RapicaultFriend
Messages: 333
Registered: July 2009
Location: Ottawa
Senior Member
Thanks I look into this.
Previous Topic:[Xcore] How to model assignments in operations
Next Topic:[XCORE] How to define equality?
Goto Forum:
  


Current Time: Fri Mar 29 08:20:34 GMT 2024

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

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

Back to the top