Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » Default values of attributes
Default values of attributes [message #26677] Sun, 24 August 2003 08:09 Go to next message
Hayden Marchant is currently offline Hayden MarchantFriend
Messages: 90
Registered: July 2009
Member
I am trying to parse an XSD containing the following attribute definition,
and am getting an error:

<xs:attribute name="mustUnderstand" default="0">
<xs:simpleType>
<xs:restriction base="xs:boolean">
<xs:pattern value="0|1"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>

The same error also occurs with:

<xs:attribute name="mustUnderstand" type="xs:boolean" default="0" />

The error is:
XSD: The value '0' of attribute 'default' must be of type
'http://www.w3.org/2001/XMLSchema#boolean'

The schema I'm trying to parse is the official W3C Soap:
http://www.w3.org/2001/06/soap-envelope.

Any reason why this shouldn't work. I looked at
http://www.w3.org/TR/xmlschema-2/#boolean and it seems that this it's
syntax to refer to a boolean literal as 0 or 1. After changing the default
to false or true, it parsed ok.

Thanks,
Hayden Marchant
Re: Default values of attributes [message #26763 is a reply to message #26677] Sun, 24 August 2003 12:57 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Hayden,

Your right, and I didn't know that. Please open a bugzilla defect and I'll
fix it for the next driver It's a simple change to
org.eclipse.xsd.impl.type.XSDBooleanType.


Hayden Marchant wrote:

> I am trying to parse an XSD containing the following attribute definition,
> and am getting an error:
>
> <xs:attribute name="mustUnderstand" default="0">
> <xs:simpleType>
> <xs:restriction base="xs:boolean">
> <xs:pattern value="0|1"/>
> </xs:restriction>
> </xs:simpleType>
> </xs:attribute>
>
> The same error also occurs with:
>
> <xs:attribute name="mustUnderstand" type="xs:boolean" default="0" />
>
> The error is:
> XSD: The value '0' of attribute 'default' must be of type
> 'http://www.w3.org/2001/XMLSchema#boolean'
>
> The schema I'm trying to parse is the official W3C Soap:
> http://www.w3.org/2001/06/soap-envelope.
>
> Any reason why this shouldn't work. I looked at
> http://www.w3.org/TR/xmlschema-2/#boolean and it seems that this it's
> syntax to refer to a boolean literal as 0 or 1. After changing the default
> to false or true, it parsed ok.
>
> Thanks,
> Hayden Marchant
Re: Default values of attributes [message #576238 is a reply to message #26677] Sun, 24 August 2003 12:57 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Hayden,

Your right, and I didn't know that. Please open a bugzilla defect and I'll
fix it for the next driver It's a simple change to
org.eclipse.xsd.impl.type.XSDBooleanType.


Hayden Marchant wrote:

> I am trying to parse an XSD containing the following attribute definition,
> and am getting an error:
>
> <xs:attribute name="mustUnderstand" default="0">
> <xs:simpleType>
> <xs:restriction base="xs:boolean">
> <xs:pattern value="0|1"/>
> </xs:restriction>
> </xs:simpleType>
> </xs:attribute>
>
> The same error also occurs with:
>
> <xs:attribute name="mustUnderstand" type="xs:boolean" default="0" />
>
> The error is:
> XSD: The value '0' of attribute 'default' must be of type
> 'http://www.w3.org/2001/XMLSchema#boolean'
>
> The schema I'm trying to parse is the official W3C Soap:
> http://www.w3.org/2001/06/soap-envelope
>
> Any reason why this shouldn't work. I looked at
> http://www.w3.org/TR/xmlschema-2/#boolean and it seems that this it's
> syntax to refer to a boolean literal as 0 or 1. After changing the default
> to false or true, it parsed ok.
>
> Thanks,
> Hayden Marchant


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:A Search for a more gentle approach to error handling using Eclipse XSD
Next Topic:A Search for a more gentle approach to error handling using Eclipse XSD
Goto Forum:
  


Current Time: Sat Apr 27 01:21:01 GMT 2024

Powered by FUDForum. Page generated in 0.03268 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top