Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: Non-restrictive XSD Enumeration

From: EricLemmon@-----------.---------.---
To: NULL
Date: 11/6/2006 4:05:00 PM

Hello S. Huseyin,

Thank you for your answer...even if it was hard to hear.  :-)

I have since implemented this using a reg ex pattern.  It's not as user 
friendly, but it certainly works.

Take care,

Eric

"S. Huseyin Ulger" wrote:

> If you define <xs:enumeration/> the instance value must match one of the 
> enumerations. You might try using <xs:pattern/> and give a regular expression 
> instead, or just use plain xs:string as type if there is no rule on the value.
> -- 
> S. Huseyin Ulger [MSFT]
> MSXML Dev
> 
> 
> "Eric Lemmon" wrote:
> 
> > Hello,
> > 
> > I have an XML file with an XSD schema file behind it, so my users that edit 
> > the XML directly [in VS 2005] receive Intellisense dropdowns for all 
> > enumerations.
> > 
> > How can I make some of these enumerations flexible enough, so that the doc 
> > won't fail schema validation when text is entered that is not an enumerated 
> > value?
> > 
> > For example, this would mimic how the maxOccurs attribute has the 
> > "unbounded" enumeration, but it permits you to add an integer value.
> > 
> > Here is a snippet of the offending XSD:
> > <xs:element name="PhoneType" maxOccurs="1" minOccurs="0">
> >   <xs:simpleType>
> >     <xs:restriction base="xs:string">
> >       <xs:enumeration value="Home" />
> >       <xs:enumeration value="Office" />
> >     </xs:restriction>
> >   </xs:simpleType>
> > </xs:element>
> > 
> > How can I make both of these pass schema validation?
> > <PhoneType>Home</PhoneType>
> > <PhoneType>Cell</PhoneType>
> > 
> > Thank you,
> > 
> > Eric
> > 


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