Schematron Validation - Missing local DTD

This should cover W3C XML Schema, Relax NG and DTD related problems.
hbfm
Posts: 4
Joined: Wed Apr 29, 2015 12:46 pm

Schematron Validation - Missing local DTD

Post by hbfm »

Hi, folks!
I am testing Schematron validation on a batch of XML documents, which are distributed over several directories. Each XML document contains an external DTD declaration to a local DTD File in the same directory like this:

Code: Select all

<!DOCTYPE abc SYSTEM "abc.dtd">
By using a DTD validation scenario there are no problems to validate all files with just one DTD, which is located in a remote directory like

Code: Select all

c:\temp
.
But when I want to validate all XML files against a Schematron rule Oxygen throws an error, because it doesn't find the local DTD. I just can proceed the validation, when there is a local DTD in every XML directory.
Can I neglect Oxygen to validate against a DTD when I just want to test a Schematron rule. Or can I combine both validations in one scenario so I only have to use one remote DTD and one remote Schematron file? Or am I just misunderstanding a Schematron validation? Thank you!
radu_pisoi
Posts: 403
Joined: Thu Aug 21, 2003 11:36 am
Location: Craiova
Contact:

Re: Schematron Validation - Missing local DTD

Post by radu_pisoi »

Hi,
hbfm wrote:Can I neglect Oxygen to validate against a DTD when I just want to test a Schematron rule.
The answer is 'no' because the XML file and DTD are tightly connected. An XML document can refer DTD entities which are defined in the DTD document, so it is not a good idea to avoid the DTD file when load an XML instance.

The solution is to redirect the path of the missing DTD to the one located in the C:\temp folder. This can be done by using an XML catalog like:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD XML Catalogs V1.1//EN" "http://www.oasis-open.org/committees/entity/release/1.1/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<systemSuffix systemIdSuffix = "abc.dtd" uri="file:/C:/temp/abc.dtd"/>
</catalog>
The XML catalog should be added in the XML/XML Catalog preferences page.

You can find more information about XML catalog in our user manual http://oxygenxml.com/doc/ug-editor/#top ... alogs.html.
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
hbfm
Posts: 4
Joined: Wed Apr 29, 2015 12:46 pm

Re: Schematron Validation - Missing local DTD

Post by hbfm »

Thank you!
Post Reply