I am using LWUIT for the Series 40 below.
http://projects.developer.nokia.com/LWUIT_for_Series_40
I need to parse a string similar to below:
<key>title</key>
<string><![CDATA[Status[CLOSED]]]></string>
<key>thumbnail</key>
<string><![CDATA[Hello World]]></string>
However, I am unable to receive the correct content in textElement() below
System.out output:
Start tag=key
textElement=title
endTag=key
Start tag=string
textElement=Status[CLOSED]]]></string><key>thumbnail</key><string><![CDATA[Hello World
endTag=string
It seems the end of a CDATA which is a ']]>' pattern could not be detected.
May I know what I do to fix this?
More details about CDATA
http://www.w3schools.com/xml/xml_cdata.asp
Code:import com.sun.lwuit.xml.XMLParser; public class Parser extends XMLParser { protected void attribute(String tag, String attributeName, String value) { super.attribute(tag, attributeName, value); } protected void endTag(String tag) { System.out.println("endTag="+tag); super.endTag(tag); } protected boolean startTag(String tag) { System.out.println("Start tag="+tag); return super.startTag(tag); } protected void textElement(String text) { System.out.println("textElement="+text); super.textElement(text); } }

Reply With Quote

