CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2010
    Posts
    2

    [RESOLVED] Any difference between xs:pattern and xs:enumeration?

    Pl consider the below example:

    <xs:element name="gender">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs: pattern value="male|female"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>


    Can't we get the same result by writing:

    <xs:element name="gender">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:enumeration value="male"/>
    <xs:enumeration value="female"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>

  2. #2
    Join Date
    Dec 2010
    Posts
    2

    Re: Any difference between xs:pattern and xs:enumeration?

    ok. I got it.
    enumeration: Defines a list of acceptable values
    pattern: Defines the exact sequence of characters that are acceptable

    Eventhough, enumeration and pattern might give the same result in this context, it will not do so always.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured