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.
<define name="components.readers"> <element name="map:readers"> <attribute name="default"> <ref name="data.componentName"/> </attribute> <zeroOrMore> <ref name="readers.reader"/> </zeroOrMore> </element> </define>
<define name="readers.reader"> <sch:pattern name="Check the reader names are unique"> <sch:rule context="map:reader"> <sch:assert test="count(//map:reader[@name = current()/@name]) = 1"> There should be unique reader names </sch:assert> </sch:rule> </sch:pattern> <element name="map:reader"> <ref name="component.attributes.common"/> <ref name="reader.contents"/> </element> </define>
<define name="reader.instance"> <element name="read" ns="http://apache.org/cocoon/sitemap/1.0"> <ref name="components.attribute.src"/> <empty/> </element> </define>
<define name="map.resources"> <element name="resources" ns="http://apache.org/cocoon/sitemap/1.0"> <zeroOrMore> <ref name="resources.resource"/> </zeroOrMore> </element> </define>
<define name="resources.resource"> <element name="map:resource"> <attribute name="name"/> <zeroOrMore> <ref name="transformer.instance"/> </zeroOrMore> <ref name="serializer.instance"/> </element> </define>
<define name="map.flows"> <element name="map:flow"> <attribute name="language"> <ref name="data.language"/> </attribute> <zeroOrMore> <ref name="resources.script"/> </zeroOrMore> </element> </define>
<define name="resources.script"> <sch:pattern name="Check whether attributes are not null"> <sch:rule context="map:script"> <sch:report test="@src = ''"> Cannot have null src attribute in script element </sch:report> </sch:rule> </sch:pattern> <element name="map:script"> <attribute name="src"> <ref name="data.sourceFileName"/> </attribute> <empty/> </element> </define>
<define name="resource.call"> <element name="map:call"> <choice> <attribute name="resource"> <ref name="data.componentName"/> </attribute> <attribute name="function"/> </choice> <zeroOrMore> <ref name="common.element.parameter"/> </zeroOrMore> </element> </define>
<define name="resource.redirect-to"> <sch:pattern name="Check whether attributes are not null"> <sch:rule context="map:redirect-to"> <sch:report test="@uri = ''"> Cannot have null uri attribute in redirect-to element </sch:report> </sch:rule> </sch:pattern> <element name="map:redirect-to"> <attribute name="uri"> <text/> </attribute> <empty/> </element> </define>
<define name="resource.mount"> <element name="map:mount"> <attribute name="src"> <text/> </attribute> <optional> <attribute name="uri-prefix"> <data type="string"/> </attribute> </optional> <empty/> </element> </define>
<define name="map.views"> <element name="map:views"> <zeroOrMore> <ref name="views.view"/> </zeroOrMore> </element> </define>
<define name="views.view"> <element name="map:view"> <attribute name="name"/> <attribute name="from-label"/> <ref name="pipeline.views"/> </element> </define>
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.