DTD and catalog problem

Discussion in 'XML' started by Thomas Sommer, Aug 30, 2004.

  1. Hi group,

    I am really desperate but
    I think I am missing only a minor part. Basically I want to pipe
    a global entity (the one you dereference with the &) through my
    dtd into the xml-file I am writing. Basically something like
    the € in docbook. If I put the parameter entity into the
    [] Brackets in the xml file(test2.xml) it works. But if
    I wan't to use it via a catalog in the dtd(test.xml) it does not work.

    I would be really thankful for any help.

    Here the files:

    test.xml:
    <?xml version='1.0' encoding="ISO-Latin-1"?>
    <!DOCTYPE test SYSTEM "Mydtd">
    <test>
    &entity;
    </test>

    test2.xml:
    <?xml version='1.0' encoding="ISO-Latin-1"?>
    <!DOCTYPE test SYSTEM "Mydtd"
    [
    <!ENTITY % W SYSTEM "Website_Links">
    %W;
    ]
    >

    <test>
    &entity;
    </test>

    Mydtd.dtd:
    <?xml version='1.0' encoding="ISO-Latin-1"?>
    <!ELEMENT test (#PCDATA)>
    <!ENTITY % W SYSTEM "Website_Links">
    %W;

    Catalog:
    <?xml version='1.0' encoding="ISO-Latin-1"?>
    <catalog xmlns="urn:eek:asis:names:tc:entity:xmlns:xml:catalog">
    <group prefer="system" xml:base="file:///home/goofy/docbook/" >
    <system systemId="Mydtd" uri="dtd/Mydtd.dtd"/>
    <system systemId="W" uri="Entities/W.xml/>
    </group>
    </catalog>

    W.xml:
    contains tons of entities like:
    <!ENTITY entity SYSTEM "TESTSTRING">
    Thomas Sommer, Aug 30, 2004
    #1
    1. Advertising

  2. "Thomas Sommer" <> wrote in message
    news:p...
    > If I put the parameter entity into the
    > [] Brackets in the xml file(test2.xml) it works. But if
    > I wan't to use it via a catalog in the dtd(test.xml) it does not work.


    What parsers or applications have you tried this with?

    What error message(s) do you get?

    /kmc
    Keith M. Corbett, Aug 30, 2004
    #2
    1. Advertising

  3. Sorry, it was pretty late yesterday
    besides I messed up the catalog a bit.
    <system systemId="W" uri="Entities/W.xml/>
    Should be:
    <system systemId="Website_Links" uri="Entities/W.xml/>

    I do the following (xsltproc):

    export SGML_CATALOG_FILES="file:///home/goofy/docbook/catalog.xml"
    xmllint --debug --catalogs --valid test.xml

    The output:

    file:///home/goofy/docbook/dtd/Mydtd.dtd:4: I/O error :
    failed to load external entity
    "file:///home/goofy/docbook/dtd/Website_Links"
    %W;

    The thing is:
    I totally understand what happens. Resolving "Mydtd" to
    /home/goofy/docbook/dtd/Mydtd.dtd works perfect. But afterwards it
    does not get
    out of the dtd directory anymore. It should resolve Website_Links to
    /home/goofy/docbook/Entities/W.xml but does:
    /home/goofy/docbook/dtd/Website_Links which does not exist.

    If I put the real path in the dtd-file:
    <!ENTITY % W SYSTEM "/home/goofy/docbook/Entities/W.xml">
    everything works fine but I should be able to use a system identifier
    for that. Right? Or does it need to be a public one. If so this could
    explain things.


    Thanks Thomas
    Thomas Sommer, Aug 30, 2004
    #3
  4. "Thomas Sommer" <> wrote in message
    news:...
    > The thing is:
    > I totally understand what happens. Resolving "Mydtd" to
    > /home/goofy/docbook/dtd/Mydtd.dtd works perfect. But afterwards it
    > does not get
    > out of the dtd directory anymore. It should resolve Website_Links to
    > /home/goofy/docbook/Entities/W.xml but does:
    > /home/goofy/docbook/dtd/Website_Links which does not exist.


    Have you tried turning on xmllint catalog debugging?

    export XML_DEBUG_CATALOG=

    Sorry I haven't had a chance to try this.

    /kmc
    Keith M. Corbett, Sep 1, 2004
    #4

  5. > Have you tried turning on xmllint catalog debugging?
    >
    > export XML_DEBUG_CATALOG=
    >
    > Sorry I haven't had a chance to try this.


    No but I solved the problem. I finally understood that the SYSTEM
    entry is a relativ thing (unless you give it the absolut path).
    So going into the directory where my dtd lies will add this path
    in front of the SYSTEM-identifier -> this of course is not found in
    the catalog. Using PUBLIC is solving the problem.

    Thanks anyway
    Thomas Sommer, Sep 2, 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. Josef Zelinka

    Problems ASP.NET and Index Catalog

    Josef Zelinka, Sep 1, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    952
    Josef Zelinka
    Sep 1, 2005
  2. Joseph Tilian
    Replies:
    0
    Views:
    340
    Joseph Tilian
    Dec 21, 2004
  3. Ronald Fischer
    Replies:
    4
    Views:
    1,743
    Ronald Fischer
    Mar 17, 2005
  4. test
    Replies:
    2
    Views:
    1,996
    Oliver Wong
    Jul 28, 2006
  5. Jan Paulsen
    Replies:
    5
    Views:
    1,762
    Jan Paulsen
    Jul 29, 2009
Loading...

Share This Page