0

Hi, I would like to question about setting up the element types

I am currently developing a catalogue of course desriptions so I have an element that is,

<xs:element name="code" type="this is the problem" />

inside this is the problem, I am supposed to include type that allows me to do this:

"4 letter code and 4 digit code"

In order to incorporate this what shall I do? it is both 4 letter string and 4 integer...? so I can't just go like xs:integer..! (has to limit..)

Thanks

2
Contributors
4
Replies
6
Views
6 Years
Discussion Span
Last Post by Mike Askew
1
<xs:element name="code">
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:pattern value="[a-zA-Z]{4}[0-9]{4}"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>

Try that.

Edited by Mike Askew

Votes + Comments
Amazing guy
0

Thank you very much this works extremely efficient and well!

0

Hi MikeyIsMe, may I ask you one more question?

The type has to be:

text, allowing embedded HTML formatting

what should I use to do this? (allowing embedded HTML formatting? I think for text xsd:string would be find tho...)

0

Can you give a couple of examples of what your after to be allowed :) Can maybe invent a regex for it then.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.