OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

relax-ng message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]

Subject: Re: Datatype interface for RELAX NG

> I wrote interface definitions for datatypes. I believe this interface is
> sufficient to implement RELAX NG validator in Java.

A few comments on this.

I think DataType.diagnose and DataTypeErrorDiagnosis are ugly.  I would
suggest replacing them by the following method on DataType:

void check(String literal, ContextProvider context) throws

This is like accept, except that it throws an exception for a literal that
is not a member of the datatype.

Then add a method to DataTypeException:

  int getIndex();

which returns the index into the string of the place where the error occurs,
or -1 if this is not available.  For check(), this is the index into the
literal.  For TypeIncubator.add, it's the index into the strValue.

I don't think DataType.displayName is necessary.

I don't like the name TypeIncubator.  Why "Type" not "DataType"?  I would
suggest DataTypeBuilder (like StringBuilder).

I would rename some of the methods on DataType:

accept => allows/accepts or contains
convertToValueObject => createValue
testValueEquality => sameValue

I don't think DataTypeLibrary.getNamespaceURI is necessary.

I would rename ContextProvider to Context.

The doc for resolveNamespacePrefix should clarify how it handles implicitly
declared "xml" prefix.


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]

Powered by eList eXpress LLC