List Info

Thread: Understanding SAX and IgnoreWhiteSpaces




Understanding SAX and IgnoreWhiteSpaces
user name
2007-04-16 12:09:37
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: dev-unsubscribexml.openoffice.org
For additional commands, e-mail: dev-helpxml.openoffice.org


Understanding SAX and IgnoreWhiteSpaces
user name
2007-04-18 02:31:55
Alexandro,

In the 'character ' function, I would just use a 'sub' using
the regexp 
're' module if you are in Python.

Laurent




Alexandro Colorado <jzaopenoffice.org> 
16/04/2007 19:09
Veuillez répondre à
devxml.openoffice.org


A
devxml.openoffice.org
cc

Objet
[xml-dev] Understanding SAX and IgnoreWhiteSpaces





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: dev-unsubscribexml.openoffice.org
For additional commands, e-mail: dev-helpxml.openoffice.org

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )