XML 实体引用
在 XML 中,一些字符拥有特殊的意义。
如果你把字符 "<" 放在 XML 元素中,会发生错误,这是因为解析器会把它当作新元素的开始。
这样会产生 XML 错误:
<message>if salary < 1000 then</message>
为了避免这个错误,用一个实体引用来代替 "<" 字符:
<message>if salary < 1000 then</message>
在 XML 中,有 5 个预定义的实体引用:
<
<
小于
>
>
大于
&
&
和号
'
'
单引号
"
"
引号
注释:在 XML 中,只有字符 "<" 和 "&" 确实是非法的。大于号是合法的,但是用实体引用来代替它是一个好习惯。
相关文档:
Retrieving an XML document using Ajax
http://www.javascriptkit.com/dhtmltutors/ajaxgetpost3.shtml
When making a server request in Ajax, the data returned can be in either
plain text/html, or an XML document instead. The later is technically
just a text file as well, but with s ......
在前面我们学习了使用Glib的高程捆绑方式的method的收发,现在学习singal的收发,xml例子如下
<?xml version="1.0" encoding="UTF-8" ?>
<node name="/com/wei/MyObject">
<interface name="com.wei.MyObject.Sample">
< ......
创建可序列化的类,或者创建用于处理 XML 序列化类的类。 如果您拥有描述要加载或保存的 XML 文件格式的 XML 架构定义 (XSD),请使用 Xsd.exe 工具自动创建这些类。 还可以手动创建这些类。 若要使用 Xsd.exe 工具创建可序列化的类,请按照下列步骤操作:
将以下描述订单的 XSD 架构保存为 Po.xsd 文件:
<xsd:sche ......
Create:
int nFQ;
XmlDocument doc = new XmlDocument();
XmlAttribute
newAtt;
//定义XML文档头文件
XmlDeclaration dec =
doc.CreateXmlDeclaration("1.0",null,null);
doc.AppendChild(dec);
&n ......
在XML文件中读取属性文件(.properties)中的元素值:
web.xml
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/conf/dataAccessContext.xml</param-value>
</context-param>
<listener>
<listener-class>
......