URI recognition with Xerces-j

S

SL

Hi,

Im' using Xerces-j (version 2.0.1 and 2.6.2). When parsing this prolog :

<!DOCTYPE teiCorpus
PUBLIC "-//TEI Consortium//DTD TEI P4//EN"
"d:/Program Files/tei-emacs/sgml/dtds/tei/tei2.dtd" [

Xerces return this error stack :

java.net.MalformedURLException
at java.net.URL.<init>(URL.java:613)
at java.net.URL.<init>(URL.java:476)
at java.net.URL.<init>(URL.java:425)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown
Source)

[etc.]

The same thing appens with external entity uri declaration :

<!ENTITY DE_CC 'C:\home\Corpus\Courant\CC.xml'>

throws a MalformedURLException.

I have absolutly no idea of the reason why Xerces do that. Any hint welcome
!

Yours,
Sylvain
 
S

SL

The same thing appens with external entity uri declaration :
<!ENTITY DE_CC 'C:\home\Corpus\Courant\CC.xml'>

As well as with :

<!ENTITY DE_CC SYSTEM
'C:/home/Corpus/Courant/CC.xml'>
 
M

Martin Honnen

SL said:
Im' using Xerces-j (version 2.0.1 and 2.6.2). When parsing this prolog :

<!DOCTYPE teiCorpus
PUBLIC "-//TEI Consortium//DTD TEI P4//EN"
"d:/Program Files/tei-emacs/sgml/dtds/tei/tei2.dtd" [

Xerces return this error stack :

java.net.MalformedURLException

What you have is not a URL, you need
"file:///d:/Program Files/tei-emacs/sgml/dtds/tei/tei2.dtd"
to have a URL pointing to a resource in the local file system.
I think it is not even Xerces complaining but the built-in java.net.URL
class.
 
S

SL

Im' using Xerces-j (version 2.0.1 and 2.6.2). When parsing this prolog :
<!DOCTYPE teiCorpus
PUBLIC "-//TEI Consortium//DTD TEI P4//EN"
"d:/Program Files/tei-emacs/sgml/dtds/tei/tei2.dtd" [

Xerces return this error stack :

java.net.MalformedURLException

What you have is not a URL, you need
"file:///d:/Program Files/tei-emacs/sgml/dtds/tei/tei2.dtd"
to have a URL pointing to a resource in the local file system.
I think it is not even Xerces complaining but the built-in java.net.URL
class.

Thanks ! "file:" works. But this document :

<!DOCTYPE teiCorpus.2
SYSTEM "file:///c:/home/Corpus/dtd/myPizza.dtd" []>
<teiCorpus.2>
</teiCorpus.2>

Is still making java.net.URL complaining :

java.net.MalformedURLException
at java.net.URL.<init>(URL.java:613)
at java.net.URL.<init>(URL.java:476)
at java.net.URL.<init>(URL.java:425)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown
Source)

(with C: instead of c: and with antislash as well)

but works perfectly with xmllint. I can't found where the exception is
thrown in java.net.URL : the try block surrounds a large piece of code.

SL
 
J

Johannes Koch

SL said:
<!DOCTYPE teiCorpus.2
SYSTEM "file:///c:/home/Corpus/dtd/myPizza.dtd" []>
<teiCorpus.2>
</teiCorpus.2>

Is still making java.net.URL complaining :

java.net.MalformedURLException
at java.net.URL.<init>(URL.java:613)
at java.net.URL.<init>(URL.java:476)
at java.net.URL.<init>(URL.java:425)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown
Source)

file://c|/home/Corpus/dtd/myPizza.dtd
?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,052
Latest member
KetoBeez

Latest Threads

Top