DTD,XML Schema和Relax NG的比较及相互转化!
比较:
1. DTD
a. 最早的XML Contraint
b. 由W3C定义
C. 非常简单
2. XML Schema
a. 目前应用最广的XML Contraint
b. 由W3C定义
c. 很灵活,但非常复杂
3. Relax NG
a. 是个野孩子,不是由W3C定义
b. 非常非常简单直观
c. 对于需要频繁定义Contraint的Engineer非常合适
相互转化:
1. XML Document -> DTD/XML Schema/Relax NG
Relaxer
2. DTD -> XML Schema
DTD2XD
3. DTD -> Relax NG
Relax Converter
4. XML Schema -> Relax NG
Relax Converter
相关文档:
function init() {
var viewChartID = 0;
var viewChartSum = "" ;
reportName = document.getElementById("reportName").value;
xmlDoc=loadXMLDoc("./charreport/xml/viewChart.xml");
x=xmlDoc.getElementsByTagName('viewChart')[0].childNodes;
for (i=0;i<x.length;i++ ......
/*
* 主要作用;
* 从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 ......
把xml拖到IE里就找到错在哪里了
如下:
The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
文档的顶层无效。处理资源 'file:///D:/Tomcat 5.5/webapps/myapp/WEB-INF/web.xml' 时出错。第 1 行,位置: 44 ......
--A. 从存储在非类型化的 xml 变量中的文档中删除节点
DECLARE @myDoc xml
SET @myDoc = '<?Instructions for=TheWC.exe ?>
<Root>
<!-- instructions for the 1st work center -->
<Location LocationID="10" LaborHours="1.1" MachineHours=".2" >
Some text 1
<st ......
public string ConvertDataTableToXML(DataTable xmlDS)
{
MemoryStream stream = null;
XmlTextWriter writer = null;
try
{
stream = new MemoryStream();
writer = new XmlTextWriter(stream, Encoding.Default);
......