Schematron and include problem.

<oXygen/> general issues.
OneNight
Posts: 2
Joined: Fri Jun 22, 2007 3:15 pm

Schematron and include problem.

Post by OneNight » Fri Jun 22, 2007 3:31 pm

Hi all,

in ISO Schematron there is an include element.

The problem occurs when I define a Schematron schema separately (e.g. StronA.sch) which contains an abstract pattern. Like:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<pattern abstract="true" id="check_Value_Present" xmlns="http://purl.oclc.org/dsdl/schematron">
<rule context="$possiblyEmptyElement">
<assert test="text()[normalize-space(.)]">
A value should be present, because the "<name/>" element cannot be empty.</assert>
</rule>
</pattern>
When I include StronA.sch in StronZ.sch and reference the ID of that abstract pattern it gives an error in the editor when opened at StronZ.sch.
The error is: E [Xerces] cvc-id.1: There is no ID/IDREF binding for IDREF 'check_Value_Present'.

I think this should not be the case. Using StronZ.sch to validate an XML document works without problems despite this error.

I hope I have been clear.

Regards,

Stijn.

george
Site Admin
Posts: 2102
Joined: Thu Jan 09, 2003 2:58 pm

Post by george » Fri Jun 22, 2007 5:54 pm

Hi,

Currently oXygen performs the validation of Schematron files against an XML Schema for Schematron. When you have included files there may be cases as in your example when the IDs are defined in another file and thus (although the resulting schema after solving the includes is valid against the schema) the files may not be valid against the schema for Schematron (as the IDs are not defined in the same file).
We will consider handling these cases in some way in the future - the best approach I think is to make the Schematron validation to get the document with includes expanded and to validate that against the schema - then for an included file that is not valid by itself you can configure a validation scenario and validate from the including file.

Best Regards,
George
George Cristian Bina

OneNight
Posts: 2
Joined: Fri Jun 22, 2007 3:15 pm

Post by OneNight » Mon Jun 25, 2007 9:48 am

Thanks for the quick reply!

Yeah, I think just having 2 separate schematron validation files and validating the XML document with both is a solution.

But I do like having some kind of hierarchy (especially for lets say 'base types') and then including and reusing them when needed - like the validation of an address. The same goes for building up a nice hierarchy when creating XML Schema, for which 'includes' and 'imports' of course do work inside Oxygen.

Thanks again for your time,

regards,

Stijn.

PS: I really enjoy using Oxygen, keep up the good work!

Post Reply