creating XML schema with restrictions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • baskarpr
    New Member
    • Oct 2006
    • 33

    #1

    creating XML schema with restrictions

    HI,
    I am a beginner in XML schema. In XML schema(XSD) how to complex type, which is restricted to base64Binary (the value of base64Binary type should be any of the values from enumeration) ?
    I have tried the below, but has some error, saying unexpected child element xs:enumeration. ( I am using altova's XML spy).

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="Norwegian_customer">
    <xs:complexContent>
    <xs:restriction base="xs:base64Binary">
    <xs:enumeration value="R0lGODlhcgGSALMAAAQCAEMmCZtuMFQxDS8b"/>
    <xs:enumeration value="R0lGODlhcgGSALMAAAQCAEMmCZtuMFQxDS8x"/>
    </xs:restriction>
    </xs:complexContent>
    </xs:complexType>
    </xs:schema>
  • jkmyoung
    Recognized Expert Top Contributor
    • Mar 2006
    • 2057

    #2
    What you are defining seems to be a simpleType, not a complexType.

    Comment

    Working...