Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Problem with parsing XML [loading data into EMF data model](Problem with parsing XML [loading data into EMF data model])
Problem with parsing XML [loading data into EMF data model] [message #483337] Tue, 01 September 2009 08:42 Go to next message
jacekad  is currently offline jacekad Friend
Messages: 2
Registered: September 2009
Junior Member
I have already created EMF data model using XML schema, and now I am trying to lada data into 'data model' from XML file. The source XML contains the DTD part like below :<!DOCTYPE DSExport [ <!ELEMENT ............... >>. DTD contains one 'constrain' which make problem during reading XML there is part like this: "xml:space (default|preserve) 'preserve'" for one attribute of element 'AA'. The XML element 'AA' in the content of the file does not contain 'xml:space' attribute and it makes a problem for EMF which give me the error during loading xml file: " org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'space' not found."
The best solution for me will be to switch off valiadatind the DTD part from XML file, so my question is how to do that ?? If anybody have some suggestion please inform me. Thanks
Re: Problem with parsing XML [loading data into EMF data model] [message #483412 is a reply to message #483337] Tue, 01 September 2009 14:25 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Jacekad,

It sounds like EMF really would need to be able to find what to do with
the xml:space attribute it sees in the XML regardless of any validation
being done by SAX. Maybe you could try this load option:

/**
* This options allows you to record unknown features during
deserialization/loading.
* The default is <code>Boolean.FALSE</code> unless set to
<code>Boolean.TRUE</code> explicitly.
* The unknown features and their values can be accessed via
getEObjectToExtensionMap().
* @see #getEObjectToExtensionMap()
*/
String OPTION_RECORD_UNKNOWN_FEATURE = "RECORD_UNKNOWN_FEATURE";



jacekad wrote:
> I have already created EMF data model using XML schema, and now I am
> trying to lada data into 'data model' from XML file. The source XML
> contains the DTD part like below :<!DOCTYPE DSExport [ <!ELEMENT
> ............... >>. DTD contains one 'constrain' which make problem
> during reading XML there is part like this: "xml:space
> (default|preserve) 'preserve'" for one attribute of element 'AA'. The
> XML element 'AA' in the content of the file does not contain
> 'xml:space' attribute and it makes a problem for EMF which give me the
> error during loading xml file: "
> org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'space'
> not found." The best solution for me will be to switch off valiadatind
> the DTD part from XML file, so my question is how to do that ?? If
> anybody have some suggestion please inform me. Thanks


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Problem with parsing XML [loading data into EMF data model] [message #483416 is a reply to message #483412] Tue, 01 September 2009 14:48 Go to previous message
jacekad  is currently offline jacekad Friend
Messages: 2
Registered: September 2009
Junior Member
Thank you Ed Merks very much !!! Your advice resolve my problem !!
Previous Topic:[CDO] Delete a resource
Next Topic:Usage of INDETERMINATE validity in RootXMLContentHandlerImpl
Goto Forum:
  


Current Time: Sat Apr 27 03:14:33 GMT 2024

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

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

Back to the top