Thanks for the helpful reply, Sandy. The
XSSimpleTypeDefinition/XSComplexTypeDefinition seem to have all that is
needed for e.g., validation and user assistance.

But they don't (seem to) have enough information to reconstruct the original
model (or at least to do so without difficulty), as would be necessary e.g.,
to show an outline view or a graph that includes content models, types,
groups, etc. Do we need getContentModel() for such an application, or is
there another way to do it?

Bob Foster

----- Original Message -----
From: "Sandy Gao" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, August 05, 2003 5:47 PM
Subject: Re: examining XML schema attributes


>
> (Didn't realize that I was cc'ed.)
>
> We do exactly what the spec requires. (If not, either there is a bug, or
we
> have very good reasons. :-) )
>
> - For simple types, the spec says that the facets are inherited from the
> base type, so we "collect" them into the derived type.
> - For complex types,
>   - For restriction, the spec says that the {content type} is what's in
the
> derived type, so we don't include anything from the base type into the
> {content type} of the derived type.
>   - For extension, the specs says the {content type} is a sequence
> containing things from both the base type and the derived type, so we have
> that sequence in the derived type.
>
> So getDefinedFacets on XSSimpleTypeDefinition returns all the facets
> (including those inherited from base types). And getParticle on
> XSComplexTypeDefinition gives you the particle as required by the spec.
>
> Note that getContentModel() is used to get another implementation class
> that facilitates the schema assessment, and is not intended to be used by
> the users (e.g. you :-) ).
>
> HTH,
> Sandy Gao
> Software Developer, IBM Canada
> (1-905) 413-3255
> [EMAIL PROTECTED]
>
>
>
>

>                       "Bob Foster"
>                       <[EMAIL PROTECTED]>         To:
<[EMAIL PROTECTED]>
>                                                cc:       Sandy
Gao/Toronto/[EMAIL PROTECTED]
>                       07/26/2003 02:10         Subject:  Re: examining XML
schema attributes
>                       AM
>                       Please respond to
>                       xerces-j-user
>
>
>
>
>
> > "negativeInteger" is *not* a primitive type. It's derived from
"integer",
> > which is in turn derived from "decimal". And "decimal" is a primitive.
> But
> > you are right in that, to determine whether a type is derived from
> > negativeInteger, one needs to call getBaseType recursively.
> > getPrimitiveType won't help here, because it would return "decimal".
>
> If one wants to build up the set of all facets defined in user-derived
> types, do you have to recursively trek through the base types or are they
> collected into the attribute type?
>
> An earlier response having to do with complex types led me to think they
> might be (collected), so perhaps I should verify that answer, as well.
Does
> the content model/particle of a complex type incorporate the net of all
the
> base complex types, or does one have to recursively construct the net
> model?
>
> Or is this the wrong question? I see the validator casts the
> XSComplexTypeDeclaration to an XSComplexTypeDecl in order to call
> getContentModel(). Is it the content model that is aggregated, while the
> particle(s) only reflect the current type?
>
> Sorry to belabor these points, but even though "XSSimpleTypeDefinition is
> preferred over XSSimpleTypeDecl" it is really not obvious when one must
use
> an "implementation type" in order to avoid re-doing work the parser has
> already done.
>
> Thanks.
>
> Bob Foster
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to