Validation
...
To validate against a DTD or XML Schema, the document needs to be attached to the relevant definition or schema.
DTDs are stored locally. A number of DTDs are installed by default (e.g. the public identifier ‘-//W3C/DTD XHTML 1.0 Strict//EN’ is keyed to a local copy of the XHTML 1.0 Strict DTD), but you can also add new DTDs by editing the file ‘catalog’ in the ‘catalog’ directory and saving copies of the DTDs themselves in the ‘dtd’ directory.
...
It doesn't look like I've got anything like 'catalog' and 'dtd' directories:
$ ls /usr/share/xmlcopyeditor/
copying help png po rng rulesets templates xpm
What am I suposed to do? I don't know much about dtd/xml handling, so a detailed explanation is welcome :) .
On Linux the system catalog is used. Different distros may use different locations, but the etc folder is usually a good place to start.
You could also fetch the distro's docbook distribution (for example) and check where the catalog and DTDs are stored.
If your DTD is installed in the system catalog, xmlce will see it.
Please note that this applies only to Linux. On Windows, the program creates a separate catalog and DTD collection as there is no standard location to fall back to.
If this doesn't help, please give me a shout.
-gerald
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry I'm a newbie to XML, but, what is the "system catalog" for Linux releases ?
I have both an /etc/xml/catalog and an /etc/sgml/catalog file (and also a dozen of /usr/share/sgml/docbook/sgml-dtd-*/catalog, where * stands for a dozen of different release numbers, not to mention a bunch of other "catalog" files in various directiories such as /usr/share/apps/ksgml/…).
I guess the first one (the one in /etc/xml) is the right one, but it seems rather obsfuscating :
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd"><catalogxmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"><delegatePublicpublicIdStartString="-//OASIS//ENTITIES DocBook XML"catalog="file:///usr/share/sgml/docbook/xmlcatalog"/><delegatePublicpublicIdStartString="-//OASIS//DTD DocBook XML"catalog="file:///usr/share/sgml/docbook/xmlcatalog"/><delegatePublicpublicIdStartString="ISO 8879:1986"catalog="file:///usr/share/sgml/docbook/xmlcatalog"/><delegateSystemsystemIdStartString="http://www.oasis-open.org/docbook/"catalog="file:///usr/share/sgml/docbook/xmlcatalog"/><delegateURIuriStartString="http://www.oasis-open.org/docbook/"catalog="file:///usr/share/sgml/docbook/xmlcatalog"/><rewriteSystemsystemIdStartString="http://scrollkeeper.sourceforge.net/dtds/scrollkeeper-omf-1.0/scrollkeeper-omf.dtd"rewritePrefix="/usr/share/xml/scrollkeeper/dtds/scrollkeeper-omf.dtd"/><rewriteURIuriStartString="http://scrollkeeper.sourceforge.net/dtds/scrollkeeper-omf-1.0/scrollkeeper-omf.dtd"rewritePrefix="/usr/share/xml/scrollkeeper/dtds/scrollkeeper-omf.dtd"/><rewriteSystemsystemIdStartString="http://docbook.sourceforge.net/release/xsl/1.73.2"rewritePrefix="file:///usr/share/sgml/docbook/xsl-stylesheets-1.73.2"/><rewriteURIuriStartString="http://docbook.sourceforge.net/release/xsl/1.73.2"rewritePrefix="file:///usr/share/sgml/docbook/xsl-stylesheets-1.73.2"/><rewriteSystemsystemIdStartString="http://docbook.sourceforge.net/release/xsl/current"rewritePrefix="file:///usr/share/sgml/docbook/xsl-stylesheets-1.73.2"/><rewriteURIuriStartString="http://docbook.sourceforge.net/release/xsl/current"rewritePrefix="file:///usr/share/sgml/docbook/xsl-stylesheets-1.73.2"/></catalog>
How could I add a DTD file, to have it appear in the "XML/Validate" list ?
Could you help ? Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the initial tip - it got me pointed in the right direction. I think I'm getting closer to solving this conundrum. I must say that it is FAR more elegant than the solution in Windows, although somewhat more difficult to have working and dev DTD sets in place at the same time.
I work at VMware doing DITA-based documentation XML customizations/specializations to our DTDs and modifying them easily on Linux using your tool instead of something like Oxygen would be ideal for me.
There doesn't appear to be a default DITA XML Ubuntu package I can install as there is with "docbook-xml". So, here's what I have done so far:
I modified the "/etc/xml/catalog" to add lines for each publicID we use such as:
I then created "/etc/xml/dita-xml.xml" with an entry for each publicID and a reference to our main DITA catalog:
<?xml version="1.0"?><!DOCTYPE catalog PUBLIC "-//OASIS//DTD XML Catalogs V1.0//EN" "file:///usr/share/xml/schema/xml-core/catalog.dtd"><catalogxmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"><delegatePublicpublicIdStartString="-//OASIS//DTD DITA Map//EN"catalog="file:///usr/share/xml/dita/catalog-dita.xml"/><delegatePublicpublicIdStartString="-//OASIS//DTD DITA 1.1 Map//EN"catalog="file:///usr/share/xml/dita/catalog-dita.xml"/><delegatePublicpublicIdStartString="-//OASIS//ELEMENTS DITA Map//EN"catalog="file:///usr/share/xml/dita/catalog-dita.xml"/></catalog>
I then copied our catalog along with the DTDs to the /usr/share/xml/dita/catalog-dita.xml directory. I had to add the DOCTYPE declaration to the catalog-dita.xml file we use to make sure it validated correctly.
Now, when I create a DITA Map file and try to validate it, I get the error message
Unexpected validation error
From what I can tell, I've set it up as close as possible to match the integration of docbook-xml. At least it now seems to be trying to jump through the various catalogs to find the DTDs instead of looking at our placeholder URN and stopping. I just can't get it to go any farther. Any ideas?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I want to validate XML documents against a custom DTD file; http://www.pardus.org.tr/projeler/pisi/pisi-spec.dtd
Here's a quote from XML Copy Editor Help:
Validation
...
To validate against a DTD or XML Schema, the document needs to be attached to the relevant definition or schema.
DTDs are stored locally. A number of DTDs are installed by default (e.g. the public identifier ‘-//W3C/DTD XHTML 1.0 Strict//EN’ is keyed to a local copy of the XHTML 1.0 Strict DTD), but you can also add new DTDs by editing the file ‘catalog’ in the ‘catalog’ directory and saving copies of the DTDs themselves in the ‘dtd’ directory.
...
It doesn't look like I've got anything like 'catalog' and 'dtd' directories:
$ ls /usr/share/xmlcopyeditor/
copying help png po rng rulesets templates xpm
What am I suposed to do? I don't know much about dtd/xml handling, so a detailed explanation is welcome :) .
I use this package: http://aur.archlinux.org/packages.php?ID=6283
I have this same question. Any solution? Where should I put my catalog and DTDs?
On Linux the system catalog is used. Different distros may use different locations, but the etc folder is usually a good place to start.
You could also fetch the distro's docbook distribution (for example) and check where the catalog and DTDs are stored.
If your DTD is installed in the system catalog, xmlce will see it.
Please note that this applies only to Linux. On Windows, the program creates a separate catalog and DTD collection as there is no standard location to fall back to.
If this doesn't help, please give me a shout.
-gerald
Hi,
Sorry I'm a newbie to XML, but, what is the "system catalog" for Linux releases ?
I have both an /etc/xml/catalog and an /etc/sgml/catalog file (and also a dozen of /usr/share/sgml/docbook/sgml-dtd-*/catalog, where * stands for a dozen of different release numbers, not to mention a bunch of other "catalog" files in various directiories such as /usr/share/apps/ksgml/…).
I guess the first one (the one in /etc/xml) is the right one, but it seems rather obsfuscating :
How could I add a DTD file, to have it appear in the "XML/Validate" list ?
Could you help ? Thanks.
The best strategy is to trust your package management.
On Ubuntu, for example, it should be possible to type:
at the command prompt.
The syntax of catalog files is specified in detail at http://www.oasis-open.org/committees/entity/spec-2001-08-06.html.
Please let me know if this doesn't work.
Best,
Gerald
Thanks for the initial tip - it got me pointed in the right direction. I think I'm getting closer to solving this conundrum. I must say that it is FAR more elegant than the solution in Windows, although somewhat more difficult to have working and dev DTD sets in place at the same time.
I work at VMware doing DITA-based documentation XML customizations/specializations to our DTDs and modifying them easily on Linux using your tool instead of something like Oxygen would be ideal for me.
There doesn't appear to be a default DITA XML Ubuntu package I can install as there is with "docbook-xml". So, here's what I have done so far:
I modified the "/etc/xml/catalog" to add lines for each publicID we use such as:
I then created "/etc/xml/dita-xml.xml" with an entry for each publicID and a reference to our main DITA catalog:
I then copied our catalog along with the DTDs to the /usr/share/xml/dita/catalog-dita.xml directory. I had to add the DOCTYPE declaration to the catalog-dita.xml file we use to make sure it validated correctly.
Now, when I create a DITA Map file and try to validate it, I get the error message
From what I can tell, I've set it up as close as possible to match the integration of docbook-xml. At least it now seems to be trying to jump through the various catalogs to find the DTDs instead of looking at our placeholder URN and stopping. I just can't get it to go any farther. Any ideas?