XSD datatypes

Discussion in 'XML' started by Jason S, Apr 1, 2008.

  1. Jason S

    Jason S Guest

    I'm using RELAX NG but my question is about XSD datatypes. Is there
    any way to combine patterns? Right now I have this: (a chain of
    identifiers, the first being strict e.g. starting w/ letter or
    understore, the rest can be letters, numbers or underscore, the
    separator being a '.')

    <define name='identifier-chain'>
    <data type="token">
    <param name="pattern">([A-Za-z_][A-Za-z_0-9]*)(\.[A-Za-
    z_0-9]+)*</param>
    </data>
    </define>

    is there any way to break this up into sub-patterns?
    e.g.

    <define name='identifier'>
    <data type="token">
    <param name="pattern">[A-Za-z_][A-Za-z_0-9]*</param>
    </data>
    </define>
    <define name='secondary-identifier'>
    <data type="token">
    <param name="pattern">[A-Za-z_0-9]+</param>
    </data>
    </define>
    <define name='identifier-chain'>
    <ref name='identifier' />
    <zeroOrMore>
    <data type="token">
    <value>.</value>
    <ref name='secondary-identifier' />
    </data>
    </zeroOrMore>
    </define>
    Jason S, Apr 1, 2008
    #1
    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,097
    Markus
    Nov 22, 2005
  2. Rick Razzano

    XSD document for XSD defintion

    Rick Razzano, Sep 26, 2003, in forum: XML
    Replies:
    1
    Views:
    484
    C. M. Sperberg-McQueen
    Sep 26, 2003
  3. Replies:
    1
    Views:
    855
    Martin Honnen
    Jan 14, 2004
  4. Peter Aberline

    xsd:any as a child of xsd:all

    Peter Aberline, Apr 5, 2004, in forum: XML
    Replies:
    0
    Views:
    785
    Peter Aberline
    Apr 5, 2004
  5. Bernd Oninger
    Replies:
    1
    Views:
    525
    Henry S. Thompson
    Jun 30, 2004
Loading...

Share This Page