Praneel PIDIKITI
Praneel PIDIKITI

Reputation: 19517

XS:date returns an error with format YYYYMMDD

<xs:element name="BeginDate" type="xs:string">
   <xs:simpleType>
    <xs:restriction base="xs:string">
        <xs:pattern value="\d{8}"/>
    </xs:restriction>
    </xs:simpleType>
</xs:element>

In the XML I gave

     <BeginDate>20100721</BeginDate>

but it returns an error ... there is a problem with the code here .. but i am using a validated code :(

So I'm a bit blocked

Upvotes: 0

Views: 681

Answers (3)

jasso
jasso

Reputation: 13966

You have defined the content type twice. You have:
1) attribute type on <xs:element>
2) <xs:simpleType> block as a child of <xs:element>.

You can't have both. In this case, you don't need the type attribute.

Upvotes: 1

Damien
Damien

Reputation: 3220

Why do you think the error lies with the regular expression ? Your XML is not valid. What error message do you get ? Edit: you changed it, but it's still not valid (there is a name attribute in simpleType that should not be used there).

Upvotes: 1

user
user

Reputation: 6947

I don't see how that snippet can even be valid, given the </xs:simpleType name="CustomDate"> thrown in near the end... do I see a copy-paste error there?

Upvotes: 1

Related Questions