468,505 Members | 1,728 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,505 developers. It's quick & easy.

how to define min and max number of characters for a complexType?

2
i have my complexType element .have no idea how to set min and max number of characters allowed to use for element "author".

here is my complexType element from schema
Expand|Select|Wrap|Line Numbers
  1. <xsd:element name="author">
  2.  <xsd:complexType>
  3.              <xsd:simpleContent>
  4.               <xsd:extension base="xsd:string">
  5.                <xsd:attribute type="xsd:string" name="gender" use="required"/>
  6.               </xsd:extension>
  7.              </xsd:simpleContent>
  8.             </xsd:complexType>
  9.            </xsd:element>
  10.  
for simpleType i already made this
Expand|Select|Wrap|Line Numbers
  1. <xsd:element name="original_title">
  2.             <xsd:simpleType>
  3.              <xsd:restriction base="xsd:string">
  4.               <xsd:minLength value="3"/>
  5.               <xsd:maxLength value="22"/>
  6.              </xsd:restriction>
  7.             </xsd:simpleType>
  8.            </xsd:element>
  9.  
Nov 6 '12 #1
1 2161
Luuk
1,043 Expert 1GB
(source: http://www.w3schools.com/schema/schema_facets.asp)
This example defines another element called "password" with a restriction. The value must be minimum five characters and maximum eight characters:


Expand|Select|Wrap|Line Numbers
  1.  <xs:element name="password">
  2.   <xs:simpleType>
  3.      <xs:restriction base="xs:string">
  4.        <xs:minLength value="5"/>
  5.        <xs:maxLength value="8"/>
  6.      </xs:restriction>
  7.    </xs:simpleType>
  8. </xs:element>
Nov 10 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

22 posts views Thread by johny smith | last post: by
6 posts views Thread by Nick | last post: by
9 posts views Thread by pozz | last post: by
7 posts views Thread by Peng Yu | last post: by
reply views Thread by NPC403 | last post: by
3 posts views Thread by gieforce | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.