Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » How to parse XInclude through EMF?
How to parse XInclude through EMF? [message #419352] Tue, 20 May 2008 09:43 Go to next message
Hans Meier is currently offline Hans MeierFriend
Messages: 2
Registered: July 2009
Junior Member
Hi everyone,

i hope someone can help me.
I want to parse an XML file through an EMF model i generated by my XSD
shema.
With the standard implementation i got this error message:

org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'include' not
found. (platform:/resource/test/xinclude_test.example, 60, 41)

while parsing this line:

<xi:include href="includeA.xml">
<xi:fallback>
<error>Unable to load xml include file</error>
</xi:fallback>
</xi:include>

can i set my own XML DOM parser in EMF anywhere to set this option:

DocumentBuilderFactory.newInstance().setXIncludeAware(true)

or is there an other way to get the file parsed correctly?

thanks for your answers
Re: How to parse XInclude through EMF? [message #419357 is a reply to message #419352] Tue, 20 May 2008 11:52 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060004040804010607050903
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Hans,

Comments below.

Hans Meier wrote:
> Hi everyone,
>
> i hope someone can help me.
> I want to parse an XML file through an EMF model i generated by my XSD
> shema.
> With the standard implementation i got this error message:
>
> org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'include'
> not found. (platform:/resource/test/xinclude_test.example, 60, 41)
>
> while parsing this line:
>
> <xi:include href="includeA.xml">
> <xi:fallback>
> <error>Unable to load xml include file</error>
> </xi:fallback>
> </xi:include>
>
> can i set my own XML DOM parser in EMF anywhere to set this option:
>
> DocumentBuilderFactory.newInstance().setXIncludeAware(true)
You could specialize this method of XMLLoadImpl:

protected SAXParser makeParser() throws
ParserConfigurationException, SAXException
{
SAXParserFactory f = SAXParserFactory.newInstance();
return f.newSAXParser();
}

Or using XMLResource.OPTION_USE_PARSER_POOL and specialize this method
of XMLParserPoolImpl:

protected SAXParser makeParser(Map<String, Boolean> features,
Map<String, ?> properties) throws ParserConfigurationException,
SAXException
{

>
> or is there an other way to get the file parsed correctly?
>
> thanks for your answers
>


--------------060004040804010607050903
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hans,<br>
<br>
Comments below.<br>
<br>
Hans Meier wrote:
<blockquote
cite="mid:6a11f85c29e09464324296c3242fcfcf$1@www.eclipse.org"
type="cite">Hi everyone,
<br>
<br>
i hope someone can help me.
<br>
I want to parse an XML file through an EMF model i generated by my XSD
shema.
<br>
With the standard implementation i got this error message:
<br>
<br>
org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature 'include'
not found. (platform:/resource/test/xinclude_test.example, 60, 41)
<br>
<br>
while parsing this line:
<br>
<br>
&lt;xi:include href="includeA.xml"&gt;
<br>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: How to parse XInclude through EMF? [message #419378 is a reply to message #419357] Wed, 21 May 2008 09:39 Go to previous message
Hans Meier is currently offline Hans MeierFriend
Messages: 2
Registered: July 2009
Junior Member
Thanks for your quick response.
Hope it will work now:)
Previous Topic:DeadLock on eclipse Startup
Next Topic:How to update an RCP app
Goto Forum:
  


Current Time: Fri Apr 26 11:07:23 GMT 2024

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

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

Back to the top