Michael Glavassevich <mrgla...@ca.ibm.com> wrote on 11/17/2009 12:06:01 PM:
> Hi Benson, > > Benson Margulies <bimargul...@gmail.com> wrote on 11/17/2009 11:25:36 AM: > > > This question is motivated by a behavior of the copy of Xerces > > captured and renamed in the Sun 1.5 JDK, so feel free to send me away. > > I am often ruthless with that but since you asked nicely... :-) > > > I am trying to use the LSParser interface, since it seems rather > > more straightforward for parsing XML in a string than JAXP. > > > > It rejects the following due to urn: being an unknown protocol. I > > thought someone here posted a suggestion to use them to avoid > > relative pathname surprises, so now I'm not sure what to try next. > > Except to rethink the use of DTDs as soon as possible. > > All URIs are dereferenced in the same way by default. Doesn't matter > if it's an URN or some other URI which Java doesn't understand natively. > > You should install an EntityResolver which knows how to find the DTD > based on the publicId / systemId or perhaps return an empty document > (i.e. a zero byte InputStream) if you want it to be ignored. ... or rather an LSResourceResolver [1] since you're using an LSParser. > > <!DOCTYPE regexpset PUBLIC "-//basistech.com//DTD RLP Regular > > Expression Config 1.0//EN" "urn:regexpset.dtd"> > > Thanks. > > Michael Glavassevich > XML Parser Development > IBM Toronto Lab > E-mail: mrgla...@ca.ibm.com > E-mail: mrgla...@apache.org [1] http://xerces.apache.org/xerces2-j/javadocs/api/org/w3c/dom/ls/LSResourceResolver.html Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: mrgla...@ca.ibm.com E-mail: mrgla...@apache.org