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 Feng Chen <pe...@yahoo.com> on 2008/04/11 22:14:48 UTC

Jave run-time 1.6+ mismatch with xercesImpl.jar?

Hi, Gurus.
I am using the latest xercesImpl.jar; xml-apis.jar from release 2.9.1 and Java run-time 1.6 update 5.
When processing (read) a xml file, it seems I cannot read some attribute value completely
for example, if the value is "false", it just gets "fals" or "fal"
                   if the value is "1.66783E-5", it just get "1.66783E-" or "1.66783E"
It doesn't happen to all though, only some of them.

Have any one met such problem before. 

Thanks.

peasnow




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: Jave run-time 1.6+ mismatch with xercesImpl.jar?

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Do you really mean an attribute value?

e.g. <foo bool="false"/>

or element content?

e.g. <foo><bool>false</bool></foo>

If it's the latter and you're using SAX you should know that characters()
may be called multiple times [1][2] for contiguous text. Your
ContentHandler needs to accumulate the text returned in each call of
characters() until you receive a callback that isn't characters. You cannot
assume that all character data of an element is reported in a single chunk.

Thanks.

[1]
http://xerces.apache.org/xerces2-j/javadocs/api/org/xml/sax/ContentHandler.html#characters(char[],%20int,%20int)
[2] http://xerces.apache.org/xerces2-j/faq-sax.html#faq-2

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

Feng Chen <pe...@yahoo.com> wrote on 04/11/2008 04:14:48 PM:

> Hi, Gurus.
> I am using the latest xercesImpl.jar; xml-apis.jar from release 2.9.
> 1 and Java run-time 1.6 update 5.
> When processing (read) a xml file, it seems I cannot read some
> attribute value completely
> for example, if the value is "false", it just gets "fals" or "fal"
>                    if the value is "1.66783E-5", it just get "1.
> 66783E-" or "1.66783E"
> It doesn't happen to all though, only some of them.
>
> Have any one met such problem before.
>
> Thanks.
>
> peasnow
>
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org


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