Library tutorials & articles
XSD Schemas for VB Developers
Tighter Validation
<xsd:simpleType name="shipNameType">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="40"/>
</xsd:restriction>
</xsd:simpleType>
Here, you use the <xsd:restriction> element to indicate that this simple type restricts the base type xsd:string. Then you use <xsd:maxLength> to indicate the maximum length of the string. There are other ways you can restrict values, for example you could use patterns to specify that a string must contain valid telephone number in the form (703) 606-1234:
<simpleType name="telType">
<restriction base="string">
<pattern value="\(\d{3}\) \d{3}-\d{4}"/>
</restriction>
</simpleType>
You can also restrict the values of numbers by specifying valid ranges. For example, to restrict the Quantity between 1 and 100 you’d write:
<xsd:simpleType name="quantityType">
<xsd:restriction base="xsd:short">
<xsd:minInclusive value="1"/>
<xsd:maxInclusive value="100"/>
</xsd:restriction>
</xsd:simpleType>
Related articles
Related discussion
-
handling special character in xslt's
by bussureddy82 (1 replies)
-
Need help in parsing a big XML file with JAVA
by praveen_a_p (0 replies)
-
XML WITH JAVA
by suzan4love (3 replies)
-
A simple way to read an XML file in Java
by ayf (32 replies)
-
how to bind the XML data to the textboxes
by Slicksim (1 replies)
Related podcasts
-
Java Posse #202 - Newscast for Aug 22nd 2008
Newcast for August 22nd, 2008Fully formatted shownotes can always be found at http://javaposse.com Sadly, Java does not run on the Mars LanderThe Golden Gate Project http://research.sun.com/projects/goldengate/Space surveillance radar http://www.sun.com/aboutsun/pr/2008-04/sunflash Google has r...
Related jobs
-
Microsoft .Net Architect
in AMSTERDAM (€50K-€90K per annum) -
Trainer JAVA
in AMSTERDAM (€50K-€90K per annum) -
Applicatie ontwikkelaar binnen Defensie
in Amsterdam (£50K-£90K per annum) -
Ervaren SAP XI Specialist
in Amsterdam (€50K-€90K per annum)
This thread is for discussions of XSD Schemas for VB Developers.