> I feel the way it is done in 1.4.x is quite descent. But then, we have to
modify
> the XSAttributeDecl class to hold these values for 'anyAttribute' and add
a
> couple of arrays in SchemaGrammar to support ContentSpec.
>
> What are your plans about storing this information in X2?.

I can hardly agree with you. In Xerces1, <any> and <anyAttribute> are
treated in completely different ways. So for any constraint concerning
wildcard (i.e. those from 3.10.4 and 3.10.6), we have to have two copies of
similar code: one for <any> and one for <anyAttribute>.

In Xerces2, I'm leaning toward having an XSWildcardDecl class to hold the
wildcard information. And other decl classes (XSParticleDecl,
XSAttributeGroup, XSComplexTypeDecl, etc.) will refer to objects of this
wildcard decl class. So that the code of processing wildcards is
centralized, which results in a cleaner design.

Here is my proposed wildcard decl class. What do you think?

/**
 * Store wildcard information.
 *
 * @author Sandy Gao, IBM
 * @version $Id$
 */
public class XSWildcardDecl {

    /** Wildcard namespace="##any". */
    public static final short WILDCARD_ANY   = 0;

    /** Wildcard namespace="##other". */
    public static final short WILDCARD_OTHER = 1;

    /** Wildcard namespace=list of anyURI | ##targetNamespace | ##local. */
    public static final short WILDCARD_LIST  = 2;

    /** Wildcard processContents="strict". */
    public static final short WILDCARD_STRICT = 0;

    /** Wildcard processContents="lax". */
    public static final short WILDCARD_LAX    = 1;

    /** Wildcard processContents="skip". */
    public static final short WILDCARD_SKIP   = 2;

    // the type of wildcard: any, other, or list
    public short fType = WILDCARD_ANY;

    // the type of process contents: strict, lax, or skip
    public short fPprocessContents = WILDCARD_STRICT;

    // the namespace list:
    // for WILDCARD_LIST, it means one of the namespaces in the list
    // for WILDCARD_OTHER, it means not any of the namespaces in the list
    public String[] fNamespaceList;
} // class XSWildcardDecl

Sandy Gao
Software Developer, IBM Canada
(1-416) 448-3255
[EMAIL PROTECTED]



                                                                                       
                              
                    Rahul Srivastava                                                   
                              
                    <Rahul.Srivastav       To:     [EMAIL PROTECTED]         
                              
                    [EMAIL PROTECTED]>             cc:                                         
                              
                                           Subject:     any and anyAttribute           
                              
                    09/13/2001 06:39                                                   
                              
                    AM                                                                 
                              
                    Please respond                                                     
                              
                    to xerces-j-dev                                                    
                              
                                                                                       
                              
                                                                                       
                              



Hi,

When traversing any and anyAttribute elements, what information is to be
populated in the SchemaGrammar. As in 1.4.x,
fSchemaGrammar.addContentSpecNode
stores the information about processContents attr. in SchemaGrammar and
namespace attr. information is stored in stringpool for 'any' element.

For 'anyAttribute' element, information is stored in XMLAttributeDecl which
is
added to SchemaGrammar.

I feel the way it is done in 1.4.x is quite descent. But then, we have to
modify
the XSAttributeDecl class to hold these values for 'anyAttribute' and add a

couple of arrays in SchemaGrammar to support ContentSpec.

What are your plans about storing this information in X2?.

Cheers,
Rahul.

Sun Microsystems Inc.


---------------------------------------------------------------------
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