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.

Schematron
Declare schematron namespace : source:http://apache.org/cocoon/source/1.0
source.write — Warning! not used within this schema file.
define  :  source.write
element  :  source:write
optional
attribute  :  create
data  :  boolean
optional
attribute  :  overwrite
data  :  boolean
interleave
ref  →  source.source
optional
ref  →  source.path
ref  →  source.fragment
<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>
source.insert — Warning! not used within this schema file.
define  :  source.insert
element  :  source:insert
optional
attribute  :  create
data  :  boolean
optional
attribute  :  overwrite
data  :  boolean
interleave
ref  →  source.source
optional
ref  →  source.path
optional
ref  →  source.replace
ref  →  source.fragment
<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>
source.delete — Warning! not used within this schema file.
define  :  source.delete
element  :  source:delete
ref  →  source.source
<define name="source.delete">
   <element name="source:delete">
      <ref name="source.source"/>
   </element>
</define>
define  :  source.source
element  :  source:source
Any text
<define name="source.source">
   <element name="source:source">
      <text/>
   </element>
</define>
define  :  source.path
element  :  source:path
Any text
<define name="source.path">
   <element name="source:path">
      <text/>
   </element>
</define>
define  :  source.replace
element  :  source:replace
Any text
<define name="source.replace">
   <element name="source:replace">
      <text/>
   </element>
</define>
define  :  source.fragment
element  :  source:fragment
<define name="source.fragment">
   <element name="source:fragment">
      <ref name="source.fragmentElements"/>
   </element>
</define>
define  :  source.fragmentElements
zeroOrMore
choice
element
anyName  
attribute
anyName  
<define name="source.fragmentElements">
   <zeroOrMore>
      <choice>
         <element>
            <anyName/>
            <ref name="source.fragmentElements"/>
         </element>
         <attribute>
            <anyName/>
         </attribute>
      </choice>
   </zeroOrMore>
</define>