You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Robert Ritler <rt...@bbp.ch> on 2002/04/23 15:24:39 UTC

attribute datatypes -> always CDATA

hello

when sax parsing a xml document with xerces-j-2 that has specified
attribute types (boolean, int, etc) in its schema, I always get CDATA
when calling the method Attributes.getType(...). Am I using it
incorrectly or is there another way to get to the attribute's
datatype?

thanks, robert

ps: I have validation and schema validation set to true, and I do get
the error if the xml document contains the wrong datatype for an
attribute -> I therefore expected attribute datatypes to be supported.


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


Re: attribute datatypes -> always CDATA

Posted by Elena Litani <el...@ca.ibm.com>.
Hi Robert,

> when sax parsing a xml document with xerces-j-2 that has specified
> attribute types (boolean, int, etc) in its schema, I always get CDATA
> when calling the method Attributes.getType(...).

This is a correct behavior. Attributes.getType() specifically refers to
XML 1.0 and assumes that attribute's declaration is found in DTD. So
unless SAX makes getType() definition broader - to include other types
of grammars, I don't see how we can report the XML Schema types for SAX
Attributes.

Currently Xerces uses Augmentations to pass additional information about
types in XNI that is part of the PSVI.
So, if you really need this information you can get it. 

Thanks,
-- 
Elena Litani / IBM Toronto

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