Venkat
Venkat

Reputation: 51

Pattern in XSD for String

I have scenario for which i need to write the pattetn in xsd for below scenarios. pls help

1) String can have value from 0 to 4532 (max value)

2) it can also contain value in terms of ranges like 100-4352 or 100-200 or 0 - 4532 (any possible range value . max value of the range is 4532)

it can consist '-' hypen as well so i am trying to define type as String.

pls let me know if there is any better way to specify the same in xsd other than pattern.

thanks in advance.

Upvotes: 1

Views: 266

Answers (1)

Jirka Š.
Jirka Š.

Reputation: 3428

I guess the pattern will be only chance how to do it. But I think it will be painful thing.

Just an idea - is it necessary to have this type as simple type? IMO it could be better to have it as (e.g.) complex type with two attributes (from, to). These two attributes could be of type constraining their content to the specified range 0-4532.

Upvotes: 1

Related Questions