⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xmlschema.rng

📁 xml 组建工程 不多说说 很都功能 就是懒得整理
💻 RNG
📖 第 1 页 / 共 4 页
字号:
    This specifies the types of facets that are valid in restrictions on the 
    built-in data types.  This can only perform rudimentary checking, but 
    should be enough in most circumstances.  Note that for xs:anySimpleType 
    and xs:string, the whiteSpace facet can take any value, for 
    xs:normalizedString it can be 'replace' or 'collapse', and for all other 
    built-in types it has to be 'collapse'.
  </doc:p>
  <choice>
    <group>
      <attribute name="base">
        <value type="QName">xs:anySimpleType</value>
      </attribute>
      <interleave>
        <ref name="rangeFacets" />
        <ref name="digitFacets" />
        <ref name="lengthFacets" />
        <optional>
          <ref name="whiteSpace" />
        </optional>
        <zeroOrMore>
          <ref name="enumeration" />
        </zeroOrMore>
        <zeroOrMore>
          <ref name="pattern" />
        </zeroOrMore>
      </interleave>
    </group>
    <group>
      <attribute name="base">
        <value type="QName">xs:string</value>
      </attribute>
      <interleave>
        <ref name="lengthFacets" />
        <optional>
          <ref name="whiteSpace" />
        </optional>
        <zeroOrMore>
          <ref name="enumeration" />
        </zeroOrMore>
        <zeroOrMore>
          <ref name="pattern" />
        </zeroOrMore>
      </interleave>
    </group>
    <group>
      <attribute name="base">
        <choice>
          <value type="QName">xs:normalizedString</value>
        </choice>
      </attribute>
      <interleave>
        <ref name="lengthFacets" />
        <optional>
          <ref name="whiteSpaceReplaceOrCollapse" />
        </optional>
        <zeroOrMore>
          <ref name="enumeration" />
        </zeroOrMore>
        <zeroOrMore>
          <ref name="pattern" />
        </zeroOrMore>
      </interleave>
    </group>
    <group>
      <attribute name="base">
        <choice>
          <value type="QName">xs:token</value>
          <value type="QName">xs:language</value>
          <value type="QName">xs:Name</value>
          <value type="QName">xs:NCName</value>
          <value type="QName">xs:ID</value>
          <value type="QName">xs:IDREF</value>
          <value type="QName">xs:IDREFS</value>
          <value type="QName">xs:NMTOKEN</value>
          <value type="QName">xs:NMTOKENS</value>
          <value type="QName">xs:ENTITY</value>
          <value type="QName">xs:ENTITIES</value>
          <value type="QName">xs:hexBinary</value>
          <value type="QName">xs:base64Binary</value>
          <value type="QName">xs:anyURI</value>
          <value type="QName">xs:QName</value>
          <value type="QName">xs:NOTATION</value>
        </choice>
      </attribute>
      <interleave>
        <ref name="lengthFacets" />
        <ref name="commonFacets" />
      </interleave>
    </group>
    <group>
      <attribute name="base">
        <value type="QName">xs:boolean</value>
      </attribute>
      <interleave>
        <optional>
          <ref name="whiteSpaceCollapse" />
        </optional>
        <zeroOrMore>
          <ref name="pattern" />
        </zeroOrMore>
      </interleave>
    </group>
    <group>
      <attribute name="base">
        <choice>
          <value type="QName">xs:decimal</value>
          <value type="QName">xs:integer</value>
          <value type="QName">xs:nonPositiveInteger</value>
          <value type="QName">xs:nonNegativeInteger</value>
          <value type="QName">xs:positiveInteger</value>
          <value type="QName">xs:negativeInteger</value>
          <value type="QName">xs:unsignedLong</value>
          <value type="QName">xs:unsignedInt</value>
          <value type="QName">xs:unsignedShort</value>
          <value type="QName">xs:unsignedByte</value>
          <value type="QName">xs:long</value>
          <value type="QName">xs:int</value>
          <value type="QName">xs:short</value>
          <value type="QName">xs:byte</value>
        </choice>
      </attribute>
      <interleave>
        <ref name="digitFacets" />
        <ref name="rangeFacets" />
        <ref name="commonFacets" />
      </interleave>
    </group>
    <group>
      <attribute name="base">
        <choice>
          <value type="QName">xs:float</value>
          <value type="QName">xs:double</value>
          <value type="QName">xs:duration</value>
          <value type="QName">xs:dateTime</value>
          <value type="QName">xs:time</value>
          <value type="QName">xs:date</value>
          <value type="QName">xs:gYearMonth</value>
          <value type="QName">xs:gYear</value>
          <value type="QName">xs:gMonthDay</value>
          <value type="QName">xs:gMonth</value>
          <value type="QName">xs:gDay</value>
        </choice>
      </attribute>
      <interleave>
        <ref name="rangeFacets" />
        <ref name="commonFacets" />
      </interleave>
    </group>
    <!-- the detailed checking above is superfluous
        until there's a way to do 'difference'
        within attribute values, because it will
        always match the following -->
    <group>
      <choice>
        <attribute name="base">
          <data type="QName" />
        </attribute>
        <ref name="localSimpleType" />
      </choice>
      <interleave>
        <ref name="rangeFacets" />
        <ref name="digitFacets" />
        <ref name="lengthFacets" />
        <optional>
          <ref name="whiteSpace" />
        </optional>
        <zeroOrMore>
          <ref name="enumeration" />
        </zeroOrMore>
        <zeroOrMore>
          <ref name="pattern" />
        </zeroOrMore>
      </interleave>
    </group>
  </choice>
</define>

<define name="list">
  <doc:p>
    This describes a list element.  It can either specify a local simple type 
    or have a itemType attribute.  This constraint cannot be expressed in XML 
    Schema.
  </doc:p>
  <element name="list"
        doc:href="http://www.w3.org/TR/xmlschema-1/#element-list">
    <ref name="annotated" />
    <choice>      
      <ref name="localSimpleType" />
      <attribute name="itemType">
        <data type="QName" />
      </attribute>
    </choice>
  </element>
</define>

<define name="union">
  <doc:p>
    This describes a union element.  If the memberTypes attribute is missing 
    or empty, then it must contain one or more simpleType elements; if 
    it&apos;s present, then it can contain simpleType elements or list simple 
    types in the memberTypes attribute.  This constraint cannot be expressed 
    in XML Schema.
  </doc:p>
  <element name="union"
        doc:href="http://www.w3.org/TR/xmlschema-1/#element-union">
    <ref name="annotated" />
    <choice>
      <group>
        <attribute name="memberTypes">
          <list>
            <oneOrMore>
              <data type="QName" />
            </oneOrMore>
          </list>
        </attribute>
        <zeroOrMore>
          <ref name="localSimpleType" />
        </zeroOrMore>
      </group>
      <group>
        <optional>
          <attribute name="memberTypes">
            <empty />
          </attribute>
        </optional>
        <oneOrMore>
          <ref name="localSimpleType" />
        </oneOrMore>
      </group>
    </choice>
  </element>
</define>

<define name="facet">
  <doc:p>
    This is the basic content of a facet.  It has an optional fixed attribute.
  </doc:p>
  <ref name="annotated" />
  <optional>
    <attribute name="fixed">
      <data type="boolean" />
    </attribute>
  </optional>
</define>

<define name="noFixedFacet">
  <doc:p>
    This is the content of a facet that cannot be fixed (enumeration or 
    pattern).  It has a value attribute that can take any kind of value.
  </doc:p>
  <ref name="annotated" />
  <attribute name="value" />
</define>

<define name="rangeFacet">
  <doc:p>
    This is the content of a range facet.  The value must be one of the data 
    types shown (as these are the only types of data that accept ranges).  I 
    haven&apos;t gone so far as to indicate the data type of the value 
    attribute of a range facet according to the base type as this would be 
    very complicated (although it would be possible in RELAX NG).
  </doc:p>
  <ref name="facet" />
  <attribute name="value">
    <choice>
      <data type="decimal" />
      <data type="float" />
      <data type="double" />
      <data type="duration" />
      <data type="dateTime" />
      <data type="time" />
      <data type="date" />
      <data type="gYearMonth" />
      <data type="gYear" />
      <data type="gMonthDay" />
      <data type="gMonth" />
      <data type="gDay" />
    </choice>
  </attribute>
</define>

<define name="minExclusive">
  <doc:p>
    This describes a minExclusive element.
  </doc:p>
  <element name="minExclusive"
        doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-minExclusive">
    <ref name="rangeFacet" />
  </element>
</define>

<define name="minInclusive">
  <doc:p>
    This describes a minInclusive element.
  </doc:p>
  <element name="minInclusive"
        doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-minInclusive">
    <ref name="rangeFacet" />
  </element>
</define>

<define name="maxExclusive">
  <doc:p>
    This describes a maxExclusive element.
  </doc:p>
  <element name="maxExclusive"
        doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-maxExclusive">
    <ref name="rangeFacet" />
  </element>
</define>

<define name="maxInclusive">
  <doc:p>
    This describes a maxInclusive element.
  </doc:p>
  <element name="maxInclusive"
        doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-maxInclusive">
    <ref name="rangeFacet" />
  </element>
</define>

<define name="numFacet">
  <doc:p>
    This is the content of a numerical facet.
  </doc:p>
  <ref name="facet" />
  <attribute name="value">
    <data type="nonNegativeInteger" />
  </attribute>
</define>

<define name="totalDigits">
  <doc:p>
    This describes a totalDigits element.  The value attribute must take a 
    positive integer.
  </doc:p>
  <element name="totalDigits"
        doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-totalDigits">
    <ref name="facet" />
    <attribute name="value">
      <data type="positiveInteger" />
    </attribute>
  </element>
</define>

<define name="fractionDigits">
  <doc:p>
    This describes a fractionDigits element.
  </doc:p>
  <element name="fractionDigits"
        doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-fractionDigits">
    <ref name="numFacet" />
  </element>
</define>

<define name="length">
  <doc:p>
    This describes a length element.
  </doc:p>
  <element name="length"
        doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-length">
    <ref name="numFacet" />
  </element>
</define>

<define name="minLength">
  <doc:p>
    This describes a minLength element.
  </doc:p>
  <element name="minLength"
        doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-minLength">
    <ref name="numFacet" />
  </element>
</define>

<define name="maxLength">
  <doc:p>
    This describes a maxLength element.
  </doc:p>
  <element name="maxLength"
        doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-maxLength">
    <ref name="numFacet" />
  </element>
</define>

<define name="enumeration">
  <doc:p>
    This describes an enumeration element.
  </doc:p>
  <element name="enumeration"
        doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-enumeration">
    <ref name="noFixedFacet" />
  </element>
</define>

<define name="whiteSpace">
  <doc:p>
    This describes a whiteSpace element that can take any of the permitted 
    values.
  </doc:p>
  <element name="whiteSpace"
        doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-whiteSpace">
    <ref name="facet" />
    <attribute name="value">
      <choice>
        <value type="token">preserve</value>
        <value type="token">replace</value>
        <value type="token">collapse</value>
      </choice>
    </attribute>
  </element>
</define>

<define name="whiteSpaceReplaceOrCollapse">
  <doc:p>
    This describes a whiteSpace element that can only take the values 
    'replace' or 'collapse'.
  </doc:p>
  <element name="whiteSpace"
        doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-whiteSpace">
    <ref name="facet" />
    <attribute name="value">
      <choice>
        <value type="token">replace</value>
        <value type="token">collapse</value>
      </choice>
    </attribute>
  </element>
</define>

<define name="whiteSpaceCollapse">
  <doc:p>
    This describes a whiteSpace element that can only take the value 
    'collapse'.
  </doc:p>
  <element name="whiteSpace"
        doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-whiteSpace">
    <ref name="facet" />
    <attribute name="value">
      <value type="token">collapse</value>
    </attribute>
  </element>
</define>

<define name="pattern">
  <doc:p>
    This describes a pattern element.
  </doc:p>
  <element name="pattern"
        doc:href="http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#element-pattern">
    <ref name="noFixedFacet" />
  </element>
</define>

</grammar>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -