Schema standard types [message #47351] |
Tue, 08 June 2004 02:04  |
Eclipse User |
|
|
|
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 #47475 is a reply to message #47415] |
Tue, 08 June 2004 07:20  |
Eclipse User |
|
|
|
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><xs:simpleType name="boolean" id="boolean">
<br> <xs:annotation>
<br> <xs:appinfo>
<br> <hfp:hasFacet name="pattern"/>
<br> <hfp:hasFacet name="whiteSpace"/>
<br> <hfp:hasProperty name="ordered" value="false"/>
<br> <hfp:hasProperty name="bounded" value="false"/>
<br> <hfp:hasProperty name="cardinality"
value="finite"/>
<br> <hfp:hasProperty name="numeric" value="false"/>
<br> </xs:appinfo>
<br> <xs:documentation
<br> source="<A HREF="http://www.w3.org/TR/xmlschema-2/#boolean"/">http://www.w3.org/TR/xmlschema-2/#boolean"/</A>>
<br> </xs:annotation>
<br> <xs:restriction base="xs:anySimpleType">
<br> <xs:whiteSpace value="collapse" fixed="true"
<br> id="boolean.whiteSpace"/>
<br> </xs:restriction>
<br></xs:simpleType></blockquote>
An enumeration would have to be a restriction of some type that already
included the values...
<br>
<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. 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 06:39  |
Eclipse User |
|
|
|
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 #588243 is a reply to message #47381] |
Tue, 08 June 2004 06:52  |
Eclipse User |
|
|
|
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 07:20  |
Eclipse User |
|
|
|
--------------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><xs:simpleType name="boolean" id="boolean">
<br> <xs:annotation>
<br> <xs:appinfo>
<br> <hfp:hasFacet name="pattern"/>
<br> <hfp:hasFacet name="whiteSpace"/>
<br> <hfp:hasProperty name="ordered" value="false"/>
<br> <hfp:hasProperty name="bounded" value="false"/>
<br> <hfp:hasProperty name="cardinality"
value="finite"/>
<br> <hfp:hasProperty name="numeric" value="false"/>
<br> </xs:appinfo>
<br> <xs:documentation
<br> source="<A HREF="http://www.w3.org/TR/xmlschema-2/#boolean"/">http://www.w3.org/TR/xmlschema-2/#boolean"/</A>>
<br> </xs:annotation>
<br> <xs:restriction base="xs:anySimpleType">
<br> <xs:whiteSpace value="collapse" fixed="true"
<br> id="boolean.whiteSpace"/>
<br> </xs:restriction>
<br></xs:simpleType></blockquote>
An enumeration would have to be a restriction of some type that already
included the values...
<br>
<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. 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--
|
|
|
Powered by
FUDForum. Page generated in 0.06268 seconds