[XSD Learning]xsd element qualification

Source: Internet
Author: User

Qualification (restriction) is used to define acceptable values for an XML element or attribute

The main qualifying format for XSD is as follows:

<xs:elementname= "XXX"><!--element name -    <Xs:simpletype>      <xs:restrictionBase= "yyy"><!--element Type -        <!---Fill in the limited content here -      </xs:restriction>    </Xs:simpletype></xs:element> 

Second, the limited way

The limitation of XSD is mainly by the following way

1, for shaping, use element mininclusive limit, use maxinclusive limit limit

2, using the enumeration element enumeration, the qualified element can only take fixed value

3, using the element pattern regular expression, carries on the element check, the format is: <xs:pattern value= "([a-z][a-z]) +"/>

4. Use element Pattern,value as "|" Split, as only one can be selected from, in the format: <xs:pattern value= "Male|female" >

5, the length of the limit, the use of elements: Length,minlength,maxlength three elements

6, using the element withespace processing space, the value preserve to not handle the space, replace replaces the space, collapse compressed space, replaces other empty characters with spaces, and multiple spaces replaced by a

[XSD Learning]xsd element qualification

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.