what's wrong with this schema definition?

KK

Usenet Archive
Joined
Dec 8, 2000
Messages
200
Reaction score
0
I have this portion in my schema definition:

<xsd:simpleType name="MyTimeType">
<xsd:restriction base="xsd:dateTime">
<xsd:pattern value="\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}-Z"/> <xsd:pattern value="\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}+\d{2}:\d{2}"/> <xsd:pattern value="\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}-\d{2}:\d{2}"/> </xsd:restriction> </xsd:simepleType>

When I validate this with XMLSpy, it high-lights the second pattern and gives this error message:

"This schema doesn't appear to be valid by itself (as a part of anohter schema, it might still be OK): Schema error - invalid regular expression: \ expected at position 41"

Could someone tell what's wrong with this pattern?

thanks a lot.

kk
 

Martin Honnen

Usenet Archive
Joined
Apr 8, 2000
Messages
6,174
Reaction score
0
kk said:
I have this portion in my schema definition:

<xsd:simpleType name="MyTimeType">
<xsd:restriction base="xsd:dateTime">
<xsd:pattern value="\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}-Z"/> <xsd:pattern value="\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}+\d{2}:\d{2}"/> <xsd:pattern value="\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}-\d{2}:\d{2}"/> </xsd:restriction> </xsd:simepleType>

When I validate this with XMLSpy, it high-lights the second pattern and gives this error message:

"This schema doesn't appear to be valid by itself (as a part of anohter schema, it might still be OK): Schema error - invalid regular expression: \ expected at position 41"

Could someone tell what's wrong with this pattern?

Have you tried using
\+
instead of
+
The plus symbol is meta character thus you might need to escape it to have it literally included in the pattern
 

KK

Usenet Archive
Joined
Dec 8, 2000
Messages
200
Reaction score
0
Martin said:
Have you tried using
\+
instead of
+
The plus symbol is meta character thus you might need to escape it to have it literally included in the pattern

Thank you very much, that was dumb on my part :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,042
Messages
3,104,224
Members
248,132
Latest member
henrywalsh

Latest Threads

Top