Permalink
Browse files

Created a SiteMesh XSD for version 3.x

  • Loading branch information...
1 parent 6413819 commit 020b371265b16a332d51e52ff1b72a770cca085c @rburton rburton committed with sitemesh Sep 6, 2009
Showing with 52 additions and 0 deletions.
  1. +52 −0 sitemesh/src/main/resources/org/sitemesh/sitemesh3.xsd
@@ -0,0 +1,52 @@
+<?xml version="1.0"?>
+<xsd:schema targetNamespace="http://sitemesh.org/xml/config"
+ xmlns:config="http://sitemesh.org/xml/config"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ attributeFormDefault="unqualified"
+ version="3.0.0">
+
+ <xsd:element name="sitemesh">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="mapping"
+ type="config:mapping"
+ minOccurs="0"/>
@jeslopalo

jeslopalo Jun 2, 2011

I think that a maxOccurs="unbounded" is needed in mapping element definition.

+ <xsd:element name="content-processor"
+ type="config:content-processor"
+ minOccurs="0"/>
+ <xsd:element name="mime-type" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="source-dir" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="dest-dir" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:element>
+
+ <xsd:attributeGroup name="mapping-attribute-group">
+ <xsd:attribute name="path" type="xsd:string"/>
+ <xsd:attribute name="decorator" type="xsd:string"/>
+ <xsd:attribute name="exclude" type="xsd:boolean" default="false"/>
+ </xsd:attributeGroup>
+
+ <xsd:complexType name="mapping">
+ <xsd:sequence>
@jeslopalo

jeslopalo Jun 2, 2011

I think that this sequence should be optional (ie. minOccurs="0")

+ <xsd:element name="path" type="xsd:string"/>
+ <xsd:element name="decorator" type="xsd:string"/>
+ </xsd:sequence>
+ <xsd:attributeGroup ref="mapping-attribute-group"/>
@jeslopalo

jeslopalo Jun 2, 2011

i think that a "config:" in ref is needed!

[xsd:attributeGroup ref="config:mapping-attribute-group" /]

+ </xsd:complexType>
+
+ <xsd:complexType name="content-processor">
+ <xsd:sequence>
+ <xsd:element ref="config:tag-rule-bundle"/>
+ </xsd:sequence>
+ <xsd:attribute name="class" type="xsd:string"/>
+ </xsd:complexType>
+
+ <xsd:element name="tag-rule-bundle">
+ <xsd:complexType>
+ <xsd:attribute name="class" type="xsd:string"/>
+ </xsd:complexType>
+ </xsd:element>
+
+</xsd:schema>

3 comments on commit 020b371

Owner

joewalnes replied Jun 5, 2011

@rburton - can you verify these comments and update?

-j

Member

rburton replied Jun 5, 2011

Member

rburton replied Jun 7, 2011

Please sign in to comment.