Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - RE: Multiple Types for an element >Thread Next - RE: Constraining a mixed type ? Constraining a mixed type ?To: <xmlschema-dev@--.---> Date: 4/16/2004 11:11:00 AM Hi, I wonder if it is possible to define a constrain on a mixed content using XML Schemas. For example, I need to specify that there is at least one character in my mixed complextype. I try the following schema : <xs:simpleType name="nonempty-content-ST"> <xs:restriction base="xs:string"> <xs:minLength value="1"/> </xs:restriction> </xs:simpleType> <xs:complexType name="nonempty-content-CT"> <xs:simpleContent> <xs:extension base="nonempty-content-ST"/> </xs:simpleContent> </xs:complexType> <xs:complexType name="mixed-content-CT" mixed="true"> <xs:complexContent mixed="true"> <xs:extension base="nonempty-content-CT"> <xs:choice maxOccurs="unbounded"> <xs:element name="emph" type="xs:string"/> </xs:choice> </xs:extension> </xs:complexContent> </xs:complexType> <xs:element name="p" type="mixed-content-CT"/> But it have problem to validate a document such <p><emph>test</emph></p> is this schema correct ? It there an other way to write this ? Thanks in advance -- bruno -- Bruno Chatel Tel : (+33) (0)4 96 11 14 57 bcha@c... -------------------------------------- From gaytri_v@y... Fri Apr 16 03:11:02 2004 Return-Path: <gaytri_v@yahoo | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
