How to parse XInclude through EMF? [message #419352] |
Tue, 20 May 2008 05:43  |
Eclipse User |
|
|
|
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 07:52   |
Eclipse User |
|
|
|
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>
<xi:include href="includeA.xml">
<br>
|
|
|
|
Powered by
FUDForum. Page generated in 0.04405 seconds