XSD pattern validation

P

Per Skjondal

Hi all.

It might be a wild goose chase, but: I have a validation problem for a
base-type in a xml shema definition. The
type is :

<xsd:simpleType name="Equipment_A_Base">
<xsd:restriction base="xsd:string">
<xsd:minLength value="2"/>
<xsd:maxLength value="15"/>
<xsd:pattern value=""/>
</xsd:restriction>
</xsd:simpleType>

This field can contain a string which consists o fthese characters:

A,C,D,E,F,G,H,I,J,K,L,M,N,O,P,R,S,T,U,V,X,Y,Z

Rule: The lenght of the field can be from 2-15 chars. Only 1 of each char
and in whatever order. Example:

NEFGACYXZ

Is it at all possible to validate something like his? I begin to wonder. Any
ideas?

Per
 
J

Joe Kesselman

Per said:
Rule: The lenght of the field can be from 2-15 chars. Only 1 of each char
and in whatever order. Example:
Is it at all possible to validate something like his? I begin to wonder. Any
ideas?


Length constraints should be possible, character set should be possible
-- but the "at most once" is probably beyond Schema's RE capabilities.
(See http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#dt-regex)

I think it's up to the application, rather than the parser, deal with
this level of data checking/interpretation.
 

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

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top