XML特殊字符
一些字符在 URL 或 XML 文档中使用时有特殊的含义,因此必须针对这些含义对字符做适当编码以使其生效。
URL 中的特殊字符
在 URL 上执行的查询中,特殊字符被指定为 %xx,其中 xx 是字符的十六进制值。下表列出了这些特殊字符并描述了它们的含义。有关更多信息,请参见 http://www.faqs.org/rfcs/rfc1738.html 中的 RFC1738 规范。
特殊字符
特殊含义
十六进制值
+
表示空格(在 URL 中不能使用空格)。
%2B
/
分隔目录和子目录。
%2F
分隔实际的 URL 和参数。
%3F
%
指定特殊字符。
%25
#
表示书签。
%23
&
URL 中指定的参数间的分隔符。
%26
例如,考察下面的查询:
SELECT *
from Employees
WHERE EmployeeID=
因为 字符在 URL 中有特殊含义(分隔 URL 和传递的参数),所以在 URL 中指定该查询时,该字符被编码为 %3F。
下列 URL 将执行该查询。在 URL 中传递该参数值。
http://IISServer/nwindsql=SELECT * from Employees WHERE EmployeeID=%3F FOR
XML AUTO&root=root&EmployeeID=1
浏览器将 右侧的所有特殊字符(如 + 字符)都进行转义(即,将 右侧的 + 字符转换成 %20)。
XML 中的特殊字符
> 和 < 这类字符是XML 标记字符,在 XML 中有特殊的含义。当在 SQL 查询(或 XPath 查询)中指定这些字符时,
必须对它们进行适当的编码(也称为实体编码)。下表列出了这些特殊字符并描述了它们的含义。有关更多信息,请参见
XML 1.0 规范 中的 XML 1.0 规范。
相关文档:
Paul.Todd | 09 April, 2007 15:24
I have noticed a couple of people seem to be having problems with using the XML parser in Symbian and there are no examples outside of the devkit. The parser I will be talking about is the xml one, not the one SOAP engine as the SOAP one is Nokia specific.
The ke ......
antonypr | 14 April, 2007 00:05
A couple of weeks ago, I had a plan to write an article and example code of using XML parser in Symbian OS. It seems that another Forum Nokia Champion, Paul Todd had the same idea. He posted a nice article about XML parser in Symbian OS 9.x to Forum Nokia Blogs. It's ......
[Bug 230608] missing config.h in latest -14
Ralf Corsepius rc040203 at freenet.de
Tue Mar 6 13:31:13 UTC 2007
Previous message: [Bug 230608] missing config.h in latest -14
Next message: [Bug 230608] missing config.h in latest -14
Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] ......
前提:1.Jdom的架构已经导入
步骤:
用JDOM读取XML文件需先用org.jdom.input.SAXBuilder对象的build()方法创建Document对象,
然后用Document类、Element类等的方法读取所需的内容。
<?xml version="1.0" encoding="UTF-8"?>
<HD>
<disk name="C">
<capacity>8 ......
(一) 先讲一下XML中的物殊字符,手动填写时注意一下。
字符 字符实体
& &n ......