[Expat-discuss] Character data

Carlos Pereira jose.carlos.pereira at ist.utl.pt
Tue Feb 8 00:09:22 CET 2011


On 02/07/11 21:10, Robert Bielik wrote:
> Carlos Pereira skrev 2011-02-07 22:32:
>>
>> so I could see that 45 and 67i belong to the same number. However, 
>> this seems a bit ugly... what about XML formats that may include 
>> large blocks of numerical data (for example X3D...)?? is there a 
>> better solution? what am I missing here?
>
> Just append the character data during parsing, so that at first call 
> the chardata string is:
That's good advice, thanks. In some cases these data blocks may well 
contain thousands of double or int values, so I am trying to parse and 
save them to final arrays as soon as possible.

my mistake is I am removing (\t\n ) delimiters, before properly parsing 
this.

Thanks a lot for clarifying this for me!
Carlos


>
> chData = "1234 45"
>
> then after next char data callback it is:
>
> chData = "1234 4567 891011"
>
> then you process the chData string in your endElement ("foo") handler.
>
> Regards,
> /Rob
> _______________________________________________
> Expat-discuss mailing list
> Expat-discuss at libexpat.org
> http://mail.libexpat.org/mailman/listinfo/expat-discuss
>



More information about the Expat-discuss mailing list