📄 xmlschema.rng
字号:
</define>
<define name="include">
<doc:p>
This describes an include element, which must have a schemaLocation
attribute.
</doc:p>
<element name="include"
doc:href="http://www.w3.org/TR/xmlschema-1/#element-include">
<ref name="annotated" />
<attribute name="schemaLocation">
<data type="anyURI" />
</attribute>
</element>
</define>
<define name="redefine">
<doc:p>
This describes a redefine element, which must have a schemaLocation
attribute and can then contain any mix of annotations and redefinable
components.
</doc:p>
<element name="redefine"
doc:href="http://www.w3.org/TR/xmlschema-1/#element-redefine">
<ref name="openAttrs" />
<optional>
<attribute name="id">
<data type="ID" />
</attribute>
</optional>
<attribute name="schemaLocation">
<data type="anyURI" />
</attribute>
<zeroOrMore>
<choice>
<ref name="annotation" />
<ref name="redefinable" />
</choice>
</zeroOrMore>
</element>
</define>
<define name="import">
<doc:p>
This gives the basic model for an import element - an optional
schemaLocation attribute.
</doc:p>
<ref name="annotated" />
<optional>
<attribute name="schemaLocation">
<data type="anyURI" />
</attribute>
</optional>
</define>
<define name="importRequiredNamespace">
<doc:p>
This describes an import element that's used when its parent schema
element doesn't specify a targetNamespace. In these cases, the
import element must give a namespace attribute.
</doc:p>
<element name="import"
doc:href="http://www.w3.org/TR/xmlschema-1/#element-import">
<ref name="import" />
<attribute name="namespace">
<data type="anyURI" />
</attribute>
</element>
</define>
<define name="importOptionalNamespace">
<doc:p>
This describes an import element that's used when its parent schema
element specifies a targetNamespace. In these cases, the namespace
attribute on the import element is optional.
</doc:p>
<element name="import"
doc:href="http://www.w3.org/TR/xmlschema-1/#element-import">
<ref name="import" />
<optional>
<attribute name="namespace">
<data type="anyURI" />
</attribute>
</optional>
</element>
</define>
<define name="selector">
<doc:p>
This describes a selector element. The xpath attribute is a simplified
XPath - the regular expression given here is the one from the XML Schema
for XML Schema.
</doc:p>
<element name="selector"
doc:href="http://www.w3.org/TR/xmlschema-1/#element-selector">
<ref name="annotated" />
<attribute name="xpath">
<data type="token">
<param name="pattern">(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*(\|(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*)*</param>
</data>
</attribute>
</element>
</define>
<define name="field">
<doc:p>
This describes a field element. The xpath attribute is a simplified
XPath - the regular expression given here is the one from the XML Schema
for XML Schema.
</doc:p>
<element name="field"
doc:href="http://www.w3.org/TR/xmlschema-1/#element-field">
<ref name="annotated" />
<attribute name="xpath">
<data type="token">
<param name="pattern">(\.//)?((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)/)*((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)|((attribute::|@)((\i\c*:)?(\i\c*|\*))))(\|(\.//)?((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)/)*((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)|((attribute::|@)((\i\c*:)?(\i\c*|\*)))))*</param>
</data>
</attribute>
</element>
</define>
<define name="keybase">
<doc:p>
This gives the basic content for identity constraints - a name attribute
that uniquely identifies the identity constraint, a selector element and
one or more field elements.
</doc:p>
<ref name="annotated" />
<attribute name="name">
<data type="NCName" />
</attribute>
<ref name="selector" />
<oneOrMore>
<ref name="field" />
</oneOrMore>
</define>
<define name="identityConstraint">
<doc:p>
This gives a model group for the three identity constraint elements, used
within the content of element elements.
</doc:p>
<choice>
<ref name="unique" />
<ref name="key" />
<ref name="keyref" />
</choice>
</define>
<define name="unique">
<doc:p>
This describes a unique element.
</doc:p>
<element name="unique"
doc:href="http://www.w3.org/TR/xmlschema-1/#element-unique">
<ref name="keybase" />
</element>
</define>
<define name="key">
<doc:p>
This describes a key element.
</doc:p>
<element name="key"
doc:href="http://www.w3.org/TR/xmlschema-1/#element-key">
<ref name="keybase" />
</element>
</define>
<define name="keyref">
<doc:p>
This describes a keyref element.
</doc:p>
<element name="keyref"
doc:href="http://www.w3.org/TR/xmlschema-1/#element-keyref">
<ref name="keybase" />
<attribute name="refer">
<data type="QName" />
</attribute>
</element>
</define>
<define name="notation">
<doc:p>
This describes a notation element. The names of notation elements are
unique in the notation symbol space. The public attribute is required,
and the system attribute is optional.
</doc:p>
<element name="notation"
doc:href="http://www.w3.org/TR/xmlschema-1/#element-notation">
<ref name="annotated" />
<attribute name="name">
<data type="NCName" />
</attribute>
<attribute name="public">
<data type="token" />
</attribute>
<optional>
<attribute name="system">
<data type="anyURI" />
</attribute>
</optional>
</element>
</define>
<define name="appinfoContent">
<doc:p>
This is designed to describe the content of the appinfo elements in the
schema. At the moment this allows any mixed content without validation.
Note that this is fairly complex compared to the XML Schema equivalent,
which would be a single any element.
</doc:p>
<ref name="anyContent" />
</define>
<define name="anyContent">
<mixed>
<zeroOrMore>
<element>
<anyName />
<zeroOrMore>
<attribute>
<anyName />
</attribute>
</zeroOrMore>
<ref name="anyContent" />
<empty />
</element>
</zeroOrMore>
</mixed>
</define>
<define name="appinfo">
<doc:p>
This describes an appinfo element. It has an optional source attribute
and can currently contain anything at all.
</doc:p>
<element name="appinfo"
doc:href="http://www.w3.org/TR/xmlschema-1/#element-appinfo">
<optional>
<attribute name="source">
<data type="anyURI" />
</attribute>
</optional>
<ref name="appinfoContent" />
</element>
</define>
<define name="documentationContent">
<doc:p>
This is designed to describe the content of the documentation elements in
the schema. At the moment this allows any mixed content without
validation. Note that this is fairly complex compared to the XML Schema
equivalent, which would be a single any element.
</doc:p>
<ref name="anyContent" />
</define>
<define name="documentation">
<doc:p>
This describes a documentation element. It has optional source
and xml:lang attributes and can currently contain anything at all.
</doc:p>
<element name="documentation"
doc:href="http://www.w3.org/TR/xmlschema-1/#element-documentation">
<zeroOrMore>
<choice>
<attribute name="source">
<data type="anyURI" />
</attribute>
<attribute name="xml:lang">
<data type="language" />
</attribute>
</choice>
</zeroOrMore>
<ref name="documentationContent" />
</element>
</define>
<define name="annotation">
<doc:p>
This describes an annotation element. It can have any attributes, may
have an id attribute, and contains any number of documentation or appinfo
elements.
</doc:p>
<element name="annotation"
doc:href="http://www.w3.org/TR/xmlschema-1/#element-annotation">
<ref name="openAttrs" />
<optional>
<attribute name="id">
<data type="ID" />
</attribute>
</optional>
<zeroOrMore>
<choice>
<ref name="documentation" />
<ref name="appinfo" />
</choice>
</zeroOrMore>
</element>
</define>
<define name="simpleDerivation">
<doc:p>
This gives the various types of derivation of simple types.
</doc:p>
<choice>
<ref name="simpleRestriction" />
<ref name="list" />
<ref name="union" />
</choice>
</define>
<define name="simpleDerivationSet">
<doc:p>
This specifies the values of the final attribute for simple types. This
RELAX NG schema for XML Schema, like the XML Schema Recommendation, allows
the keywords 'list', 'union' and 'restriction' to appear more than once
within the list.
</doc:p>
<choice>
<value type="token">#all</value>
<list>
<zeroOrMore>
<choice>
<value>list</value>
<value>union</value>
<value>restriction</value>
</choice>
</zeroOrMore>
</list>
</choice>
</define>
<define name="simpleType">
<doc:p>
This gives the basic content of a simple type.
</doc:p>
<ref name="annotated" />
<ref name="simpleDerivation" />
</define>
<define name="topLevelSimpleType">
<doc:p>
This describes a simpleType element as it appears at the top level of the
schema. It has to have a name attribute and may have a final attribute.
</doc:p>
<element name="simpleType"
doc:href="http://www.w3.org/TR/xmlschema-1/#element-simpleType">
<ref name="simpleType" />
<attribute name="name">
<data type="NCName" />
</attribute>
<optional>
<attribute name="final">
<ref name="simpleDerivationSet" />
</attribute>
</optional>
</element>
</define>
<define name="localSimpleType">
<doc:p>
This describes a simpleType element as it appears within an attribute or
element.
</doc:p>
<element name="simpleType"
doc:href="http://www.w3.org/TR/xmlschema-1/#element-simpleType">
<ref name="simpleType" />
</element>
</define>
<define name="rangeFacets">
<doc:p>
This describes the relationship between the various range facets. Only
one of minExclusive and minInclusive can be present, and only one of
maxExclusive and maxInclusive can be present. This is a constraint that
can't easily be expressed using XML Schema. This RELAX NG schema
for XML Schema is a little more restrictive than the XML Schema
Recommendation in that it also forces there to be a maximum of one of
each of these types of facets.
</doc:p>
<interleave>
<optional>
<choice>
<ref name="minExclusive" />
<ref name="minInclusive" />
</choice>
</optional>
<optional>
<choice>
<ref name="maxExclusive" />
<ref name="maxInclusive" />
</choice>
</optional>
</interleave>
</define>
<define name="digitFacets">
<doc:p>
This specifies optional totalDigits and fractionDigits elements. This
RELAX NG schema for XML Schema is a little more restrictive than the XML
Schema Recommendation in that it also forces there to be a maximum of one
of each of these types of facets.
</doc:p>
<optional>
<ref name="totalDigits" />
</optional>
<optional>
<ref name="fractionDigits" />
</optional>
</define>
<define name="lengthFacets">
<doc:p>
This specifies optional length, minLength and maxLength elements. This
RELAX NG schema for XML Schema is a little more restrictive than the XML
Schema Recommendation in that it also forces there to be a maximum of one
of each of these types of facets, and says that if a length element is
given, then neither minLength nor maxLength should be present.
</doc:p>
<choice>
<ref name="length" />
<interleave>
<optional>
<ref name="minLength" />
</optional>
<optional>
<ref name="maxLength" />
</optional>
</interleave>
</choice>
</define>
<define name="commonFacets">
<doc:p>
This specifies zero or more enumeration or pattern elements and an
optional whiteSpace element. This RELAX NG schema for XML Schema is a
little more restrictive than the XML Schema Recommendation in that it
also forces there to be a maximum of one whiteSpace element within the
facets. Note that the whiteSpace facet is constrained to have a value of
'collapse'.
</doc:p>
<zeroOrMore>
<ref name="enumeration" />
</zeroOrMore>
<optional>
<ref name="whiteSpaceCollapse" />
</optional>
<zeroOrMore>
<ref name="pattern" />
</zeroOrMore>
</define>
<define name="simpleRestrictionModel">
<doc:p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -