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 Antonio Menchero Fernández <am...@aqs.es> on 2000/06/29 09:32:21 UTC

Public access for getAttributeDeclIndex() in SchemaGrammar ?

I'm using SchemaGrammar and it would be nice if getAttributeDeclIndex() 
could have public access instead of protected. In fact, its counterpart 
getElementDeclIndex() is public.

I don't know if protected acess is a design issue or it could be relaxed.

Waiting for your answer, thanks
Antonio. 


Re: Public access for getAttributeDeclIndex() in SchemaGrammar ?

Posted by Antonio Menchero Fernández <am...@aqs.es>.
At 13.34 29/6/00 -0700, you wrote:
>I just changed it to be public. fixes is in the CVS now.
>
>Would you mind sharing how you make use of these SchemaGrammar apis? e.g.,
>in what scenario?
>_____
>
>
>Eric Ye * IBM, JTC - Silicon Valley * ericye@locus.apache.org


Sure,
I'm defining a schema manager to allow access to element and attribute info 
& validation checking based on a loaded grammar so 'clients' can check if 
attribute & relationship restrictions apply to their current contents. In 
my case, 'clients' are hierarchical structured ejb's.

That's an extract of my interface:

     public int getNumAttributes(Integer useType);
     public Collection getAttributes(Integer useType);

     public int getAttributeUseType(String attributeName) throws 
SchemaException;
     public boolean hasAttribute(String attributeName);

     public boolean validateAttributeValue(String attributeName, String 
attributeValue)
                 throws SchemaException;
     public Object parseAttributeValue(String attributeName, String 
attributeValue)
                 throws SchemaException;

     public boolean validateElementAdding(String childrenName, int 
numberNewElements,
                 int numberCurrentElements) throws SchemaException;
     public boolean validateElementRemoving(String elementName, int 
numberDeletedElements,
                 int numberCurrentElements) throws SchemaException;

The implementation of these methods is based on others which are tightly 
dependent on your implementation details of SchemaGrammar, XMLElementDecl, 
XMLAttributeDecl, XMLContentModel, and so on, for example, they use 
StringPool indexes directly, so I have to track your implementation changes 
in depth. I greatly appreciate your work.

It would be definetly good if access to the grammar document was 
standardized, perhaps with DOM3.


Thanks,

Antonio Menchero

Advanced Quality Solutions (AQS) - Spain

Re: Public access for getAttributeDeclIndex() in SchemaGrammar ?

Posted by Eric Ye <er...@locus.apache.org>.
I just changed it to be public. fixes is in the CVS now.

Would you mind sharing how you make use of these SchemaGrammar apis? e.g.,
in what scenario?
_____


Eric Ye * IBM, JTC - Silicon Valley * ericye@locus.apache.org

----- Original Message -----
From: "Antonio Menchero Fernández" <am...@aqs.es>
To: <xe...@xml.apache.org>
Sent: Thursday, June 29, 2000 12:32 AM
Subject: Public access for getAttributeDeclIndex() in SchemaGrammar ?


> I'm using SchemaGrammar and it would be nice if getAttributeDeclIndex()
> could have public access instead of protected. In fact, its counterpart
> getElementDeclIndex() is public.
>
> I don't know if protected acess is a design issue or it could be relaxed.
>
> Waiting for your answer, thanks
> Antonio.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>
>