Alexandro,

SAX reports "ignorable" whitespace by the "ignorableWhitespace()" method rather than "characters()", but only if
- you parse with a DTD, and
- the whitespace occurs in an element that has element-only content.

If you don't parse with a DTD, or if you have "invisible" whitespace characters that occur in an element that supports text, then SAX reports them always as characters.

I hope this helps, although it is probably not the answer you hoped to get.

Best regards

Michael


Alexandro Colorado wrote:
I wonder if there is any SAX expert here. I want to parse an XML file with line breaks and tabs. It seems that the 'character' handler under ContentHandler will include linebreaks spaces and other invisible characters as content of the tags.

So for example I will get something like:
[  ] [     ] [Content] [ ] [     ] [OtherContent] [ ]

<tag>
   <value>Conent</value>
   <value>OtherContent</value>
</tag>

[ ] = Line Breaks (\n)
[    ] = Tabs (\t)

How can I ignore this non-visible character and just get the visual one. Thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
Michael Brauer, Technical Architect Software Engineering
StarOffice/OpenOffice.org
Sun Microsystems GmbH             Nagelsweg 55
D-20097 Hamburg, Germany          [EMAIL PROTECTED]
http://sun.com/staroffice         +49 40 23646 500
http://blogs.sun.com/GullFOSS

Sitz der Gesellschaft: Sun Microsystems GmbH, Sonnenallee 1,
           D-85551 Kirchheim-Heimstetten
Amtsgericht Muenchen: HRB 161028
Geschaeftsfuehrer: Marcel Schneider, Wolfgang Engels, Dr. Roland Boemer
Vorsitzender des Aufsichtsrates: Martin Haering

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to