|
[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Non-empty mixed content where all element content is optional
From: Mr Dragev <mrdragev@gmail.com>
Date: Fri, 2 Dec 2005 15:11:26 -0700 Message-ID: <6b66b4c60512021411o1d5b494em92a00515019d2498@mail.gmail.com> To: xmlschema-dev@w3.org I am trying develop a complex type that has mixed content, where all the element content is optional, AND where the content cannot be empty (content composed of white-space only is not allowed). In other words, the type would allow (1) character content that is NOT simply white-space only, or (2) element content, or (3) both character and element content. Is this possible? The following xsd snippet is an example definition that falls just short of my requirements because an "empty" foo element is valid: <xsd:element name="foo"> <xsd:complexType mixed="true"> <xsd:sequence> <xsd:element name="bar" minOccurs="0"/> </xsd:sequence> </xsd:complexType> </xsd:element> The following XML examples are valid according to the definition above and according to my requirements: <foo><bar/></foo> --- <foo> text </foo> --- <foo> text <bar/> text </foo> The following XML examples are INVALID according to my requirements (BUT ARE VALID according the the definition above): <foo></foo> --- <foo> </foo> In essence, character content must match the pattern "\s*\S[\s\S]*" IF the optional element bar does NOT appear in the content.Received on Sunday, 4 December 2005 02:14:14 GMT |
Subscribe in XML format
|






