Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > DTD and catalog problem

Reply
Thread Tools

DTD and catalog problem

 
 
Thomas Sommer
Guest
Posts: n/a
 
      08-29-2004
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="urnasis:names:tc:entitymlnsml: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">
 
Reply With Quote
 
 
 
 
Keith M. Corbett
Guest
Posts: n/a
 
      08-30-2004
"Thomas Sommer" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
> 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


 
Reply With Quote
 
 
 
 
Thomas Sommer
Guest
Posts: n/a
 
      08-30-2004
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
 
Reply With Quote
 
Keith M. Corbett
Guest
Posts: n/a
 
      08-31-2004
"Thomas Sommer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> 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


 
Reply With Quote
 
Thomas Sommer
Guest
Posts: n/a
 
      09-01-2004

> 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
 
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
Problem reloading plug-in catalog in NetBeans 6.7 Jan Paulsen Java 5 07-29-2009 03:04 PM
XML file from one DTD to another DTD test Java 2 07-28-2006 08:48 PM
How to specify DTD to DTD.getDTD for DocumentParser? Ronald Fischer Java 4 03-17-2005 09:37 AM
Removing the dtd name when using print(...) on the dtd generated class Joseph Tilian Java 0 12-21-2004 02:58 PM
Including a dtd into another dtd... possible? Asfand Yar Qazi XML 1 09-19-2003 12:10 PM



Advertisments