XML 命名空间NameSpace
XML 命名空间提供了一种避免元素命名冲突的方法。
--------------------------------------------------------------------------------
命名冲突
因为XML文档中使用的元素不是固定的,那么两个不同的XML文档使用同一个名字来描述不同类型的元素的情况就可能发生。而这种情况又往往会导致命名冲突。请看下面两个例子
这个 XML 文档在table元素中携带了水果的信息:
<table>
<tr>
<td>Apples</td>
<td>Bananas</td>
</tr>
</table>
这个 XML 文档在table元素中携带了桌子的信息(家具,不能吃的哦):
<table>
<name>African Coffee Table</name>
<width>80</width>
<length>120</length>
</table>
如果上面两个XML文档片断碰巧在一起使用的话,那么将会出现命名冲突的情况。因为这两个片断都包含了<table>元素,而这两个table元素的定义与所包含的内容又各不相同。
--------------------------------------------------------------------------------
使用前缀解决命名冲突问题
下面的XML文档在table元素中携带了信息:
<h:table>
<h:tr>
<h:td>Apples</h:td>
<h:td>Bananas</h:td>
</h:tr>
&nbs
相关文档:
问题描述:
jboss应用服务器,使用spring
无法启动服务,错误日志:
[org.apache.xerces.jaxp.DocumentBuilderFactoryImpl@155d3a3] does not
support XML Schema. Are you running on Java 1.4 or below with Apache
Crimson? Upgrade to Apache Xerces (or Java 1.5) for full XSD ......
奋斗了将近一个月移植gloox库到brew平台,在xml解析的准备这边花了不少时间。期间也重新封装了标准库的string、map、list类,现在回头想想收获还是蛮大的,但是貌似是无用的。
gloox从0.9版本开始就no dependency on iksemel anymore,而iksemel最初是专门为jabber写的xml解析器,这么看来,对这个时间非常紧迫的项目来说� ......
创建XML文件:
public boolean createXML(){
try{
Document doc = DocumentHelper.createDocument();
Element root = doc.addElement("root");
Element personNode = root.addElement("person");
Element sonNode = personNode ......
/*
* 主要作用;
* 从xml读取游戏配置信息或保存
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Forms;
using System.IO;
using System.Xml;
using System.Reflection;
namespace Game
{
class Config
{
Ke ......