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 Stef Epardaud <st...@lunatech.com> on 2003/03/27 14:33:21 UTC

How to access the real promitive type in org/apache/xerces/impl/dv/xs/XSSimpleTypeDecl.java ?

Hello

I am trying to get the real primitive kind of an XSSimpleTypeDecl but
the "public short getPrimitiveKind()" function filters out the ID, IDREF
and ENTITY kinds, as well as the NMTOKEN kind for another reason (it's
in fact a special patternType: SPECIAL_PATTERN_NMTOKEN)
I find I need to know the exact type and the most accurate value is in
fValidationDV. Is there another way to access it ?
Here's what I use right now (in addition to the rest of the file):

// declare a type for NMTOKEN
     static final short DV_NMTOKEN       = DV_NOTATION + 7;

// allow to access the real type
  public short getRealPrimitiveKind() {
    if (fVariety == VARIETY_ATOMIC && fValidationDV != DV_ANYSIMPLETYPE) {
      if(fPatternType == SPECIAL_PATTERN_NMTOKEN)
        return DV_NMTOKEN;
      else
        return fValidationDV;
    } else {
      return (short)0;
    }
  }

I am missing something, or is this information irrelevant to most but me ?
Thanks.
-- 
# Stef Epardaud, # Teachers have potentially more power than military,
# Java Defeater  #   the former can teach us how to not need the latter.
#     Earth      # Lunatech Research,
#  Solar System  #   soon we'll quit researching and start finding...

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