logo       

Re: Validate without DOCTYPE: msg#00024

Subject: Re: Validate without DOCTYPE
There is a more elegant solution if you're using Xerces 2.7.x. SAX 2.0.2 
added an extension interface called EntityResolver2 [1] which allows 
applications to provide an external subset to documents which do not have 
one. This includes documents which have no DOCTYPE declaration. If an 
instance of EntityResolver2 is registered with the SAX parser 
getExternalSubset() will be called in such cases. The same applies to 
DocumentBuilders.

[1] 
http://xerces.apache.org/xerces2-j/javadocs/api/org/xml/sax/ext/EntityResolver2.html

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@xxxxxxxxxx
E-mail: mrglavas@xxxxxxxxxx

Joseph Kesselman <keshlam@xxxxxxxxxx> wrote on 01/18/2006 04:03:37 PM:

> The usual/simplest solution is to set up a filtering stream wrapper 
which
> prepends the appropriate doctype declaration if one isn't provided in 
the
> file, and parse from that. This may not be elegant, but it's simple and 
it
> works.
> 
> ______________________________________
> Joe Kesselman, IBM Next-Generation Web Technologies: XML, XSL and more.
> "The world changed profoundly and unpredictably the day Tim Berners Lee
> got bitten by a radioactive spider." -- Rafe Culpin, in r.m.filk
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@xxxxxxxxxxxxxxxxx
> For additional commands, e-mail: j-users-help@xxxxxxxxxxxxxxxxx
> 


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
boot-loaders.gr...    php.pear.genera...    debugging.valgr...    kde.redhat.user...    text.xml.xsl.ge...    culture.languag...    hardware.microc...    java.servicemix...    redhat.release....    web.zope.plone....    user-groups.lin...    opendarwin.webk...    video.mjpeg.use...    sysutils.bcfg2....    encryption.gpg....    lx-office.devel...    xfree86.forum/2...    mail.mutt.devel...    acpi.devel/2003...    qnx.openqnx.dev...    network.irc.irs...    freebsd.devel.m...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe