ZuoAndroid / android-query

Automatically exported from code.google.com/p/android-query
0 stars 0 forks source link

XmlData CDATA Issue #153

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi Peter, strange stuff with CDATA, but otherwise, seems to work really well. 

If there is cdata in there, unless i use: XmlDom description = 
xml.tag("Placemark").child("description"); and then description.toString(); all 
I get is the cdata info, if there is cdata in there. I am going to try and 
ignore the cdata if it's there. Is there a setting somewhere that says If there 
is Cdata, only parse it?

Here is what is in description: 

<description>
<p>
<strong> Last updated:</strong>
 Tue, 20 Aug 2013 09:52:13 </p>
<p> Incident is 0% contained.</p>
<![CDATA[<p align="LEFT">Crews made good progress today, Monday, August 19, 
2013, on the east flank with the support of helicopters from other active fires 
in the area.</p> <p>There are currently 7 engines, 1 bulldozer, 2 helicopters, 
and 70 firefighters engaged in managing the fire. </p> <p>The Stoner Creek Fire 
was detected Sunday, August 18 about 6:00 pm and is located west of Lakeside, 
MT along the Blacktail Road. Current fire size is estimated at 100 acres. The 
fire is on Plum Creek land with fire protection by USDA-Forest Service, 
Flathead National Forest, Swan Lake Ranger District. The fire is burning to the 
east of an area burned by the 2009 Baldy Fire. Firefighters are focusing on the 
eastern edge of the fire to reduce spread toward structures. The closest 
structure is approximately one-quarter mile from the fire’s edge.</p> 
<p>Homeowners can use the Blacktail Road for access to their property. Other 
drivers are asked to avoid using the road because of the additional fire 
traffic.</p>]]>
<p>
<a href="http://inciweb.nwcg.gov/incident/3673/"> View Stoner Creek Fire 
Wildfire web site</a>
</p>
<p>
<strong> NOTE: </strong>
 All fire perimeters and points are approximations. </p>
</description>

If you use the for loop and use entry.text('description') all you get returned 
is the cdata info. It looks great, but misses all the other things in between 
the description tags like.

If there is a way I can help with making XPATH work with AQ, I'd give it a 
stab, I am fairly new to this, but... :)

thanks again,
Jason

Original issue reported on code.google.com by tinyeeliu@gmail.com on 20 Aug 2013 at 3:56

GoogleCodeExporter commented 8 years ago
It will read the entire <description>, but only show the cdata IF cdata is in 
there. Might be something with the aq.id(R.id.tv).text()?

Original comment by jason.j....@gmail.com on 26 Aug 2013 at 3:16