[Schematron] Help sought: implementation of Character Repertoire in XSLT2 for embedding in schematron

Dave Pawson dave.pawson at gmail.com
Mon Sep 22 05:21:10 EDT 2008


2008/9/22 Rick Jelliffe <rjelliffe at allette.com.au>:

> Good point.  The <properties> idea certainly needs feedback and comment,
> nothing is baked.
>
> Rather than using foreign attributes, a mechanism like this allows single
> definition-multiple use. This is
> very useful where the same properties need to be applied to different uses.
>
> <schema ...><title>Stubbed schema to show embedded CRepDL script</title>
> <pattern>
>  <rule test="x">
>   <assert test="true()"        properties="iso8859-15-text http-iri
> current-section current-text"    >The <name/> element should be a http IRI
> that only contain ISO 8859-15 text</assert>
>  </rule>
> </pattern>
>
>  <properties>
>   <property id="iso8859-15-text ">
>      <cdrl:union>
>          <cdrl:char>
>          ....
>      </cdrl:union>
>  </property>
>
>  <property id="http-iri" >
>        <xsd:anyUri>
>                <xsd:pattern value="http:.*"/>
>        </xsd:anyUri>
>  <property>
>
>  <property id="current-section">
>        <sch:value-of select="ancestor::section[1]/title" />
>  </property>
>
>  <property id="current-text">
>        <sch:value-of select="." />
>  </property>
>
>
>  </properties>
> </schema>
>
> In this example, we have properties for
>   1) the character repertoire
>   2) the XSD datatype
>   3) dynamic text for some other information

I like that!
Mostly.
 <assert test="true()"        properties="iso8859-15-text http-iri
current-section current-text"    >

The vague space separator as per idrefs I'm less keen on?
Is there a boolean relationship?
properties="iso8859-15-text and http-iri and current-section
current-text ? For instance?

This property and this property and this property?

Perhaps this is mixing up different classes of properties?
repertoire is true
datatype = iri  (boolean but not expressed as such?)
current-text is this??? That doesn't quite fit does it?

I like expressing multiple constraints though. How to get some form of
consistency of expression?





> The previous system I had prototyped used different attributes for each:
>  <assert test="true()"  ext:cdrl-type="ISO-8859-15"  ext:xsd-type="http-iri"
>>
> but I didn't see that this kind of specificity bought anything other than
> pain.


Syntactically these are very similar and clearly boolean though?
A && B && C.



> Schematron schemas are outside-in: the assertion text says what should be,
> and the test implements this as best
> as possible. XSD (and RELAX NG) schemas are inside-out: the content models
> say what should be and then
> you may have some comments to say constraints that cannot be expressed.
> So the use of text="true()" and @properties may indeed look strange and over
> generic ("more meta than thou"
> is the witticism I heard at W3C about this kind of design issue), but I
> think it
> satisfies a stronger design issue: the primacy of the assertion text.  It
> also provides, to me, a clearer
> conceptual classification of this extra information, and in particular
> allows the properties to have a name (id)
> independent of their location.

Yes, that makes for clear readability too.


>
> What the properties give is, in effect, a post-schema validation infoset,
> because they link extra information to
> nodes. The big differences between these and the XSD PSVI are 1) there is an
> XML syntax from the word go,
> namely the properties as the come out in the SVRL document, and 2) these
> properties are extensible, while
> the outcomes of XSD validation are fixed.  (Now, actually, it might be
> argued that these properties do nothing
> more than XSD's annotation/* elements do, however, because the properties
> can have dynamic values, I disagree.)



Maybe I'm just nit picking because it's new syntax to me?

regards


-- 
Dave Pawson
XSLT XSL-FO FAQ.
Docbook FAQ.
http://www.dpawson.co.uk



More information about the Schematron mailing list