XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] ISO Schematron beginners question: including multiple patterns

In the recent versions of the ISO Schematron distributions it implements
the extension proposed for the new revision of ISO Schematron.

This is that the <sch:extends> element can be used anywhere. (It was
initially just for abstract rules.)

So the difference is that <sch:include> includes the XML resource being
referenced. <sch:extends> includes the children of the (top-level element)
of the resource being referenced.

For example

<sch:schema ...>

  <sch:title>An example of extends</sch:title>

  <sch:extends href="schema-module-1.sch" />

  ...
</sch:schema>

where file schema-module-1.sch might be

<sch:schema ...>

  <sch:title>Schema Module 1</sch:title>

  <sch:ns prefix="abc" url="http://www.eg.com/ns/abc"; />

  <sch:pattern id="p1">
     <sch:title>One interesting pattern</sch:title>
     ...
  <sch:pattern>

  <sch:pattern id="p2">
     <sch:title>Another interesting pattern</sch:title>
     ...
  <sch:pattern>


</sch:schema>

The inclusion is implemented in the iso-dsdl-include.xslt preprocessor
IIRC. I don't recall that the skeleton needed any changes to support it,
since the ordering of top-level elements in schematron is aimed at
sectioning the document for human readability rather than any processing
semantics.

So this gives three mechanism for modularity: <include> is only useful for
fine-grain fragments; <extends> is useful for any grouped elements and is
more "semantic"y in connotation; and @is-a operates at what XSD would call
the component level (but is only defined for patterns at the moment.)

Please let me know if it doesn't work, if it doesn't meet requirements, or
if you have any recommendations for a better and easier to
understand/explain/implement approach.

Cheers
Rick Jelliffe



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS