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 ......
包位置:android.widget.TextView
XML Attributes
Attribute Name Related Method &n ......
XML的全称Extensible Markup Language,意思是可扩展的标记语言,是标准通用标记语言SGML(Standard Generalized Markup Language)的一个子集。1998年2月,W3C发布了XML1.0标准,其目的是为了在Web上能以现有的超文本标记语言HTML的使用方式提供,接收和处理通用的SGML。XML是SGML的一个简化子集,它以一种开放的,自我描述的 ......
不解释了,自己看代码吧.......................
using System;
using System.Text;
using System.Data;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Web;
using System.Web.UI;
using System.Xml;
namespace Gogofly.CommonOperation
{
/// <summary>
/// ......