RELAX NG Schema for Source Writing
Author: Hugh Field-Richards
Date: 2007-03-24T17:00
WARNING! This schema uses ANY type elements. This is dangerous: it allows anything to appear within the elements. The cost of this generality is the dismantling of the structure. Because any element is allowed it is impossible to validate formally the structure of the document. See Goldfarb (The SGML Handbook): "An element type that has an ANY content specification is completely unstructured.">
The Source WRiting XML definition (based on the Cocoon with some minor differences).
These are the namespaces needed by the Schematron validator.
<define name="source.write"> <element name="source:write"> <optional> <attribute name="create"> <data type="boolean"/> </attribute> </optional> <optional> <attribute name="overwrite"> <data type="boolean"/> </attribute> </optional> <interleave> <ref name="source.source"/> <optional> <ref name="source.path"/> </optional> <ref name="source.fragment"/> </interleave> </element> </define>
<define name="source.insert"> <element name="source:insert"> <optional> <attribute name="create"> <data type="boolean"/> </attribute> </optional> <optional> <attribute name="overwrite"> <data type="boolean"/> </attribute> </optional> <interleave> <ref name="source.source"/> <optional> <ref name="source.path"/> </optional> <optional> <ref name="source.replace"/> </optional> <ref name="source.fragment"/> </interleave> </element> </define>
<define name="source.delete"> <element name="source:delete"> <ref name="source.source"/> </element> </define>
<define name="source.source"> <element name="source:source"> <text/> </element> </define>
<define name="source.path"> <element name="source:path"> <text/> </element> </define>
<define name="source.replace"> <element name="source:replace"> <text/> </element> </define>
<define name="source.fragment"> <element name="source:fragment"> <ref name="source.fragmentElements"/> </element> </define>
<define name="source.fragmentElements"> <zeroOrMore> <choice> <element> <anyName/> <ref name="source.fragmentElements"/> </element> <attribute> <anyName/> </attribute> </choice> </zeroOrMore> </define>