📄 sitemap-v06.rng
字号:
<?xml version="1.0" encoding="UTF-8"?><grammar datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes" xmlns:sch="http://www.ascc.net/xml/schematron" xmlns="http://relaxng.org/ns/structure/1.0" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns:map="http://apache.org/cocoon/sitemap/1.0"> <sch:ns uri="http://apache.org/cocoon/sitemap/1.0" prefix="xmap"/><!-- ===================================================================Apache Cocoon Sitemap RELAX NG grammar, with embedded Schematron rulesVersion 0.6PURPOSE: DRAFT RELAX NG grammar for the Cocoon2 sitemap.xmap files.NOTES:* ATTENTION: The initial (v0.4) grammar was generated from sitemap-v04.dtd, which in turn was reverse-engineered by hand from the various sitemap.xmap instances included in the current distribution. This is just an attempt to document the existing rules for sitemap structure. V0.5 has been enhanced to use stricter than were possible with the DTD. A proper design process is still, still required.* Needed by XML editing tools for creation of reliable documents.* Can generate WXS from this grammar for the use of XML editors which do not support RELAX NG.* The big questions (still) are: - What possibilities were missed because they were not included in the default sitemaps? - What in the default sitemap.xmap files is mandatory versus optional? - What elements/attributes need their rules tightened?AUTHORS: Jeffrey Ricker NG (Usonia Holdings) <rickerng@usonia.net> David Crossley <crossley@indexgeo.com.au> Colin Paul Adams <colin@colina.demon.co.uk> Bruno Dumon <bruno@outerthought.org> Nicola Ken Barozzi NKB<nicolaken@apache.org>FIXME:- map:act is used in various contexts, so it has a loose definition- Completely rewrite this grammar looking from the application point-of-view (do not rely on this temporary initial grammar)- align elements and attributes with sitemap*.xsl- review all xdocs/userdocs/generators/*.xml etc. and sync with this grammar- Add similar changes to those of 2002-11-29 for other component declarations See Bruno email http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=103847911212458CHANGE HISTORY:20010715 V0.1 Initial version of DTD. (RNG)20011106 V0.2 Reviewed all */sitemap.xmap and added definitions (DC)20011106 V0.2 All elements now have "map:" prefix. (DC)20011106 V0.2 Incorporated comments Bruno Dumon cocoon-dev 20010718 (DC)20011116 V0.2 Changes from label/view discussion cocoon-dev 20011115 (DC)20011219 V0.2 Deprecated 'redirect-to resource'. Added 'map:call resource'(CH)20021017 V0.3 Updated so validation works again (CPA)20021019 V0.3 Further changes made to cope with all current sitemaps (CPA)20021021 V0.4 General simplification by adding parameter entities (CPA)20021024 V0.4 RELAX NG grammar generated from sitemap-v04.dtd using DTDinst (DC)20021025 V0.5 Tightening of grammar rules which was not possible with DTD. Also added datatypes. (CPA)20021030 V0.5 Added some missing bits: selector/browser, label.attr is temporarily string (DC)20021029 V0.5 Corrections to allow recent sitemap changes to validate (rules needed loosening considerably to enable this). (CPA)20021030 V0.5 Additional checks on element contents. (CPA)20021106 V0.5 Map:selector declared to have any content. (CPA)20021114 V0.6 Initial set of Schematron rules added. (CPA)20021129 V0.6 map:select should be able to have map:parameter children. (BD)20021129 V0.6 map:action component declaration should allow any child elements as additional configuration information. The exact contents depends on the implementation of each action, and since users can implement their own actions this content cannot be foreseen. (BD)20030212 V0.6 Add TagTransformer contents (VG)20030219 V0.6 Add new i18nTransformer contents <catalogues> (DC)20030730 V0.6 Added new htmlGenerator contents <catalogues> (NKB)====================================================================--><!-- =============================================================== --><!-- Common Attributes --><!-- =============================================================== --><!-- CPA: univeral attributes possessed by all elements --><!-- CPA: id is for use by sitebuilder and others, but really it ought to be --><!-- of type ID (I'm guessing) --> <define name="universal.attr"> <optional> <attribute name="id" > <data type="string" /> </attribute> </optional> </define><!-- CPA: the default attribute is common, and where it occurs is nearly always the same --> <define name="default.attr"> <optional> <attribute name="default"> <data type="string" /> <!-- CPA: in fact the default must always match the name attribute of one of it's child elements. We will rely on a schematron schema to check this (we cannot use ID/IDREF as there are multiple namespaces e.g. map:generator uses a different namespace to map:transformer) - NO - can't be done due to sitemap inheritance --> </attribute> </optional> </define><!-- CPA: the name and src attributes are common, and where they occur are always CDATA, but sometimes optional --> <define name="src.attr"> <attribute name="src"> <data type="string"/> </attribute> </define> <define name="optsrc.attr"> <optional> <attribute name="src"> <data type="string"/> </attribute> </optional> </define> <define name="name.attr"> <attribute name="name"> <data type="string"/> <!-- CPA: see comment on default.attr --> </attribute> </define> <define name="optname.attr"> <optional> <attribute name="name"> <data type="string"/> <!-- CPA: see comment on default.attr --> </attribute> </optional> </define> <define name="uri.attr"> <attribute name="uri"> <data type="string"/> </attribute> </define> <define name="opturi.attr"> <optional> <attribute name="uri"> <data type="string"/> </attribute> </optional> </define><!-- CPA: pool attributes from Excalibur's PoolableComponentHandler --><!-- Defaults are set in cocoon.xconf --> <define name="pool.attr"> <optional> <attribute name="pool-max"> <data type="positiveInteger" /> </attribute> </optional> <optional> <attribute name="pool-min"> <data type="nonNegativeInteger" /> </attribute> </optional> <optional> <attribute name="pool-grow"> <data type="positiveInteger" /> </attribute> </optional> </define><!-- CPA: logger attribute - default is set in cocoon.xconf --> <define name="logger.attr"> <optional> <attribute name="logger"> <data type="string" /> <!-- CPA: a Java class name --> </attribute> </optional> </define><!-- CPA: these three only occur together --><!-- they are used in AggregateNodeBuilder --> <define name="aggregate.attr"> <optional> <attribute name="element"> <data type="string" /> </attribute> </optional> <optional> <attribute name="ns"> <data type="string" /> </attribute> </optional> <optional> <attribute name="prefix"> <data type="string" /> </attribute> </optional> </define><!-- CPA: attributes that occur more than once, and are always defined --><!-- in the same way --> <define name="value.attr"> <attribute name="value"/> <!-- CPA: I think we cannot restrict the datatype, unless we do it on an element-by-element basis --> </define> <define name="mime.attr"> <optional> <attribute name="mime-type"> <!-- restrict further in specific cases --> <data type="string" /> <!-- CPA: tackle this in V0.6 --> </attribute> </optional> </define> <define name="label.attr"> <optional> <attribute name="label"> <data type="string"/> <!-- DC: temporarily changed to "string" to avoid mass of validation errors <data type="NMTOKEN"/> --> <!-- CPA: must match a component name , use schematron to enforce --> </attribute> </optional> </define> <define name="type.attr"> <optional> <attribute name="type"> <data type="string"/> </attribute> </optional> </define><!-- CPA: resource is used both in CallNodeBuilder and --><!-- RedirectToNodeBuilder. It has no default --> <define name="resource.attr"> <optional> <attribute name="resource"> <data type="string" /> </attribute> </optional> </define> <define name="component.attr"> <ref name="label.attr"/> <ref name="logger.attr"/> <ref name="pool.attr"/> </define><!-- CPA: now for element contents --> <define name="pipe.contents"> <zeroOrMore> <!-- CPA: look into this in V0.6 - I think, must use schematron --> <choice> <ref name="map.parameter"/> <ref name="map.act"/> <ref name="map.match"/> <ref name="map.select"/> <ref name="map.call"/> <ref name="map.redirect-to"/> <ref name="map.read"/> <ref name="map.aggregate"/> <ref name="map.generate"/> <ref name="map.transform"/> <ref name="map.serialize"/> <ref name="map.mount"/> </choice> </zeroOrMore> </define><!-- CPA: contents confirmed by inspection of HtmlGenerator.java --> <define name="htmlGenerator.contents"> <optional><ref name="jtidy-config"/></optional> </define><!-- CPA: contents confirmed by inspection of TraxTransformer.java --> <define name="traxTransformer.contents"> <optional><ref name="use-request-parameters"/></optional> <optional><ref name="use-cookies"/></optional> <optional><ref name="use-browser-capabilities-db"/></optional> <optional><ref name="use-session-info"/></optional> <optional><ref name="use-deli"/></optional> <optional><ref name="xslt-processor-role"/></optional> <optional><ref name="transformer-factory"/></optional> </define><!-- CPA: contents confirmed by inspection of I18nTransformer.java --> <define name="i18nTransformer.contents"> <optional><ref name="catalogues"/></optional> <optional><ref name="catalogue-name"/></optional> <optional><ref name="catalogue-location"/></optional> <optional><ref name="untranslated-text"/></optional> <optional><ref name="cache-at-startup"/></optional> </define><!-- CPA: contents confirmed by inspection of XSLTProcessorImpl.java --><!-- N.B. these appear in the source as if they were parameter --><!-- tags, so I'm not sure if this is perfectly correct. --> <define name="xsltTransformer.contents"> <optional><ref name="use-store"/></optional> <optional><ref name="incremental-processing"/></optional> </define><!-- CPA: contents confirmed by inspection of EncodeURLTransformer.java --> <define name="encodeURLTransformer.contents"> <optional><ref name="include-name"/></optional> <optional><ref name="exclude-name"/></optional> </define> <define name="linkRewriterTransformer.contents"> <zeroOrMore> <choice> <element name="link-attrs"><text/></element> <element name="schemes"><text/></element> <element name="exclude-schemes"><text/></element> <element name="bad-link-str"><text/></element> <element name="input-module"> <ref name="anyAttribute"/> <zeroOrMore> <ref name="anyElement"/> </zeroOrMore> </element> </choice> </zeroOrMore> </define> <define name="IdGeneratorTransformer.contents"> <zeroOrMore> <element name="element"> <text/> </element> <element name="id"> <text/> </element> <optional> <element name="id-attr"> <text/> </element> </optional> </zeroOrMore> </define><!-- CH: contents confirmed by inspection of Web3RfcTransformer.java --> <define name="web3RfcTransformer.contents"> <optional><element name="system"><text/></element></optional> </define> <define name="simpleFormExtractTransformer.contents"> <optional> <element name="output"> <ref name="name.attr"/> <text/> </element> </optional> </define><!-- VG: contents of TagTransformer from the scratchpad --> <define name="tagTransformer.contents"> <optional> <element name="transformer-hint"> <text/> </element> </optional> </define><!-- CPA: contents confirmed by inspection of AbstractTextSerializer.java --> <define name="textSerializer.contents"> <optional><ref name="cdata-section-elements"/></optional> <optional><ref name="doctype-public"/></optional> <optional><ref name="doctype-system"/></optional> <optional><ref name="encoding"/></optional> <optional><ref name="indent"/></optional> <optional><ref name="media-type"/></optional> <optional><ref name="method"/></optional> <optional><ref name="omit-xml-declaration"/></optional> <optional><ref name="standalone"/></optional> <optional><ref name="version"/></optional> </define> <define name="svg2jpegSerializer.contents"> <optional> <element name="parameter"> <attribute name="name"/> <attribute name="type"> <value type="string">float</value> </attribute> <attribute name="value"/> </element> </optional> </define><!-- =============================================================== --><!-- Sitemap --><!-- =============================================================== --><!-- CPA: contents are all optional, as they can be inherited from the parent sitemap --> <define name="map.sitemap"> <element name="map:sitemap" xmlns:map="http://apache.org/cocoon/sitemap/1.0" > <ref name="map.sitemap.attlist"/> <interleave> <optional> <ref name="map.components"/> </optional> <optional> <ref name="map.views"/> </optional> <optional> <ref name="map.resources"/> </optional> <optional> <ref name="map.action-sets"/> </optional> <zeroOrMore> <ref name="map.flow"/> </zeroOrMore> <ref name="map.pipelines"/> </interleave> </element> </define> <define name="map.sitemap.attlist" combine="interleave"> <ref name="universal.attr"/> <empty/> </define><!-- =============================================================== --><!-- Components --><!-- =============================================================== -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -