I use the following code to create SAXParser:
/* Get a SAXParser from the SAXPArserFactory. */
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser sp = spf.newSAXParser();
/* Get the XMLReader of the SAXParser we created. */
XMLReader xr = sp.getXMLReader();
//xr.setFeature("http://xml.org/sax/features/namespaces",
true);
//xr.setFeature("http://xml.org/sax/features/namespace-
prefixes", false);
/* Create a new ContentHandler and apply it to the XML-
Reader*/
StingHandler stingHandler = new StingHandler();
xr.setContentHandler(stingHandler);
Th following is StingHandler's startElement:
public void startElement(String namespaceURI, String localName,
String qName, Attributes atts) throws SAXException {
reportData += namespaceURI + " localName = " + localName + " -->
" + "qName = " + qName + "\n";
// Handle attributes
for (int i=0, len = atts.getLength(); i<len; i++) {
String attLocalName = atts.getLocalName(i);
String attQName = atts.getQName(i);
String sting = atts.getURI(i) + " " + "attQName = "
+ attQName + " --> " + "attLocalName = " + attLocalName;
reportData += sting + "\n";
}
}
the element qName & attribute qName reports correctly on SDK 0.9,
but in SDK 1.0, qName == ""
Does anyone know how to solve this problem???
it is weird!!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---