如何分析XML的机器人?机器人、XML

2023-09-04 06:06:05 作者:人丑嘴不甜长得危险还没钱

我有一个XML文档,我想创建,它将分析这是在文档格式字符串的XML并返回字符串的方法。我该怎么办this..Please帮助我,因为我很新的Andr​​oid和XML作为well.Thanks提前。

我试图做这样的事情----

 公共静态字符串getStringFromXML(DOC文件){
字符串数据;
................
................
................
...............
返回的数据;
}
 

解决方案

看看这篇文章有关于如何使用它们SAX,DOM几个例子和PULL解析器

使用XML在Android 工作

KUKA机器人KLI网络分析 KLIconfig.XML

I have an XML Document I want to create a method that will parse the XML which is in Document format to String and return the Strings . How can I do this..Please help me out as I am very new to Android and XML as well.Thanks in advance.

I am trying to do something like this----

public static String getStringFromXML(Document doc){
String data;
................
................
................
...............
return data;
}

解决方案

Look at this article there are several examples on howto use SAX, DOM and PULL parsers

Working with XML on Android