On Sun, Mar 15, 2009 at 4:09 AM, nowb <[email protected]> wrote:
> I need to know if there is a way to reach the
> org.apache.harmony.xml.dom package. Or if there are some substitute
> for ElementImpl that I can use.
This works for me:
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
...
public void fromStream(InputSource input) {
DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
try {
DocumentBuilder parser = factory.newDocumentBuilder();
xml = parser.parse(input);
} catch (Exception e) {
notXML();
}
Element root = xml.getDocumentElement();
if (root == null)
notXML();
String local = root.getLocalName();
... etc
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---