ISSUE-97: proposed set of new patterns

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

ISSUE-97: proposed set of new patterns

SWD Issue Tracker


ISSUE-97: proposed set of new patterns

http://www.w3.org/2005/06/tracker/databinding/issues/97

Raised by: Vladislav Bezrukov
On product: Advanced

I have checked some schemas SAP makes publicly available (their upload follows)
and prepared the following patterns that we use in them.

[NEW] pattern SimpleTypeRestrictionEnumeration
//xs:simpleType/xs:restriction/xs:enumeration

Example
<xs:simpleType name="SeverityCode">
  <xs:restriction base="xs:token">
    <xs:enumeration value="1" />
    <xs:enumeration value="2" />
    <xs:enumeration value="3" />
  </xs:restriction>
</xs:simpleType>

[NEW] pattern
//xs:simpleType/xs:restriction/xs:pattern

Example
<xs:simpleType name="Date">
  <xs:restriction base="xs:date">
    <xs:pattern value="[^-]{4}-[^-]{2}-[^-]{2}" />
  </xs:restriction>
</xs:simpleType>

[NEW] pattern AppinfoSource
//xs:appInfo/@source

Example
<xs:appinfo
source="http://sap.com/xi/TextID">43b0511143e611dba99e003005470d3c</xs:appinfo>

[NEW] RestrictedStringLength
//xs:simpleType/xs:restriction/xs:length

<xs:simpleType name="LanguageCode">
  <xs:restriction base="xs:language">
    <xs:length value="2" />
  </xs:restriction>
</xs:simpleType>

[NEW] pattern SimpleTypeRestrictionMaxInclusive
/xs:simpleType/xs:restriction/xs:maxInclusive

Example
<xs:simpleType>
  <xs:restriction base="xs:integer">
    <xs:maxInclusive value="3" />
  </xs:restriction>
</xs:simpleType>


[NEW] pattern SimpleTypeRestrictionMinInclusive
/xs:simpleType/xs:restriction/xs:minInclusive

Example
<xs:simpleType>
  <xs:restriction base="xs:integer">
    <xs:minInclusive value="1" />
  </xs:restriction>
</xs:simpleType>