Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


XML schema regular expressions question and recommended XML Schema book

From: fred123@-------.--- (---- -----)
To: NULL
Date: 2/4/2004 1:00:00 PM
Any suggestions or tips to the questions below I have been wrestling with
would be most welcome:

I have an example XSD file I have been experimenting with.  Suppose a
user can select from 1 to 4 checkboxes on a web form:

Select your favorite sport(s):

   (checkbox) baseball
   (checkbox) football
   (checkbox) soccer
   (checkbox) golf

Futhermore, suppose a user selects all the above sports:
The xml generated from the program that reads the form variables would be:

<sport>baseball\n\football\n\soccer\n\golf</sport>

Questions:

1. what is the most effective schema statement to handle the
possiblity of the user selecting either baseball or baseball and football
or baseball, football, soccer etc..? In other words, any permutation of
checkboxes.  

I would think you would use the logical or operator (|).
I was thinking something like below, but I am getting errors such as
"Datatype error: In element 'sport': Value ........ does not match regular 
expression facet ................
   
<xsd:simpleType name="sport">
<xsd:restriction base="xsd:string">
<xsd:pattern value="baseball\\n|\\nfootball\\n|\\nsoccer\\n|golf"/>

2. Does anyone recommend any books that explain XML Schema Regular Expressions
with some good examples?  I have read Definitive XML Schema, by Walmsley.

Thanks for any tips on the above,

Fred


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent