[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: How to open XML file that reference entity resolver(DTD)

  • From: Mike Sokolov <sokolov@ifactory.com>
  • To: liam@w3.org
  • Date: Tue, 29 Jun 2010 13:12:59 -0400

Re:  How to open XML file that reference entity resolver(DTD)
Another option if you don't care about DTD features like entities is to 
write a URI resolver that simply returns an empty document (Source?) for 
everything, or maybe everything ending '.dtd'.  Based on my research in 
various mailing lists, this seems to be the way to use standard XML 
tools while completely disabling DTD processing.  It'll only be useful 
in special circumstances, though.

-Mike

On 06/29/2010 09:36 AM, Liam R E Quin wrote:
> On Tue, 2010-06-29 at 01:00 -0700, Jack Bush wrote:
> [...]
>
>    
>> Looks like it is the default Sax parser possibly via JAXP that does
>> not come with the XHTML DTDs and with an XML catalog set up to use
>> them instead of going to www.w3.org each time.
>> I am still waying through the references to use XML Catalog but it
>> doesn't appears to provide every facets to a Java solution. It would
>> great if you could provide some example of how everything are
>> interconnected together.
>>      
> When the XML parser sees it needs to fetch an external entity such as
> the document type definition, it gets a SYSTEM identifier, and often (as
> in this case) a PUBLIC identifier too.
>
> There is a piece of code that maps the (PUBLIC, SYSTEM) pair into a data
> stream. This code is usually called the entity resolver.
>
> The default entity resolver will look up the SYSTEM and PUBLIC
> identifiers in an external file, an XML Catalog, to see if they map
> to a pre-configured local copy.
>
> If not, the default entity resolver will treat the SYSTEM identifier as
> a URI (relative to the actual document in which it occurred, just like a
> link in an HTML document) and try to fetch it.
>
> So you have several choices to avoid network access:
> (1) add entries to the system XML Catalog
> (2) add your own XML Catalog file
> (3) override the default entity resolver
> (4) edit the document.
>
>    
>> The 3rd option you have suggested by turning off validation with
>> SAXBuilder.setValidating(false) does not prevent the process of
>> resolving DTD document.
>>      
> OK. Others have said that too, although I've seen it work -- you do
> probably want the DTD loaded, though, with XHTML, so that entities work.
>
> There are plenty of examples of options 1 to 3 floating around, using
> Java.
>
> Liam
>
>    


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.