ArrayList从xml读取数据
ArrayAdapter adapter =
ArrayAdapter.createfromResource(
this,
R.array.catalog,
android.R.layout.simple_list_item_1);
this.setListAdapter(adapter);
xml文件
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="catalog">
<item>文学书籍</item>
<item>艺术书籍</item>
<item>技术书籍</item>
</string-array>
</resources>
相关文档:
需要dom4j.jar文件 ,自行下载。 test.xml 1: <?xml version="1.0" encoding="gbk"?>
2:
3: <students>
4: <person sex="男" age="21">
5: <id>1</id>
6: <name>章治鹏</name>
7: <homepage&g ......
Introduction to XML and XML With Java
If you are looking for sample programs to parse a XML file using DOM/SAX parser or looking for a program to generate a XML file please proceed directly to programs.
This small tutorial introduces you to the basic concepts of XML and using Xer ......
SQLServer2005分解并导入xml文件 收藏
测试环境SQL2005,windows2003
DECLARE @idoc int;
DECLARE @doc xml;
SELECT @doc=bulkcolumn from OPENROWSET(
BULK 'D: \test.xml',
SINGLE_BLOB) AS x
EXEC sp_xml_preparedocument @Idoc OUTPUT, @doc
......
原文:使用 MSXML 分析器处理 XML 文档
#include <atlbase.h>
#include <iostream>
using namespace std;
//<?xml version="1.0"?>
//<xmldata>
//<xmlnode />
//<xmltext>Hello, World!</xmltext>
//</xmldata>
void main ......
如果要完整的支持XML over TCP,只有两种办法:
1,加一个header去标明数据的长度
2,加一个delimiter去标明数据的结束
这两种方法都不够优雅。我们不需要一个通用的方法,我们只要一个最适合我们的方法。
通常,我们能够自定义数据的格式,而且我们通常一条消息只有一个root node,那么我们可以试试下面的函数:
//re ......