> We can have a class say "SimpleTypeFactory" as we had
"DatatypeValidatorFactory"
> in xerces1.4.
> This will help us in providing separate and clean way of creating
simpleType
> declarations. All that part ie required to populate information about
built-in
> derived types can be done in implementation of this interface.
I agree. But we want to access all the types in a consistent way, no matter
whether it's built-in or not:
SchemaGrammar grammar = grammarResolver.getGrammar(uri);
XSType type = grammar.getTypeDecl(typeName);
Instead of:
if (uri == schemaNamespace)
simpleTypeactory.get...(...)
else
// get it from a grammar matching the namespace
So in my opinion, the built-in types should be in a separate grammar, which
corresponds to the schema namespace. If you can achieve this, then having a
separate class/interface for built-in types would be a good idea.
> i was thinking do we need to store the information about these built-in
> datatypes ,if validation is turned off ? As of now it will always be done
as a
> part of static initialization.
And putting them as static is for the same reason: other classes in the
schema package can access the built-in types directly. I hope you can do a
search for "SG_SchemaNS" in the v2 folder. If you can come up with ideas of
accessing the built-in types from those places, I'm ok of putting them as
non-static.
Cheers,
Sandy Gao
Software Developer, IBM Canada
(1-416) 448-3255
[EMAIL PROTECTED]
Neeraj Bajaj
<Neeraj.Bajaj@ To: [EMAIL PROTECTED],
[EMAIL PROTECTED]
Sun.COM> cc:
Subject: Re: [Xerces 2] simpleType
redesign proposal
09/17/2001
09:16 AM
Please respond
to
xerces-j-dev
Hi Sandy,
>how "presentFacet" parameter will be used when we actually traverse
>SimpleTypeDecl (where user defines its own SimpleType) and we have more
than
>one facet declared.
I again looked into it and i am clear on this part.
I would like to post few of my findings.Presently when we store
information about the built-in data types in SchemaGrammar , we do the job
of
creating built-in primitive datatypes and derived datatypes in one of the
constructor of this class.
We can have a class say "SimpleTypeFactory" as we had
"DatatypeValidatorFactory"
in xerces1.4.
public interface SimpleTypeFactory{
//returns simple Type Declarations for built in types like String, decimal
etc.
public XSSimpleTypeDecl getBuiltInSimpleType(int type);
public XSSimpleTypeDecl getSimpleTypeDecl(String name,String uri, String
baseUri, int baseIdx, short finalSet);)
}
This will help us in providing separate and clean way of creating
simpleType
declarations. All that part ie required to populate information about
built-in
derived types can be done in implementation of this interface.
i was thinking do we need to store the information about these built-in
datatypes ,if validation is turned off ? As of now it will always be done
as a
part of static initialization.
I have gone ahead with completing XSSimpleTypeDecl, i will try posting it
by
tomorrow.
regards
Neeraj Bajaj
---------------------
Sun Microsystems, inc.
Ph.91-80-2298989 x87425.
---------------------------------------------------------------------
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]