what's wrong with this schema definition?

Discussion in 'XML' started by kk, Aug 9, 2003.

  1. kk

    kk Guest

    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
     
    kk, Aug 9, 2003
    #1
    1. Advertising

  2. kk wrote:
    > 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



    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Aug 9, 2003
    #2
    1. Advertising

  3. kk

    kk Guest

    Martin Honnen wrote:
    >
    >
    > 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 :)
     
    kk, Aug 10, 2003
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Markus
    Replies:
    1
    Views:
    1,660
    Markus
    Nov 23, 2005
  2. Abhinav
    Replies:
    6
    Views:
    1,131
    Abhinav
    Aug 16, 2004
  3. Matthew
    Replies:
    7
    Views:
    867
    Priscilla Walmsley
    Jan 7, 2005
  4. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,324
    Stanimir Stamenkov
    Apr 25, 2005
  5. Jianli Shen
    Replies:
    1
    Views:
    637
    Victor Bazarov
    Mar 13, 2005
Loading...

Share This Page