A beginners question about substitution groups

S

Steve

Hi,

I'm currently teaching myself about XML schems at the same time as
specifying the XML document for a project I've been given to write.
(I'm new to the XML world, so progress is a little slow at the moment!)

I find myself needing to restrict an element to contain either an
integer in the range of 01 - 99 OR the value "*9". Because of the
asterisk an simple integer field is not sufficient so I suspect I need
to use a substitution group to specify that this element can either be
an integer, or a string with only one permissable value.

I'm following the XML Schema Part 0 - 3 from the w3c.org website to
indicate what is permissible in the language.

I'm a little confused about how to code up a substitution group so that
the value is either a ranged integer, or a specific string. Could
someone point me in the direction of some other documentation which is
a little more readable than the official primer, or describe to me how
it's done - I don't want some canned XML with "This will do what you
require", as I'd like to work this simple problem through myself.

Cheers.
 
S

Steve

Aha! A union (which I'd not actually read about yet) is definitely the
way to go. I think that I may do well with a comfortable book, rather
than the precise, but slightly terse, standards docs!

Seeing as you've written both, it I feel I should look no further! :)

Many thanks Priscilla - my schema is rolling again...

Steve.
 

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,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top