Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - Derivation by restriction from complexType/simpleContent [Thread Next] Re: Derivation by restriction from complexType/simpleContentTo: Simon.Cox@-----.-- Date: 12/2/2004 4:21:00 PM
Hi Simon,
> 1. Is the "double" simpleContent preserved or not?
Yes, that is the {content type} property.
See
http://www.w3.org/TR/xmlschema-1/#declare-type
3.4.2 XML Representation of Complex Type Definitions
Complex Type Definition with simple content Schema Component
{content type}
The {content type} for MeasureType is double:
***
4 otherwise (the type definition =B7resolved=B7 to by the =B7actual value=
=B7 of
the base [attribute] is a simple type definition and the <extension>
alternative is chosen), then that simple type definition.
***
And so it is the content type for LenghtType:
***
1 If the type definition =B7resolved=B7 to by the =B7actual value=B7 of t=
he base
[attribute] is a complex type definition whose own {content type} is a
simple type definition and the <restriction> alternative is chosen, then
starting from either
1.1 the simple type definition corresponding to the <simpleType> among
the [children] of <restriction> if there is one;
1.2 otherwise (<restriction> has no <simpleType> among its [children]),
the simple type definition which is the {content type} of the type
definition =B7resolved=B7 to by the =B7actual value=B7 of the base [attri=
bute]
a simple type definition which restricts the simple type definition
identified in clause 1.1 or clause 1.2 with a set of facet components
corresponding to the appropriate element information items among the
<restriction>'s [children] (i.e. those which specify facets, if any), as
defined in Simple Type Restriction (Facets) (=A73.14.6);
***
> 2. Is there any way I can restrict the value of uom?
<complexType name="LengthType">
<simpleContent>
<restriction base="gml:MeasureType">
<attribute name="uom" use="required">
<simpleType>
<restriction base="token">
<xs:enumeration value="meter"/>
</restriction>
</simpleType>
</attribute>
</restriction>
</simpleContent>
</complexType>
Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
www.---.com
Simon.Cox@c... wrote:
> What is the correct syntax for derivation from complexType/simpleConten=
t
> types?
> For example, if I write
>
> <complexType name="MeasureType">
> <simpleContent>
> <extension base="double">
> <attribute name="uom" type="token"
> use="required"/>
> </extension>
> </simpleContent>
> </complexType>
>
> <complexType name="LengthType">
> <simpleContent>
> <restriction base="gml:MeasureType"/>
> </simpleContent>
> </complexType>
>
> 1. Is the "double" simpleContent preserved or not?
> 2. Is there any way I can restrict the value of uom?
>
> Simon Cox
> ______
> Simon.Cox@c... CSIRO Exploration & Mining
> 26 Dick Perry Avenue, Kensington WA 6151
> PO Box 1130, Bentley WA 6102 AUSTRALIA
> T: +61(8) 6436 8639 F: +61(8) 6436 8555
> C: +61(4) 0330 2672 callto://dr_shorthair
> http://www.em.csiro.au
>
>
From nobody@w... Thu Dec 02 15:55:38 2004
Received: from wiggum.w3.org ([128.30.52.23])
by frink.w3.org with esmtp ( | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
