Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: "mixing" simpleType and complexType

From: "Michael Kay" <mike@--------.--->
To: <info@-------.-->, "'XML Schema List'" <xmlschema-dev@--.--->
Date: 7/25/2008 10:05:00 PM
Your <peculiar> element has mixed content, and XSD 1.0 gives you no way =
to
constrain the text that may appear in an element with mixed content.

You can do this using assertions in XSD 1.1:

<xs:element name="peculiar">
  <xs:complexType mixed="true">
    ...
    <xs:assert test="matches(text(), '\p{IsGreek}+')"/>

Implemented in Saxon 9.1.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: xmlschema-dev-request@w... 
> [mailto:xmlschema-dev-request@w...] On Behalf Of Andreas Peter
> Sent: 25 July 2008 20:13
> To: XML Schema List
> Subject: "mixing" simpleType and complexType
> 
> 
> Hello list-users,
> 
> I need to "mix" simpleTypes and complexTypes. To be more precisely an
> example:
> 
> As result I need the following
> 
> <peculiar>=D9<subscript>2</subscript></peculiar>
> 
> where as the "=D9" should be from the unicode block "greek" and the =
"2" 
> from the unicode block "superscriptsandsubscripts". The 
> problem is that I defined a simpleType for both and I do not 
> know how to nest them in an element "peculiar"? The "=D9" and 
> the "2" should be tested if they are part of the unicode blocks.
> 
> 
>     <xs:simpleType name="greekType">
>         <xs:restriction base="xs:string">
>             <xs:pattern value="\p{IsGreek}+"/>
>         </xs:restriction>
>     </xs:simpleType>
> 
>     <xs:simpleType name="subscriptType">
>         <xs:restriction base="xs:string">
>             <xs:pattern value="\p{IsSuperscriptsandSubscripts}+"/>
>         </xs:restriction>
>     </xs:simpleType>
>    
>     <xs:element name="peculiar">
>         <xs:complexType>
>             ???
>         </xs:complexType>
>     </xs:element>
> 
> I hope that the problem was described clearly :-) Any hints 
> are welcome. Thanks so much,
> 
> Andreas
> 
> 
> 
> 
> 


From lists@n... Sun Jul 27 14:03:40 2008
Received: from farnsworth.w3.org ([128.30.52.43] helo=wiggum.w3.o


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