S
Sjoerd Mullender
I am trying to create a DTD where some attributes are to have a default
value of "100%". The DTD is modularized similarly to the XHTML DTD
modularization, so that means I have parsed entities that reference
other parsed entities in external subsets.
The problem I'm facing is that the validating parser that I wrote myself
accepts my DTD, but libxml2, Xerces and PyXML don't, and I don't know
how I can fix the DTD so that all parsers are happy, or indeed whether
there is a bug in either my own parser or in the others.
Does anybody have any ideas?
Here is a small example:
File x.xml:
<?xml version="1.0"?>
<!DOCTYPE test PUBLIC "xyzzy" "x.dtd">
<test/>
File x.dtd:
<!ENTITY % test.x.module PUBLIC "plugh" "x.mod">
%test.x.module;
File x.mod:
<!ENTITY % test.test.qname "test">
<!ENTITY % level1 "
attr CDATA '100%'
">
<!ENTITY % level2 "
%level1;
">
<!ENTITY % test.test.content "EMPTY">
<!ELEMENT %test.test.qname; %test.test.content;>
<!ATTLIST %test.test.qname; %level2;>
I can change the value to '%', but then I still get into
trouble. My DTD has more levels of indirection than this example: there
is effectively also an entity
<!ENTITY % level3 "
%level2;
">
and the ATTLIST refers to this level3 entity. The parsers complain
again about the DTD. If I then change the value to &#37; two of
the three accept the document, but the third parser (PyXML) still complains.
Note that & is "&" and % is "%".
--
Sjoerd Mullender
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iQCVAwUBR7IDUz7g04AjvIQpAQIEFQP/Wj+W2dk9PTEqCuo8eZpM+wRcThNpssz7
mb8h9rRvmUQxB4rJx9SlcAKUXdBXjrDeC+FOb+zk6kB1OzShNeqpd4lVtNsOHR+G
0yTR7iEvx+sRBMr9MAUawGTEfT02yxuxoK0iPP1Tyn/V/y0QOethvcy+F+4lMZ45
t8PwTF4bfIg=
=m8Fe
-----END PGP SIGNATURE-----
value of "100%". The DTD is modularized similarly to the XHTML DTD
modularization, so that means I have parsed entities that reference
other parsed entities in external subsets.
The problem I'm facing is that the validating parser that I wrote myself
accepts my DTD, but libxml2, Xerces and PyXML don't, and I don't know
how I can fix the DTD so that all parsers are happy, or indeed whether
there is a bug in either my own parser or in the others.
Does anybody have any ideas?
Here is a small example:
File x.xml:
<?xml version="1.0"?>
<!DOCTYPE test PUBLIC "xyzzy" "x.dtd">
<test/>
File x.dtd:
<!ENTITY % test.x.module PUBLIC "plugh" "x.mod">
%test.x.module;
File x.mod:
<!ENTITY % test.test.qname "test">
<!ENTITY % level1 "
attr CDATA '100%'
">
<!ENTITY % level2 "
%level1;
">
<!ENTITY % test.test.content "EMPTY">
<!ELEMENT %test.test.qname; %test.test.content;>
<!ATTLIST %test.test.qname; %level2;>
I can change the value to '%', but then I still get into
trouble. My DTD has more levels of indirection than this example: there
is effectively also an entity
<!ENTITY % level3 "
%level2;
">
and the ATTLIST refers to this level3 entity. The parsers complain
again about the DTD. If I then change the value to &#37; two of
the three accept the document, but the third parser (PyXML) still complains.
Note that & is "&" and % is "%".
--
Sjoerd Mullender
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iQCVAwUBR7IDUz7g04AjvIQpAQIEFQP/Wj+W2dk9PTEqCuo8eZpM+wRcThNpssz7
mb8h9rRvmUQxB4rJx9SlcAKUXdBXjrDeC+FOb+zk6kB1OzShNeqpd4lVtNsOHR+G
0yTR7iEvx+sRBMr9MAUawGTEfT02yxuxoK0iPP1Tyn/V/y0QOethvcy+F+4lMZ45
t8PwTF4bfIg=
=m8Fe
-----END PGP SIGNATURE-----