因为实际xml解析操作根据类型有好多,所以想要在解析之前打印parser输入流的内容,同时不影响后续解析。
XmlPullParser parser = Xml.newPullParser(); // 创建一个PULL解析器 InputStream in; in = new ByteArrayInputStream(XmlStr.getBytes("UTF-8")); parser.setInput(in, "UTF-8"); //上述操作在底层库内,截取不到,我能拿到的是setInput后的parser //TODO 获取parser的输入流,即in boolean done = false; while (!done) {//xml解析操作 ...
一般打日志方案
在解析后打印
String name = xmlPullParser.nextText(); people.setName(name); Log.d("test01", name);
Do you want to get xmlstr? If it is the xml string returned by the network request, print the string returned by the network, which should contain xmlstr.