ISO DTTL is based on Jeni Tennison's ideas for defining data type
libraries using properties. DTTL would be a good companion to Schematron:
* use standard type libraries developed for RELAX NG or XSD
compatability for free
* reduce the number of home-made assertions
* implementable on top of XSLT 2, so may be low-hanging fruit
I am wondering on the best way to go about it:
1) Extension function that can validate a type
<sch:rule context="eg">
<sch:assert test="dt:validate(@date, 'types:japanese_date')" >
The date attribute should be a Japanese date.
</sch:assert>
</sch:rule>
Pro: fits into XSLT extension function mechanism. Just exended query
language binding
Con: fails on XSLT 1 systems
2) Foreign attribute
<sch:rule context="eg">
<sch:assert test="true()" subject="@date" dt:type="types:japanese_date" >
The date attribute should be a Japanese date.
</sch:assert>
</sch:rule>
Pro: doesnt fail on XSLT 1 implementations, declarative, exploits
@subject, clean,
fits in with the idea that we are not assigning type to the
context--the context is just
a convenient pivot
Con: test="true()" looks funny
3) Foreign element
<sch:rule context="eg/@date">
<sch:assert test="true()"><!--satisfy content model--></sch:assert>
<dt:datatype type="types:japanese_date" />
</sch:rule>
<sch:rule context="eg/@date">
<sch:assert test="true()"><!--satisfy content model--></sch:assert>
<dt:datatype library="xtypes.dtl" type="types:japanese_date" />
</sch:rule>
Pro: clean, doesn't fail on XSLT 1 implementations
Con: extra assert to satify content model is ugly, looks like a type
assignment to the context which is not the way to go
I favour 2) so far. Any ideas?
Cheers
Rick Jelliffe
-- DSDL members discussion list To unsubscribe, please send a message with the command "unsubscribe" to dsdl-discuss-request@dsdl.org (mailto:dsdl-discuss-request@dsdl.org?Subject=unsubscribe)Received on Thu Mar 9 07:20:21 2006
This archive was generated by hypermail 2.1.8 : Wed Apr 12 2006 - 14:48:02 UTC