You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Neeraj Bajaj <Ne...@Sun.COM> on 2001/09/14 16:34:55 UTC

Re: [Xerces 2] simpleType redesign proposal

hi Sandy,
 
 	
> 1. The registry is not kept in any decl class. All decls are stored in
> SchemaGrammar objects. The built-in types belong to the schema namespace,
> so we have a SchemaGrammar instance for that namespace to hold all the
> built-in types. Use-defined types will be stored in separate grammars
> corresponding to their target namespaces.

i am putting my thoughts to make sure that i understand what 
u are saying.

In SchemaGrammar 2-D array of 
	XSType [] [] fTypeDeclType ;
is declared where presently instance of DatatypeValidators are stored.
They are stored as a part of static initialization of SchemaGrammar (for built-in types,, 
static SchemaGrammar SCHEMA_NG = new SchemaGrammar(..,..) )
I wanted to know, how is it going to change as per the introduction of new class XSSimpleTypeDecl (was 
DatatypeValidator) ?

a)is it going to be like this in SchemaGrammar now ?
I have taken simpleTypeDecl of primitive Datatype "string" and derivedDatatype "normalizedString"

XSSimpleTypeDecl string = new XSSimpleTypeDecl(SchemaSymbols.ATTVAL_STRING, 
SchemaSymbols.SCHEMAFOR_SCHEMA,SchemaSymbols.ATTVAL_ANYSIMPLETYPE,...,...); 
string.init4BuiltInType(XSSimpleTypeDecl.DV_STRING);

	fTypeDeclType[0][typeIndex] = string;
        fGlobalTypeDecls.put(SchemaSymbols.ATTVAL_STRING, typeIndex++);

XSSimpleTypeDecl normalizedString =  new  
XSSimpleTypeDecl(SchemaSymbols.ATTVAL_NORMALIZEDSTRING,SchemaSymbols.SCHEMAFOR_SCHEMA,SchemaSymbols.ATTVAL_STR
ING,....,...);
Object [] facets = new Object[XSSimpleTypeDecl.FACET_PARAM_SIZE];
facets[XSSimpleTypeDecl.INDEX_WHITESPACE] = SchemaSymbols.ATTVAL_REPLACE;
normalizedString.init4Restriction(string,facets,XSSimpleTypeDecl.DEFINED_WHITESPACE,-1); (what if no 
fixedFacets ?)

	fTypeDeclType[0][typeIndex] = string;
       	fGlobalTypeDecls.put(SchemaSymbols.ATTVAL_NORMALIZEDSTRING, typeIndex++);

( what will be the value of "presentFacet" parameter in case of "byte" or any other
declaration where we have more than one facet. we can pass the value of two or more facets as Object [] 
facets.I could not understand 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. 

 
b)Initialization of different primitive DatatpeValidators for static field
 TypeValidator [] fDVs = { /* .... */} in XSSimpleTypeDecl class  is commented right now (may be to compile)
Do we need to pass any parameters to constructor of different DatatypeValidators ? From my initial 
understanding, I feel we can have default constructor now ?


c) after we are finished traversing simpleTypeDecl we  store them
 in SchemaGrammar by using addTypeDecl(XSType ..., ..) 
 
 
 
> 3. Different DV classes are not real simple types. It's only a field of a
> simpleType decl. 

are u talking about different DV classes which are initialized once as a static initialization 
of TypeValidator array.

>And a base type of a simple type is not from that array
> either.

i could not get that.
 
 besides this, how fBaseIdx and fFinalSet fields are used in XSSimpleTypeDecl.
 
regards

Neeraj Bajaj
---------------------
Sun Microsystems, inc.
Ph.91-80-2298989 x87425.



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org