[libxml++] ignore empty text nodes
- From: Andrej van der Zee <andrejvanderzee gmail com>
- To: libxmlplusplus-general lists sourceforge net
- Subject: [libxml++] ignore empty text nodes
- Date: Fri, 26 Mar 2010 19:47:12 +0900
Hi,
I am a happy user of libxmlpp for some time now. One thing I could not
find out yet. How can I ignore empty text nodes? The problem is that I
construct a dom document by reading two XML files and merging them
together with import_node(). I also remove some nodes manually with
remove_child(). Finally I do a doc->write_to_stream_formatted(cout,
"UTF-8") and end up with ugly output with holes in them like this:
<?xml version="1.0" encoding="UTF-8"?>
<session xmlns="XXX" version="1.0" clientName="Belastingdienst"
projectName="GBV" phase="1" iteration="1" sessionName="M2 - AUTO
TEST3">
<hosts>
<host name="apmvsq1" cluster="apmvsp1+2" type="mainframe"
smtEnabled="0" numCpus="666" opsys="ToBeOverwittenByParser"
hardware="ToBeOverWrittenByParser"
serviceLevel="ToBeOverwittenByParser" cpuSpeed="1"
cpuSpeedBenchmark="MIPS" cacheHitPerc="95" cacheHitTime="0.0015"
cacheMissTime="0.005" monitoringTool="ascb" timeDiff="67"/>
</hosts>
<msrs><msr xmlns=XXX" type="SU" guiName="SU1"
ignoreEteValidator="0"><parser-logs><ete
filename="SU1/20100304-GBV-M2-SU1.ete"/><resource
filename="SU1/20100304-GBV-M2-SU1.mf"
hostname="apmvsq1"/></parser-logs></msr></msrs></session>
I understand that these are empty text-nodes, but I wish to ignore
them. How can I do that without writing my own version of
write_to_stream_formatted()? I just wish to ignore them altogether.
Thank you,
Andrej
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]