xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Irene Levina" <ir...@sonicsoftware.com>
Subject Re: SAXParser and white space problem
Date Fri, 29 Jun 2001 14:17:17 GMT
Hi Thomas,

Thanks for respond, I did solve my problem by using characters() and
LexicalHandler.startCData() and LexicalHandler.endCData() callbacks to collect
data that splits multiple lines in DATA content.

///////////////////////////
startCData(){
    isCDATA = true;
}

characters(.....)
{
     if(isCDATA)
        //collect data
}

endCDATA()
{
    //reset flag
    //process collected data
}
/////////////////////////////
Thanks ,
Irene Levina.



"Thomas B. Passin" wrote:

> [Irene Levina]
>
> > If same data split into multiple lines, such as :
> >
> >     <Attribute>
> >         <![CDATA[<greeting>Hello, world!</greeting>]]>
> >     </Attribute>
> >
> > length parameter repoted just a whitespace, and I can't not get actual
> > character data that I'm looking for. Is this bug was fixed in any new
> > version of SAXParser?
>
> That's because your data contains three nodes, not one
> 1) a whitespace-only node holding the first newline and it looks like some
> spaces as well.
> 2) the expected CDATA node, and
> 3) another whitespace-only node holding the second newline.
>
> It's not a bug, it reflects your data.  I'm not sure whether SAXParser has
> settings to merge the whitespace-only nodes with the other nodes.  Otherwise
> you have to make sure to collect all these nodes, not just the CDATA one.
>
> Tom P
>
> ---------------------------------------------------------------------
> In case of troubles, e-mail:     webmaster@xml.apache.org
> To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
> For additional commands, e-mail: general-help@xml.apache.org


---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org


Mime
View raw message