Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > URI recognition with Xerces-j

Reply
Thread Tools

URI recognition with Xerces-j

 
 
SL
Guest
Posts: n/a
 
      11-06-2004
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.setupCurre ntEntity(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

 
Reply With Quote
 
 
 
 
SL
Guest
Posts: n/a
 
      11-06-2004
> 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'>

 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      11-06-2004


SL wrote:

> 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.

--

Martin Honnen
http://JavaScript.FAQTs.com/
 
Reply With Quote
 
SL
Guest
Posts: n/a
 
      11-06-2004
> > 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.setupCurre ntEntity(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

 
Reply With Quote
 
Johannes Koch
Guest
Posts: n/a
 
      11-09-2004
SL wrote:
> <!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.setupCurre ntEntity(Unknown
> Source)


file://c|/home/Corpus/dtd/myPizza.dtd
?
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
java.net.URI.relativize(java.net.URI) not really working Stanimir Stamenkov Java 1 08-17-2005 06:24 PM
Help with error: "Invalid URI: The format of the URI could not be determined." Simon Harris ASP .Net 0 05-10-2005 04:33 PM
Re: XSLT: Relative URI "my.dtd" can not be resolved without a base URI etheriau XML 1 08-23-2004 01:54 PM
XSLT: Relative URI "my.dtd" can not be resolved without a base URI Pavel XML 2 08-03-2004 11:40 PM
Invalid URI: The format of the URI could not be determined. Joe Curry ASP .Net Web Services 0 10-08-2003 04:11 PM



Advertisments