XSD datatypes

J

Jason S

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>
 

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
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top