RELAX NG Schema for Paloose Sitemaps
Author: Hugh Field-Richards
Date: 2011-08-03T12:15

This is the RELAX NG schema for the Paloose sitemaps. They are very similar to Cocoon sitemaps, but with enough differences to make it worth formalising separately. Any bug reports, help, suggestions, new task schemas etc to me, Hugh Field-Richards (hsfr@hsfr.org.uk).

The documentation is designed to be processed by the rng2xhtml.xsl pretty-printing processor available from the author.

Schematron
Declare schematron namespace : map = http://apache.org/cocoon/sitemap/1.0
components.matchers — Warning! not used within this schema file.
define : components.matchers
element : map:matchers
refcomponents.attribute.default
zeroOrMore
<define name="components.matchers">
   <element name="map:matchers">
      <ref name="components.attribute.default"/>
      <zeroOrMore>
         <ref name="matchers.matcher"/>
      </zeroOrMore>
   </element>
</define>
define : matchers.matcher
Schematron
Check the matcher names are unique
Context : “map:matcher
if not condition “count(//map:matcher[@name = current()/@name]) = 1
then output: There should be unique matcher names
element : map:matcher
refcomponent.attributes.common
optional
refcomponent.attribute.cachable
optional
attribute : mime-type
<define name="matchers.matcher">
   <sch:pattern name="Check the matcher names are unique">
      <sch:rule context="map:matcher">
         <sch:assert test="count(//map:matcher[@name = current()/@name]) = 1">There should be unique matcher names</sch:assert>
      </sch:rule>
   </sch:pattern>
   <element name="map:matcher">
      <ref name="component.attributes.common"/>
      <optional>
         <ref name="component.attribute.cachable"/>
      </optional>
      <optional>
         <attribute name="mime-type"/>
      </optional>
      <ref name="WildcardURIMatcher.contents"/>
      <ref name="RegexpURIMatcher.contents"/>
   </element>
</define>
define : WildcardURIMatcher.contents
interleave
optional
refcomponent.use-request-parameters
<define name="WildcardURIMatcher.contents">
   <interleave>
      <optional>
         <ref name="component.use-request-parameters"/>
      </optional>
   </interleave>
</define>
define : RegexpURIMatcher.contents
interleave
optional
refcomponent.use-request-parameters
<define name="RegexpURIMatcher.contents">
   <interleave>
      <optional>
         <ref name="component.use-request-parameters"/>
      </optional>
   </interleave>
</define>
matcher.instance — Warning! not used within this schema file.
define : matcher.instance
element : map:match
attribute : pattern
optional
attribute : type
choice
value = "regexp"
value = "wildcard"
refpipeline.matcher
<define name="matcher.instance">
   <element name="map:match">
      <attribute name="pattern"/>
      <optional>
         <attribute name="type">
            <choice>
               <value>regexp</value>
               <value>wildcard</value>
            </choice>
         </attribute>
      </optional>
      <ref name="pipeline.matcher"/>
   </element>
</define>

Copyright

Copyright (c) 2006 – 2009 Hugh Field-Richards

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

For a copy of the GNU General Public License write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.