URI recognition with Xerces-j

Discussion in 'XML' started by SL, Nov 6, 2004.

  1. SL

    SL Guest

    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
     
    SL, Nov 6, 2004
    #1
    1. Advertising

  2. SL

    SL Guest

    > 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'>
     
    SL, Nov 6, 2004
    #2
    1. Advertising

  3. 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/
     
    Martin Honnen, Nov 6, 2004
    #3
  4. SL

    SL Guest

    > > 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
     
    SL, Nov 6, 2004
    #4
  5. 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.setupCurrentEntity(Unknown
    > Source)


    file://c|/home/Corpus/dtd/myPizza.dtd
    ?
    --
    Johannes Koch
    In te domine speravi; non confundar in aeternum.
    (Te Deum, 4th cent.)
     
    Johannes Koch, Nov 9, 2004
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Simon Harris
    Replies:
    0
    Views:
    6,381
    Simon Harris
    May 10, 2005
  2. Stanimir Stamenkov
    Replies:
    1
    Views:
    2,476
    Stanimir Stamenkov
    Aug 17, 2005
  3. Pavel
    Replies:
    2
    Views:
    1,651
    Peter Flynn
    Aug 4, 2004
  4. etheriau
    Replies:
    1
    Views:
    668
    Pavel
    Aug 23, 2004
Loading...

Share This Page