ralax ng compact + schematron validation issues

This should cover W3C XML Schema, Relax NG and DTD related problems.
velda
Posts: 21
Joined: Fri Jul 18, 2008 9:48 pm

ralax ng compact + schematron validation issues

Post by velda »

Im working on a schema in relax ng with embedded schematron rules but none of the schematron rules seems to be operating. Whats odd is that if I use trang to convert the compact (rnc) to xml (rng) it works just fine.

take for example the following simple xml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<test format="0.6">
<blank/>
</test>
with the compact schema

Code: Select all

namespace rng = "http://relaxng.org/ns/structure/1.0"
datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"
namespace sch = "http://purl.oclc.org/dsdl/schematron"

start =
element test {
attribute format {
[
sch:pattern [
sch:rule [
context = "/test"
sch:assert [
test = "@format = 0.5"
' format isnt 0.5 '
]
]
]
]
xsd:decimal },
element blank {empty }
}
which then translated to rng in trang gives me

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<grammar xmlns:sch="http://purl.oclc.org/dsdl/schematron" xmlns:rng="http://relaxng.org/ns/structure/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<start>
<element name="test">
<attribute name="format">
<data type="decimal">
<sch:pattern>
<sch:rule context="/test">
<sch:assert test="@format = 0.5"> format isnt 0.5 </sch:assert>
</sch:rule>
</sch:pattern>
</data>
</attribute>
<element name="blank">
<empty/>
</element>
</element>
</start>
</grammar>
I do realize this isnt the best example, as the test could be done using "attribute format { "0.5" }". This is simply for the purpose of testing basic schematron.

Using the external validation option, if i select the rng, XML syntax, and embedded schematron rules, i get the appropriate response: "format isnt 0.5 (@format = 0.5)"

If i try the same but with the rnc and compact options, it validates and does not give me the schematron assert.

Using oXygen Editor 9.3 on OSX 10.5.5
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: relax ng compact + schematron validation issues

Post by george »

Hi,

Embedded Schematron is supported only in XML Schema and Relax NG in XML format.

Best Regards,
George
George Cristian Bina
velda
Posts: 21
Joined: Fri Jul 18, 2008 9:48 pm

Re: ralax ng compact + schematron validation issues

Post by velda »

Are there any plans to support it?
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: ralax ng compact + schematron validation issues

Post by george »

This is not logged as an issue on our issue tracking system. As you mentioned in your message you can convert from compact to XML format and use that instead.
I will log this as an enhancement and if we receive also other requests then it will probably be implemented.

Best Regards,
George
George Cristian Bina
Post Reply