易截截图软件、单文件、免安装、纯绿色、仅160KB

gloox xml的解析模块

gloox自己实现了xml的解析模块,没有用到第三方的库(tinyXML,expat )
主要涉及的文件:
tag.h (tag.cpp)
taghandler.h
parser.h (parser.cpp)
1. Tag一个Tag就是一个XML元素
例如:
a.
<book kind='computer'>
<store id='23'/>
<author>
    qiang
</author>
</book>
b. <book id='32'/>
c. <book>name1</book>
首先介绍一个概念: escape-string,何为escape-string?
在escape-string中:
'&'转换成&amp;, '<'转换成&lt;, '>'转换成&gt;.
编码表如下:
//////////////////////////////////////////////////////////////////////////
// 编码表 (中间的空格去掉,这里只是为了方便显示):
// -------------------------------------------------------
// | 字符     | 十进制 | 十六进制 | THML字符集 | Unicode |
// -------------------------------------------------------
// | " 双引号 | & # 34; | & # x22;   | "          | \u0022 |
// -------------------------------------------------------
// | ' 单引号 | & # 39; | & # x27;   | & apos;     | \u0027 |
// -------------------------------------------------------
// | & 与     | & # 38; | & # x26;   | & amp;      | \u0026 |
// -------------------------------------------------------
// | < 小于号 | & # 60; | & # x3C;   | & lt;       | \u003c |
// -------------------------------------------------------
// | > 大于好 | & # 62; | & # x3E;   | & gt;       | \u003e |
// -------------------------------------------------------
gloox - APIs
Tag::escape()    功能: string -> escape-string
Tag::relax() 功能: escape-string -> string
主要成员变量:
attributes - 所有属性的list
name - 节点名字
cdata - 节点数据,例如<name>cdata</name>中的cda


相关文档:

保存和加载XML文档

标签:数据访问     ADO.NET
      保存和加载XML文档   ......

StAX 生成XML文件

参考:百度百科 http://baike.baidu.com/view/1027076.htm?fr=ala0
在JDK 6.0中基于StAX分析XML数据: http://hi.baidu.com/1shome/blog/item/5baaee01db2609051d958302.html
DOM、SAX
、DOM4J、JDOM、StAX生成XML
并返回XML字符串形式:http://dreams75.javaeye.com/blog/512319
STAX:Streaming API for XML (StAX)
......

asp.net 操作xml文件

using System.Xml;//头部加此命名空间
        XmlDocument xd = new XmlDocument();//表示XML文档
        XmlDeclaration xde;//表示 XML 声明节点:<?xml version='1.0'...?>
        xde = xd.Cre ......

xml读写

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Xml;
using FilmOnLine.Model;
namespace FilmOnLine.DAL
{
public static class FilmService
{
/// <summary>
/// 添加电影
/// </summary ......

四眼看世界 XML语法


XML (EXtensible Markup Language)
XML is a
cross-platform, software and hardware independent tool for transmitting
information.
Prolog
XML
Declaration
Processing
Instructions
DOCTYPE
Declaration
Elements
Attributes
XML
Comments
CDATA
Sections
Character
and Entity Refere ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号