Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: xsd:simpletype or

From: George Cristian Bina <george@---------.--->
To: Dan Vint <dvint@-----.--->
Date: 1/12/2006 1:04:00 PM
Hi Dan,

If you have a simple type then you can use it to extend/restrict further 
simple types or to define complex types with simple content based on 
that simple type (in case you need attributes). If you define a complex 
type then you cannot use that anymore to derive simple types.

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
www.---.com


Dan Vint wrote:
> 
> Can someone explain these two constructs and any advantage or 
> disadvantage to using one over the other?
> 
> Too me it appears that at a schema level these are equivalent and 
> possibly at the code generation level as well.
> 
> I am currently using the following design:
> 
> <xsd:complexType name="AboveGroundIndicator_Type">
>   <xsd:simpleContent>
>         <xsd:extension base="xsd:boolean"/>
>    </xsd:simpleContent>
> </xsd:complexType>
> 
> <xsd:element name="AboveGroundIndicator" type="AboveGroundIndicator_Type"/>
> 
> This seems to be the equivalent:
> 
> <xsd:simpleType name="AboveGroundIndicator_Type">
>         <xsd:restriction base="xsd:boolean"/>
> </xsd:simpleType>
> 
> <xsd:element name="AboveGroundIndicator" type="AboveGroundIndicator_Type"/>
> 
> I see that one seems to allow extension where the other limits me to 
> restriction, but I believe even with the extension definition, I could 
> not extend my Type by adding additional attributes.
> 
> ..dan
> ---------------------------------------------------------------------------
> Danny Vint
> 
> Specializing in Panoramic Images of California and the West
> http://www.dvint.com
> 
> voice: 510-522-4703
> 
> When H.H. Bennett was asked why he preferred to be out
> shooting landscapes rather than spending time in his portrait studio:
> 
> "It is easier to pose nature and less trouble to please."
> 
> http://www.portalwisconsin.org/bennett_feature.cfm
> 
>    
> 

From mike@s... Thu Jan 12 09:01:12 2006
Received: from lisa.w3.org ([128.30.52.41])
	b


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