|
Re: parsing w/ doctype's unresolved server id [message #488524 is a reply to message #488519] |
Tue, 29 September 2009 06:33 |
Ed Merks Messages: 33141 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------070403020302010204000104
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
John,
Probably you could specialize the XMLHandler's
public InputSource resolveEntity(String publicId, String systemId)
throws SAXException
Maybe those options would work if you used OPTION_USE_DEPRECATED_METHODS
with false; read the Javadoc.
John J. Franey wrote:
> My model is translated to xsd from dtd using trang. I don't control the
> dtd; it comes from a jsr (240). I don't control the content of the xml
> files I'd like the model editor to operate on and some contain DOCTYPE
> directive as required by the jsr. I don't control the server the dtd is
> SUPPOSED to be loaded into; its not. The DOCTYPE's server id does not
> resolve.
>
> Because the DOCTYPE server id does not resolve, two things are failing:
>
> 1) content type identification
>
> 2) ResourceSet.getResource(uri to file, ...) in createModel.
>
> Do I have control over emf's parser to work around Doctype?
>
>
> I can't see any control of parser features for the content type
> identification parsing (as per debugging session).
>
>
>
> I see that I can set parser features in the call to getResource by
> setting the ResourceSet's load options (getLoadOptions).
>
> When I set parser feature for getResource to:
> " http://apache.org/xml/features/nonvalidating/load-external-d td", false
> and:
> "http://xml.org/sax/features/validation", false
>
> I get the exception 'PackageNotFoundException: Package with uri 'null'
> not found'.
>
> Any thoughts or hints?
>
> Thanks,
> John
>
>
>
>
--------------070403020302010204000104
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
John,<br>
<br>
Probably you could specialize the XMLHandler's<br>
<blockquote> public InputSource resolveEntity(String publicId, String
systemId) throws SAXException<br>
</blockquote>
Maybe those options would work if you used
OPTION_USE_DEPRECATED_METHODS with false; read the Javadoc.<br>
<br>
<br>
John J. Franey wrote:
<blockquote cite="mid:h9s5d2$vee$1@build.eclipse.org" type="cite">
<pre wrap="">My model is translated to xsd from dtd using trang. I don't control the
dtd; it comes from a jsr (240). I don't control the content of the xml
files I'd like the model editor to operate on and some contain DOCTYPE
directive as required by the jsr. I don't control the server the dtd is
SUPPOSED to be loaded into; its not. The DOCTYPE's server id does not
resolve.
Because the DOCTYPE server id does not resolve, two things are failing:
1) content type identification
2) ResourceSet.getResource(uri to file, ...) in createModel.
Do I have control over emf's parser to work around Doctype?
I can't see any control of parser features for the content type
identification parsing (as per debugging session).
I see that I can set parser features in the call to getResource by
setting the ResourceSet's load options (getLoadOptions).
When I set parser feature for getResource to:
<a class="moz-txt-link-rfc2396E" href=" http://apache.org/xml/features/nonvalidating/load-external-d td">" http://apache.org/xml/features/nonvalidating/load-external-d td"</a>, false
and:
<a class="moz-txt-link-rfc2396E" href="http://xml.org/sax/features/validation">"http://xml.org/sax/features/validation"</a>, false
I get the exception 'PackageNotFoundException: Package with uri 'null'
not found'.
Any thoughts or hints?
Thanks,
John
</pre>
</blockquote>
</body>
</html>
--------------070403020302010204000104--
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Powered by
FUDForum. Page generated in 0.03232 seconds