Hi Pavani,

Some comments on your XSAllCM:

1.  It doesn't quite compile (two easily fixable errors);

2.  in oneTransition:  if the current state is less than 0, we still
must check whether the QName given may occur in the contentModel.
e.g., if a schema has

<elem a><all><elem b/><elem c/></all></elem>

and the instance has

<a><s/><c/></a>

the error probably arose from the user's finger slipping from a to s.
So we want the validator to emit one error because s is not present in
the content model, but since c may occur it would be best if the
validator didn't emit an error when it encountered it.  Besides, if we
return an object for <c/> we can validate its content, which could
provide the user with much useful information.  All this to say:  If
the current state is an error condition, then we should try and locate
the given element in the content model and return the XSElementDecl
corresponding to that element if we find it.

3.  Related to 2., if the current state is XSCMValidator.FIRST_ERROR,
then XSAllCM should set the state to
XSCMValidator.SUBSEQUENT_ERROR so the validator doesn't throw another
error for this (bad) contentModel.

4.  Also in oneTransition, you have
    fElementsSeen[i] = true;

The trouble with this is that, if we have different parsers all
accessing one grammar, if we store state inside the content models
then we have all kinds of thread-safety issues.  That's why we pass an
array of ints as the state to oneTransition rather than simply an
integer:  this way we can keep the state in an object that the
validator owns rather than doing so in the contentModel.

5.  Maybe it's just my text editor/e-mail client combination, but the
indenting in this file looks a bit less than consistent.

I can't commit the file in its current form because of 1. above.  But
if you wouldn't mind fixing these problems I'd be happy to commit it.
I'll wait until then to commit your changes to CMBuilder.

Cheers,
Neil

Neil Graham
XML Parser Development
IBM Toronto Lab
Phone:  905-413-3519, T/L 969-3519
E-mail:  [EMAIL PROTECTED]



Pavani Mukthipudi <[EMAIL PROTECTED]> on 09/26/2001 11:30:17 AM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:
Subject:  code for XSAllContentModel



Please find the attached code for XSAllContentModel

Regards,
Pavani

--

Pavani Mukthipudi
Sun Microsystems Inc.

Phone: 080 - 2298989   Extn: 87390
(See attached file: XSAllCM.java)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Attachment: XSAllCM.java
Description: Binary data

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

Reply via email to