Schema

Definition:
Describe and validate data
communicate structure to applications and people
constrain element content
provide default attribute values
XML based syntax -- you can use all the XML tools in schemas: DOM, SAX,XSLT, and transform or contruct shemas on the fly using DOM orXSLT
Support NAMESPACES and multiple schema references for each XML document
derive your own datatypes
Allow inheritance
data-types (like string, byte, etc)
import and export data from a database

 

escape characters

Unicode specs --Character References

  • used to substitute characters that violate the syntax rules (like the & character) in your tags
  • save as *.xsd file
    linking to page: xml links xpath
    if you do not have a default namespace: <?xml version="1.0" ?>
    <schema>
    <element name="b" type="string" /> -- this is the bold tag for html and can be declared
    </schema>
    Namespaces Another place to simultaneously define your tags
    XML reference to tell our xml where to look for it's definitions:
    primary components
    typecasting your elements and attributes can be identifies as many basic programming types
    using the "type" built-in attribute
    A list of the actual types
    complex typecasting set up your own objects
    element declarations setting up your basic data
    attribute declarations define and control your data
    secondary components extend complex types
    Helper components cannot be named or independently accessed, xsd built-in attributes to use in your schema

     

    Attributes
    Built-In Attributes Defines and controls the elements and attributes in the Schema
    Use with Your attributes AND elements
    Can use built in attributes in the schema (not in the XML)
    Example
    <element name="price" type="decimal" />
    Your Own Attributes Use to define your data in the XML
    Use with Your elements
    Your own made-up attributes must be declared in a complex type
    List at the END of your complex type

     

     

    Helper Components
    Example

    In XML
    <element name="myName" type="xsl:string">

    In Schema
    <element name="myElement">
    <attribute name="myAttribute" />
    </element>

    name any name you give it
    Example
    <element name="myName">
    type see typecasting, above
    Example
    <element name="myName" type="xsl:string" />
    minOccurs/maxOccurs define number of times an element can occur
    Example
    <element name="myName" minOccurs="1" maxOccurs="1" />
    <element name="myName" minOccurs="0" maxOccurs="1" />
    <element name="myName" minOccurs="1" maxOccurs="unbounded" />
    <element name="myName" minOccurs="1" maxOccurs="unbounded" />
    value sets the default value for an element or attribute
    Example
    <element name="myName" value="inStock">
    <attribute name="myName" value="inWarehouse" / >
    </element>
    use required  
    Example
    <element name="myName" use="xsd:required" / >
    fixed
    Example
      <element name="myName" use="xsd:fixed" />
    implied
    Example
      <element name="myName" use="xsd:implied" / >
    prohibited 
    Example
    <element name="myName" use="xsd:prohibited" fixed="weekSpecial" /> (won't use this attribute on the XML)
    fixed sets the value of an attribute or an element, and can't change it in your XML, or this node could be empty in your XML data
    default sets the default value of an attribute or element, but you can change it in XML
    nillable either "true" or "false", means that the tag has a null value, explained in identity constraints
    restriction Negates the type you specify
    memberTypes used with a union
    itemType used with list
    group used in elements to group elements together
    complexContent Used in
    All used in unnamed complex types, specifies that those elements only appear in this group
          has to be at the top level of that content model
    used in a named model group to restrict those elements to only that group
    Choice used in unnamed complex types, specifies the choices of elements
    used in a named model group to specifiy the choices of elements
    Sequence used in unnamed complex types, specifies the order those elements are allowed to appear
    used in a named model group to specify the order those elements are allowed to appear
    Attribute Group groups a bunch of attributes together
    system identifies what viewer you would use in a notation
    public allows network access to documents
    extension  
    base  
    key sets up primary key in an xml data , see identity constraints
    keyref foreign key in your xml data , see identity constraints
    unique allows you to set up unique keys for relational databases, see identity constraints
    xpath retrieves the range of elements or attributes needed
    selector selects the xml tag that your are going to need
    field identifies the child node for our query
    annotation sets up documentation and appInfo for the schema, see identity constraints
    documentation sets up comments to describe the application being accessed, see identity constraints
    appInfo a processing instruction -- passes information to a processing application, see identity constraints
    User-Derived Types you set these types up yourself, limited by the base type you set it up from
    enumeration this is a user-derived type, allows you to choose from a set list of allowable values
    pattern this is a user-derived type, allows you to look for an allowable pattern in the value of the attribute or element
    whiteSpace this is a user-derived type, allows you to set up the whitespace
    minInclusive, maxInclusive this is a user-derived type, allows you to set up a range of values allowed
    minExclusive, maxExclusive this is a user-derived type, allows you to set up a range of values allowed
    totalDigits, fractionDigits this is a user-derived type, allows you to limit the total number of digits or decimals allowed in your number

     

    Elements
    Simple Elements Contains none of your own attributes or child elements
    In XML the element can be empty or have text
    In XML, the empty example:
    <element name="myelement" />
    In XML, with text example:
    <element name="myelement">Here is my text with &amp; (properly escaped illegal characters)</element>
    Name is a built-in attribute, you can add all the built-in attributes listed
    These define and control many parameters of your element
    Complex Elements Can use child elements and attributes that you define
    Create your own objects
    Control the order and parameters of every attribute and element

     

    Simple Element
    element Contains no child elements
    define number of times an element can occur <xsd:element name="dateReceived" type="xsd:date" minOccurs="0" maxOccurs="1" />

    [none] zero or one time occuring
    minOccurs="1" maxOccurs="1" ? one and only once
    minOccurs="0" maxOccurs="unbounded" * zero or more
    minOccurs="1" maxOccurs="unbounded" +  
    Attributes Built-in attributes describe and define your element
    Can use built in attributes in the schema (not in the XML)
    Derived from Simple Type enumeration can be any number of occurances, including 0
    only has that element, no text inside of it (elementOnly)
    Example
    <element name="price" type="decimal">
    <simpleType base="string">
    <enumeration value="cost" />
    <enumeration value="sale" />
    <enumeration value="retail" />
    <enumeration value="starting" />
    </simpleType>
    </element>
    list
  • element type is "nmtokens" -- no text, either
  • Value is "S M L XL" (no commas - just spaces)
    • S would be it's own value
    • L would be it's own, also
  • Make sure your lists don't contain whitespaces within each token's name
  • cannot be derived from another listtype or complex type
  • Example:
    • In XML
           <listFromMyList>1 5 6 19</listFromMyList>
      In schema
           <xsd:simpleType name="listFromMyList"> (new object, new name)
           <xsd:list itemType= "myList" />
           </xsd:simpleType>
    union
    • Allows element content or attribute values to be a union of different atomic or list types
    • Make sure your lists don't contain whitespaces
    • cannot be derived from another listtype or complex type
    • Example:
      In XML (2 separate lists)
           <listFromColor>red blue yellow green</listFromColor>
           <listFromSize>s m l xl</listFromSize>

      In schema
           <xsd:simpleType name="listFromColor">
           <xsd:list itemType= "Color" />
           </xsd:simpleType>

        <xsd:simpleType name="listFromSize">
           <xsd:list itemType= "Size" />
           </xsd:simpleType>

      With union
           <xsd:simpleType name="choicesUnion">
           <xsd:list memberTypes= "Color Size" />
           </xsd:simpleType>

      In XML, now
           <choicesUnion />

     

     

    Complex Types
    Attribute to a complex type complex types hold attributes. - must declare as a complexType, or no declaration for simpleType - at all

    <xsd:element name="invoice">
    <xsd:complexType>
    <attribute name="paid" use="optional" default="false" type="NMTOKEN" />
    </xsd:complexType>
    </xsd:element>

    In XML:
    <invoice paid="true">j3354</invoice>
    or:
    <invoice>j3354</invoice> (paid will now equal false)

    If we wanted to use this attribute many times: declare this on it's own line

    <attribute name="paid" use="optional" default="false" type="NMTOKEN" />

    Later, refer to it in another element
    <xsd:element name="invoice">
    <xsd:complexType>
    <attribute ref="paid" />
    </xsd:complexType>
    </xsd:element>

    In XML:
    <invoice paid="true">j3354</invoice>
    or:
    <invoice>j3354</invoice> (paid will now equal false)

    mixed elements define whether items appear
    <element name="advertisement" content="mixed">
    <element name="ad_sentence" content="mixed">
    <element ref="b" minOccurs="0" />
    </element>
    </element>

    In XML:
    <advertisement>Get your newest releases here!<ad_sentence><b>And Today....</b></ad_sentence </advertisement>

    ref previously defined elements, used within another element

    <element name="short_desc" type="string"/>
    <element name="product_desc" type="string"/>
    <element name="price" type="decimal"/>

    <element name="suite" content="elementOnly">
    <element ref="short_desc" minOccurs="0" maxOccurs="unbounded"/>
    <element ref="price"/>
    <element ref="product_desc"/>
    </element>

    In XML:
    <suite short_desc="Broyhill Masterpiece" short_desc="This month's special" price="159.99" product_desc="Purple laminated, with 5 separate pieces" />

    content elementOnly -- no text
    mixed -- contains elements and/or text, and/or attributes
    Unnamed complex Type

    sequence
    define the order items appear
    <xsd:complexType name="address">
    <xsd:sequence>
    <xsd:element name="street1" />
    <xsd:element name="street2" />
    <xsd:element name="city" />
    <xsd:element name="state" />
    <xsd:element name="zip" />
    </xsd:sequence>
    </xsd:complexType>

    <xsd:element name="mailingAddress" type="address" />
    <xsd:element name="billingAddress" type="address" />


    In XML:
    <mailingAddress>
    <street1>xxx</street1>
    <street2>xxx</street2>
    <city>xxx</city>
    <state>xxx</state>
    <zip>xxx</zip>
    </mailingAddress>
    Unnamed complex Type

    choice
    Cannot use this type by itself in our XML - just the choices inside the type
    Does not have the "element" identifier as the root node

    <xsd:complexType name="products" content="elementOnly" >(no text, just elements here)
    <xsd:choice maxOccurs="unbounded">(can be any number of occurances, including 0)
    <element ref="vendor" />
    <element ref="special" />
    </choice>
    </complexType>

    In XML:
    <vendor>Broyhill</vendor>

    Named complex type Allows us to use this complex type by itself in our xml, in addition to using it within another complex type
    Has the "element" identifier as the root node

    <xsd:element name="address">
    <xsd:complexType>

    <xsd:sequence>
    <xsd:element name="street1" />
    <xsd:element name="street2" />
    <xsd:element name="city" />
    <xsd:element name="state" />
    <xsd:element name="zip" />
    </xsd:sequence>
    </xsd:complexType>
    <xsd:element>

    And, in XML:
    <address>
    <street1>xxx</street1>
    <street2>xxx</street2>
    <city>xxx</city>
    <state>xxx</state>
    <zip>xxx</zip>
    </address>

    Complex Type Example:

    <?xml version ="1.0" ?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    <xsd:element name="contactDetails">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element ref="contact" minOccurs="1" maxOccurs="unbounded" />
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>

      <xsd:element name="contact">
      <xsd:complexType>
      <xsd:sequence>
      <xsd:element name="firstName" />
      <xsd:element name="middleInitial" minOccurs="1" maxOccurs="unbounded" />
      <xsd:element name="lastName" />
      </xsd:sequence>
      </xsd:complexType>
      <xsd:element name="mailingAddress" type="address" />
      <xsd:element name="billingAddress" type="address" />
      </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>

    <xsd:complexType name="address">
    <xsd:sequence>
    <xsd:element name="street1" />
    <xsd:element name="street2" />
    <xsd:element name="city" />
    <xsd:element name="state" />
    <xsd:element name="zip" />
    </xsd:sequence>
    </xsd:complexType>

    In XML:
    <contact>
    <firstName><firstName>
    <middleInitial><middleInitial>
    <middleInitial><middleInitial>
    <lastName><lastName>
    <mailingAddress>
    <street1>xxx</street1>
    <street2>xxx</street2>
    <city>xxx</city>
    <state>xxx</state>
    <zip>xxx</zip>
    </mailingAddress>
    <billingAddress>
    <street1>xxx</street1>
    <street2>xxx</street2>
    <city>xxx</city>
    <state>xxx</state>
    <zip>xxx</zip>
    </billingAddress>
    <contact>

    Extend a complex typeNOTCHECKED

    <xsd:element name="addressTime">
    <xsd:complexType>
    <xsd:complexContent>
    <xsd:extension base="addressType"> (new extension, new name)
    <xsd:attribute name="residentFrom" type="xsd:date" />
    <xsd:attribute name="residentTo" type="xsd:date" />
    </xsd:extension>
    </xsd:complexContent>
    </xsd:complexType>
    </xsd:element>

    And, in XML (of the complex type above with the extension):
    <contact>
    <firstName>xxx<firstName>
    <middleInitial>x<middleInitial>
    <middleInitial>x<middleInitial>
    <lastName>x<lastName>
    <mailingAddress>
    <street1>xxx</street1>
    <street2>xxx</street2>
    <city>xxx</city>
    <state>xxx</state>
    <zip>xxx</zip>
    </mailingAddress>
    <billingAddress>
    <addressTime residentFrom="01-22-1955" residentTo="05-05-2001 >xx</addressTime>
    <street1>xxx</street1>
    <street2>xxx</street2>
    <city>xxx</city>
    <state>xxx</state>
    <zip>xxx</zip>
    </billingAddress>
    </contact>

    Empty This type can ONLY carry attributes, no child elements or text
    <xsd:element name="product">
    <xsd:complexType>
    <xsd:complexContent>
    <xsd:restriction base="xsd:AnyType" />

    <xsd:attribute name="productID" use="required" type="xsd:id" />
    <xsd:attribute name="name" use="required" type="xsd:string" />
    </xsd:restriction>
    </xsd:complexContent>
    </xsd:complexType>
    </xsd:element>
    ElementOnly only child elements are included in your element, no text
    <element name="item" content="elementOnly">
    <element ref="product_desc"/>
    <element ref="price" minOccurs="0" maxOccurs="unbounded"/>
    </element>
    mixedType contains text and child elements in the XML

    Easy example

    <element name="advertisement" content="mixed">
    <element name="ad_sentence" content="mixed">
    <element ref="b" minOccurs="0" />
    <element ref="i" minOccurs="0" />
    <element ref="p" minOccurs="0" />
    </element>
    </element>

    In Schema

    <xsd:element name="autoResponse">
    <xsd:complexType mixed="true">
    <xsd:sequence>
    <xsd:element name="header" />
    <xsd:element name="queryDetails" />
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="custID" type="xsd:number" />
    <xsd:element name="orderID" type="xsd:number" />
    </xsd:sequence>
    </xsd:complexType>
    <xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:element>

    In XML
    <autoResponse>
    <header>Thank you for visitng my store!</header>
    <queryDetails>
    For reference, your Customer ID is
    <custID>xxx</custID>
    And your Order ID is
    <orderID>xxx</orderID>
    Please visit us again
    </queryDetails>
    </autoResponse>

     

    Typecasting
    Example
    <element name="myName" type="xsl:string" />
    string basic problem characters need to be escaped see: string literals or Unicode
    normalized strings do not contain carriage return, tabs, or linefeed (i.e. these are also escaped see: string literals or Unicode)
    numeric types boolean true, false, 1, 0
    byte -127 to 127
    int -2.5 0E7 to +2.5 OE7
    short int which is derived from long, -3.5 0E7 to +3.5 OE7
    number 18 decimal places
    long -9.2 0E19 to +9.2 0E19
    nonNegative Integer includes zero
    negativeInteger not including zero
    positiveInteger an integer of 1 or higher
    decimal  
    float -1E4. 4.5E-2, NaN (means not a number) (32 bit floating point type)
    double (64 bit floating point type)
    unsignedShort/unsignedLong 0 and 1.8 0E20 (or 0E7 for short)
    unsignedByte 0 and 255
    unsignedInt 0 and 4.2 0E10
    hexBinary arbitrary hex-encoded binary data
    base64Binary any Base-64 encoded binary data
    time-related types timeInstant  
    timeperiod  
    century  
    recurringDate  
    recurringDay  
    duration PnYnMnDTnHnMnS
    P1Y0M1DT20:25:30
    Means:
         P must be present
         nY number of years (1 year)
         nM number of months (0 months)
         nD number of days (1 day)
         T is the time separator
         20 hours, 25 minutes, 30 seconds
    PnYnMnDTnHnMnS
    PnYnMnDTnHnMnS
    recurringDuration  
    date YYYY-MM-DD, cannot be split up
    time HH:MM:SS
    datetime CCYY-MM-DD-Thh:mm:ss
         T is the time separator, then no space to hours (hh)
    gYearMonth CCYY-MM
    gYear CCYY
    gMonthDay MM-DD
    gDay DD
    gMonth MM
    tokenized types id  
    idref  
    idrefs  
    entity derived from ncName
    entities  
    nmtoken nmtoken can only use certain defined types
    nmtokens same nmtokens as DTD
    Example:
         small medium large (just a space between)

    <element name="inventory" type="integer">
    <attribute name="location" type="NMTOKEN" use="default" value="warehouse" />
    </element>
    notation should not appear directly in the schema, only for deriving other data-types by specifying a value for enumeration which can be used in the schema
    anyURI value can be absolute or relative, may have a fragment identifier (so it could be a URI reference)
    URI information
    qName any XML namespace
    Example:
         xsd:element
    token tokenized strings, it is a normalized string, plus, no leading or trailing spaces, or more than two spaces in a row
    language xml:lang definitions
    name any XML name
    Example:
    <element name="address">
    ncName a qName without the prefix and colon ("http:")
    Content Types simpleType create new types from this type (see 3 examples, below)
    contains NO other elements or attributes
    complexType create your own type
    anyType this is the default type
    elementOnly only child elements are included in your element, no text
    Empty This type can ONLY carry attributes, no child elements or text
    mixedType allows elements to include text and child elements
    It is a complex type

     

    Secondary Components
    Create a group element must be declared as a top-level schema component -- a child of the schema element
    attribute groups groups attributes together

    Example:

    Refer to our group:
    <xsd:element name="product">If a named element, include the element in your XML
    <xsd:complexType>
    <xsd:attributeGroup ref="productDetails" />
    </xsd:complexType>
    </xsd:element>

    Now, our attributeGroup
    <xsd:attributeGroup name="productDetails"> This group is not a named element, don't include the "productDetails" in XML
    <xsd:attribute name = "productID" use="required" type="xsd:id" / >
    <xsd:attribute name = "name" use="required" type="xsd:string" / >
    <xsd:attribute name = "description" use="required" type="xsd:string" / >
    <xsd:attribute name = "unit" use="required" type="xsd:positiveInteger" / >
    <xsd:attribute name = "price" use="required" type="xsd:decimal" / >
    <xsd:attribute name = "location" use="implied" type="xsd:nmtoken" default="warehouse" / >
    </xsd:attributeGroup>

    In XML:
    <product productID="g555" name="fish" description="whole salmon" unit="44" price="5.99" >

    model group definitions groups elements together

    can consist of

    • element declarations
    • wildcards
    • other model groups

    Choice

    Example:

    <xsd:group name="mealOptions"> Not a named element, just include the choices, not "mealOptions" in XML
    <xsd:choice>
    <xsd:element name="fish" type="meal" />
    <xsd:element name="meat" type="meal" />
    <xsd:element name="vegetarian" type="meal" />
    </xsd:choice>
    </xsd:group>

    Now, to refer to our group:
    <xsd:element name="dinner">
    <xsd:sequence>
    <xsd:element ref="name" />
    <xsd:group ref="mealOptions" />
    </xsd:sequence>
    </xsd:element>

    In XML: ?????????
    <dinner>
    <name firstName="Janet" lastName="Hancock" />
    <fish />
    </dinner>

    All only be used within that group

    Example:

    <xsd:group name="creditCardInfo">
    <xsd:all>
    <xsd:element name="cardType" />
    <xsd:element name="cardHolderName" />
    <xsd:element name="cardNumber" />
    <xsd:element name="cardExpireDate" />
    </xsd:all>
    </xsd:group>

    identity constraints they specify a relationship between any attribute, element and it's content or value, even from a combination of element and attribute content. And it allows you to specify the scope where the constraints apply

    All these elements and attributes that you set up are going to be required nodes in you schema, if their corresponding element is used
    unique allows you to say that the value of the attribute or content of an element should be unique
    <xsd:unique name="uniqueID">
    <xsd:selector xpath="tc:product/" />selector sets up the xml tag that we need to look at for our query
    <xsd:field xpath="tc:@productID" />selector sets up the node that we need to designate for a unique value
    <xsd:selector xpath="tc:order/" />
    <xsd:field xpath="tc:@productID" />here we set up our next unique value
    <xsd:selector xpath="tc:customers/" />now, we are getting two ids from a complex element
    <xsd:field xpath="tc:tradeCustomer/@custID" />
    <xsd:selector xpath="tc:publicCustomer/@custID" />
    </xsd:unique>
    key primary key, allows you to set up the realtionship between any attribute and any element's content or value
    <xsd:key name="customerID" >
    <xsd:selector xpath="tc:salesData/" />
    <xsd:field xpath="tc:customer/@custID" />
    </xsd:key>

    <xsd:keyref name="item" refer="customerID" />
    <xsd:selector xpath="tc:salesData/" />
    <xsd:field xpath="tc:invoice/@invoiceID" />
    </xsd:keyref>
    keyref foreign key , reference the key that you already set up
    <xsd:element name="cardType" />
    <xsd:element name="cardHolderName" />
    <xsd:element name="cardNumber" />
    <xsd:element name="cardExpireDate" />
    </xsd:all>
    </xsd:group>
    nillable
  • allows null values in relational databases
  • takes a boolean
  • that default is false
  • indicates that an empty element is required if there is no element content
  • you will need a namespace reference to the xsi definitions in your XML
  • In Schema
    <element name="middleName" nillable="true" />

    In XML
    <middleName xsi:nill="true"><middleName/>

    annotation Sets up the application used.

    documentation

    <xsd:annotation>
    <xsd:documentation xml:lang="en">
    This application will be checking the validity of the credit card.
    </xsd:documentation>
    </xsd:annotation>

    appInfo

    <xsd:annotation>
    <xsd:appInfo>
    order.process(orderID, totalPrice, orderDate, customerName, creditCardType, creditCardExpire, creditCardNumber);
    </xsd:appInfo>
    </xsd:annotation>

    User-Derived Types notation declarations Are only used to associate a name with the application used to view that type of document

    <xsd:notation name="jpeg" public="image/jpeg" system="jviewer.exe" />
    <xsd:notation name="gif" public="image/gif" system="gviewer.exe" />
    <xsd:notation name="bmp" public="image/bmp" system="bviewer.exe" />
    <xsd:notation name="png" public="image/png" system="pviewer.exe" />

    the public identifier tells us where the picture is, system tells us what viewer to use

    <xsd:element name="image">
    <xsd:complexType>
    <xsd:complexContent>
    <xsd:extension base="xsd:hexBinary">
    <xsd:attribute name="format">
    <xsd:simpleType>
    <xsd:restriction base="xsd:NOTATION">
    <xsd:enumeration value="jpeg" />
    <xsd:enumeration value="gif" />
    <xsd:enumeration value="png" />
    <xsd:enumeration value="bmp" />
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:attribute>
    </xsd:extension>
    </xsd:complexContent>
    </xsd:complexType>
    </xsd:element>

     

     
    Create our own derived types from the built-in types given
    Value spaces do not include the unicode character set
    include abstract properties like equality, order, bounds, cardinality an numeric/non-numeric properties
    Lexical Spaces include the Unicode character set
    length limits the number of units of length, characters (string type), octets (binary type), or list items

    Example:
      <xsd:simpleType name="areaCode">
      <xsd:restriction base="xsd:int">
      <xsd:length value="3" />
      </xsd:restriction>
      </simpleType>
    minLength  
    maxLength limited by the size of the parent element (so a type derived from a byte cannot have a maxLength of 4 or higher
    pattern limits the literals comprising the value of a facet to a pattern defined by a regular expression

    Example:
      <xsd:simpleType name="areaCode">
      <xsd:restriction base="xsd:int">
      <xsd:minLength value="3" />
      <xsd:maxLength value="3" />
      <xsd:pattern value="[1][0-9][0-9]" />
      </xsd:restriction>
      </simpleType>
    For more info see: http://www.perl.com/pub/doc/manual/html/pod/perlre/html
    enumeration limits the facet to a specific value, if the value isn't specified in the schema, it isn't valid

    Example:
      <xsd:simpleType name="department">
      <xsd:restriction base="xsd:string">
      <xsd:enumeration value="accounts" />
      <xsd:enumeration value="sales" />
      <xsd:enumeration value="warehouse" />
      <xsd:enumeration value="web" />
      <xsd:enumeration value="marketing" />
      <xsd:enumeration value="customer support" />
      </xsd:restriction>
      </simpleType>
    maxInclusive specific inclusive upper bound
    maxExclusive (the value is NOT included in the boundary)
    minInclusive specific inclusive lower bound
    minExclusive Example
      minExclusive<V< maxExclusive
    whiteSpace says whether whitespace is allowed.
  • preserve
  • replace
  • collapse
  • totalDigits specific max number of decimal digits (non-negative integer)
    fractionDigits specific max number of decimal digits in the fractional part