Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » Schema standard types
Schema standard types [message #47351] Tue, 08 June 2004 06:04 Go to next message
Eclipse UserFriend
Originally posted by: invalid.soft-gems.net

Hi Ed,

I tried to get all types in a schema using schema.eAllContents() but found
that default types (e.g. xs:integer) are not included in this collection.
I thought eAllContents would return anything in a schema, but it seems I
need something different for this. Can you help please?

Mike
--
www.soft-gems.net
Re: Schema standard types [message #47381 is a reply to message #47351] Tue, 08 June 2004 10:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Mike,

The eAllContents method walks the containment tree of an object, so it will
return everything physically contained under the object. The
XSDSchema.getTypeDefinitions() returns all the types defined by a schema and
all those imported or included into the schema. It will not contain the
built-in schema types either, because they are not imported nor included, they
are simply ubiquitous and available everywhere without import. Using
xsdSchema.getSchemaForSchema().getTypeDefinitions will get the type
definitions defined by the schema for schemas. The method
xsdSchema.getSimpleTypeIdMap() applied to the schema for schema will give
precisely the built-in simple types.


Mike Lischke wrote:

> Hi Ed,
>
> I tried to get all types in a schema using schema.eAllContents() but found
> that default types (e.g. xs:integer) are not included in this collection.
> I thought eAllContents would return anything in a schema, but it seems I
> need something different for this. Can you help please?
>
> Mike
> --
> www.soft-gems.net
Re: Schema standard types [message #47415 is a reply to message #47381] Tue, 08 June 2004 10:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: invalid.soft-gems.net

Ed Merks wrote:

> xsdSchema.getSchemaForSchema().getTypeDefinitions will get the type
> definitions defined by the schema for schemas. The method
> xsdSchema.getSimpleTypeIdMap() applied to the schema for schema will give
> precisely the built-in simple types.

Excellent Ed, thank you. Works like a charm.

Btw: I expected to get an enumeration facet for xs:boolean but there is
none. Isn't this type defined as the list of values "true", "false", "0"
and "1"?

Mike
--
www.soft-gems.net
Re: Schema standard types [message #47475 is a reply to message #47415] Tue, 08 June 2004 11:20 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

--------------6EB3CED71C7AC3C390907CC6
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Mike,

No, it's defined like this:

<xs:simpleType name="boolean" id="boolean">
<xs:annotation>
<xs:appinfo>
<hfp:hasFacet name="pattern"/>
<hfp:hasFacet name="whiteSpace"/>
<hfp:hasProperty name="ordered" value="false"/>
<hfp:hasProperty name="bounded" value="false"/>
<hfp:hasProperty name="cardinality" value="finite"/>
<hfp:hasProperty name="numeric" value="false"/>
</xs:appinfo>
<xs:documentation
source="http://www.w3.org/TR/xmlschema-2/#boolean"/>
</xs:annotation>
<xs:restriction base="xs:anySimpleType">
<xs:whiteSpace value="collapse" fixed="true"
id="boolean.whiteSpace"/>
</xs:restriction>
</xs:simpleType>

An enumeration would have to be a restriction of some type that already
included the values...


Mike Lischke wrote:

> Ed Merks wrote:
>
> > xsdSchema.getSchemaForSchema().getTypeDefinitions will get the type
> > definitions defined by the schema for schemas. The method
> > xsdSchema.getSimpleTypeIdMap() applied to the schema for schema will give
> > precisely the built-in simple types.
>
> Excellent Ed, thank you. Works like a charm.
>
> Btw: I expected to get an enumeration facet for xs:boolean but there is
> none. Isn't this type defined as the list of values "true", "false", "0"
> and "1"?
>
> Mike
> --
> www.soft-gems.net

--------------6EB3CED71C7AC3C390907CC6
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Mike,
<p>No, it's defined like this:
<blockquote>&lt;xs:simpleType name="boolean" id="boolean">
<br>&nbsp; &lt;xs:annotation>
<br>&nbsp;&nbsp;&nbsp; &lt;xs:appinfo>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;hfp:hasFacet name="pattern"/>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;hfp:hasFacet name="whiteSpace"/>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;hfp:hasProperty name="ordered" value="false"/>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;hfp:hasProperty name="bounded" value="false"/>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;hfp:hasProperty name="cardinality"
value="finite"/>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;hfp:hasProperty name="numeric" value="false"/>
<br>&nbsp;&nbsp;&nbsp; &lt;/xs:appinfo>
<br>&nbsp;&nbsp;&nbsp; &lt;xs:documentation
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; source="<A HREF="http://www.w3.org/TR/xmlschema-2/#boolean"/">http://www.w3.org/TR/xmlschema-2/#boolean"/</A>>
<br>&nbsp; &lt;/xs:annotation>
<br>&nbsp; &lt;xs:restriction base="xs:anySimpleType">
<br>&nbsp;&nbsp;&nbsp; &lt;xs:whiteSpace value="collapse" fixed="true"
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id="boolean.whiteSpace"/>
<br>&nbsp; &lt;/xs:restriction>
<br>&lt;/xs:simpleType></blockquote>
An enumeration would have to be a restriction of some type that already
included the values...
<br>&nbsp;
<p>Mike Lischke wrote:
<blockquote TYPE=CITE>Ed Merks wrote:
<p>> xsdSchema.getSchemaForSchema().getTypeDefinitions will get the type
<br>> definitions defined by the schema for schemas.&nbsp; The method
<br>> xsdSchema.getSimpleTypeIdMap() applied to the schema for schema will
give
<br>> precisely the built-in simple types.
<p>Excellent Ed, thank you. Works like a charm.
<p>Btw: I expected to get an enumeration facet for xs:boolean but there
is
<br>none. Isn't this type defined as the list of values "true", "false",
"0"
<br>and "1"?
<p>Mike
<br>--
<br>www.soft-gems.net</blockquote>
</html>

--------------6EB3CED71C7AC3C390907CC6--
Re: Schema standard types [message #588232 is a reply to message #47351] Tue, 08 June 2004 10:39 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31543
Registered: July 2009
Senior Member
Mike,

The eAllContents method walks the containment tree of an object, so it will
return everything physically contained under the object. The
XSDSchema.getTypeDefinitions() returns all the types defined by a schema and
all those imported or included into the schema. It will not contain the
built-in schema types either, because they are not imported nor included, they
are simply ubiquitous and available everywhere without import. Using
xsdSchema.getSchemaForSchema().getTypeDefinitions will get the type
definitions defined by the schema for schemas. The method
xsdSchema.getSimpleTypeIdMap() applied to the schema for schema will give
precisely the built-in simple types.


Mike Lischke wrote:

> Hi Ed,
>
> I tried to get all types in a schema using schema.eAllContents() but found
> that default types (e.g. xs:integer) are not included in this collection.
> I thought eAllContents would return anything in a schema, but it seems I
> need something different for this. Can you help please?
>
> Mike
> --
> www.soft-gems.net


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Schema standard types [message #588243 is a reply to message #47381] Tue, 08 June 2004 10:52 Go to previous message
Mike Lischke is currently offline Mike LischkeFriend
Messages: 78
Registered: July 2009
Member
Ed Merks wrote:

> xsdSchema.getSchemaForSchema().getTypeDefinitions will get the type
> definitions defined by the schema for schemas. The method
> xsdSchema.getSimpleTypeIdMap() applied to the schema for schema will give
> precisely the built-in simple types.

Excellent Ed, thank you. Works like a charm.

Btw: I expected to get an enumeration facet for xs:boolean but there is
none. Isn't this type defined as the list of values "true", "false", "0"
and "1"?

Mike
--
www.soft-gems.net
Re: Schema standard types [message #588261 is a reply to message #47415] Tue, 08 June 2004 11:20 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31543
Registered: July 2009
Senior Member
--------------6EB3CED71C7AC3C390907CC6
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Mike,

No, it's defined like this:

<xs:simpleType name="boolean" id="boolean">
<xs:annotation>
<xs:appinfo>
<hfp:hasFacet name="pattern"/>
<hfp:hasFacet name="whiteSpace"/>
<hfp:hasProperty name="ordered" value="false"/>
<hfp:hasProperty name="bounded" value="false"/>
<hfp:hasProperty name="cardinality" value="finite"/>
<hfp:hasProperty name="numeric" value="false"/>
</xs:appinfo>
<xs:documentation
source="http://www.w3.org/TR/xmlschema-2/#boolean"/>
</xs:annotation>
<xs:restriction base="xs:anySimpleType">
<xs:whiteSpace value="collapse" fixed="true"
id="boolean.whiteSpace"/>
</xs:restriction>
</xs:simpleType>

An enumeration would have to be a restriction of some type that already
included the values...


Mike Lischke wrote:

> Ed Merks wrote:
>
> > xsdSchema.getSchemaForSchema().getTypeDefinitions will get the type
> > definitions defined by the schema for schemas. The method
> > xsdSchema.getSimpleTypeIdMap() applied to the schema for schema will give
> > precisely the built-in simple types.
>
> Excellent Ed, thank you. Works like a charm.
>
> Btw: I expected to get an enumeration facet for xs:boolean but there is
> none. Isn't this type defined as the list of values "true", "false", "0"
> and "1"?
>
> Mike
> --
> www.soft-gems.net

--------------6EB3CED71C7AC3C390907CC6
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Mike,
<p>No, it's defined like this:
<blockquote>&lt;xs:simpleType name="boolean" id="boolean">
<br>&nbsp; &lt;xs:annotation>
<br>&nbsp;&nbsp;&nbsp; &lt;xs:appinfo>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;hfp:hasFacet name="pattern"/>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;hfp:hasFacet name="whiteSpace"/>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;hfp:hasProperty name="ordered" value="false"/>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;hfp:hasProperty name="bounded" value="false"/>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;hfp:hasProperty name="cardinality"
value="finite"/>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;hfp:hasProperty name="numeric" value="false"/>
<br>&nbsp;&nbsp;&nbsp; &lt;/xs:appinfo>
<br>&nbsp;&nbsp;&nbsp; &lt;xs:documentation
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; source="<A HREF="http://www.w3.org/TR/xmlschema-2/#boolean"/">http://www.w3.org/TR/xmlschema-2/#boolean"/</A>>
<br>&nbsp; &lt;/xs:annotation>
<br>&nbsp; &lt;xs:restriction base="xs:anySimpleType">
<br>&nbsp;&nbsp;&nbsp; &lt;xs:whiteSpace value="collapse" fixed="true"
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id="boolean.whiteSpace"/>
<br>&nbsp; &lt;/xs:restriction>
<br>&lt;/xs:simpleType></blockquote>
An enumeration would have to be a restriction of some type that already
included the values...
<br>&nbsp;
<p>Mike Lischke wrote:
<blockquote TYPE=CITE>Ed Merks wrote:
<p>> xsdSchema.getSchemaForSchema().getTypeDefinitions will get the type
<br>> definitions defined by the schema for schemas.&nbsp; The method
<br>> xsdSchema.getSimpleTypeIdMap() applied to the schema for schema will
give
<br>> precisely the built-in simple types.
<p>Excellent Ed, thank you. Works like a charm.
<p>Btw: I expected to get an enumeration facet for xs:boolean but there
is
<br>none. Isn't this type defined as the list of values "true", "false",
"0"
<br>and "1"?
<p>Mike
<br>--
<br>www.soft-gems.net</blockquote>
</html>

--------------6EB3CED71C7AC3C390907CC6--


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Value validation
Next Topic:Value validation
Goto Forum:
  


Current Time: Fri Oct 23 12:16:40 GMT 2020

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

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

Back to the top