android - Parsing xml only getting CDATA within Tag -
i trying text xml file looks so:
<description> <p> <strong>last updated:</strong> mon, 19 aug 2013 23:52:31</p> <p>incident 53% contained.</p> <![cdata[<p>the american fire burning in heavy fuels on extreme slopes 10 air miles northeast of community of foresthill, california, , 8 air miles south of interstate 80 has grown 14,765 acres.</p> <p><strong>the public invited american fire update meeting @ foresthill veteran's memorial hall @ 24601 harrison street in foresthill beginning @ 7 p.m. tonight.</strong></p> <p>heavy smoke shaded fire yesterday, moderating fire behavior. backing fire single , group tree torching observed. on northeast corner spot fire contained firefighters made progress hand lines , dozer lines. along eastern portion of fire last night, firefighters conducted firing operation, meaning used fire reduce unburned fuel between fire line , main fire. center portion of east flank still active during day, indirect containment lines remained secure. on extreme south end, firefighters begin building steep hand line today, descends river. west side of fire relatively inactive. mop-up occurring in area, involves checking interior of fire ensure no hot spots remain may threaten containment lines.</p> <p>firefighters continue concerned dry fuels have not seen fire in on century, winds on 5 m.p.h. , rolling burning debris, of cause rapid spread of fire.</p> <p>the national weather service has issued red flag warning fire area beginning @ 11 a.m. today , extending through 11 p.m. wednesday. warning due threat of abundant lightning , gusty, erratic outflow winds. significant rainfall , flooding in , around fire possible on next 3 days.</p> <p>the robinson flat campground closed. tahoe national forest has issued voluntary evacuation notice big oak flat located near south end of fire. forest road 43 (robinson flat road) closed @ intersection forest road 96 (mosquito ridge road).</p> <p>an emergency closure order in place portions of national forest system lands within , adjacent american fire. map , description of closed area can obtained @ tahoe national forest offices online @ <a href="http://www.fs.usda.gov/tahoe">http://www.fs.usda.gov/tahoe</a>. portions of foresthill divide road closed.</p> <p><strong>at 6 a.m. today, management of fire transferred california interagency management team 4.</strong></p> <p>firefighter , public safety highest priority.</p>]]> <p> <a href="http://inciweb.nwcg.gov/incident/3624/">view american wildfire web site</a> </p> <p> <strong>note: </strong> fire perimeters , points approximations.</p> </description>
when parse it, can information within cdata area, rest of ignored. parsing , putting text view so:
description.settext(extras.getstring("desc"));
i using android query , can have format no problem this:
aq.id(r.id.description).text(html.fromhtml(extras.getstring("desc")));
however, same issue, getting cdata info. log.v() shows info between cdata. guess need escape somehow? why text outside of cdata being ignored?
thanks thanks
just change
if(child.getnodetype() == node.text_node)
to
if (child.getnodetype() == node.cdata_section_node || child.getnodetype() == node.text_node)
in xmlparser.java file.
Comments
Post a Comment