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
Ïà¹ØÎĵµ£º
ÔÚPerlÖнâÎöXMLµÄ·½·¨×î³£¼ûµÄ¾ÍÊÇʹÓà XML::DOM
ºÍ XML::SimpleÁË¡£
XML::DOM¹ýÓÚÅӴ󣬶øÇÒ½âÎö½á¹ûÊÇÒ»¸öDOMÊ÷£¬²Ù×÷Ò²²»·½±ã¡£
¶ÔÓÚСÐÍÇÒ²»¸´ÔÓµÄXMLÎļþ£¬XML::DOMÕæÊÇɱ¼¦ÓÃÅ£µ¶¡£
Õâʱ¾ÍÂÖµ½Çá±ãµÄXML::SimpleÉϳ¡ÁË¡£
XML::SimpleÈçÆäÃû£¬ÕæµÄºÜ¼òµ¥¡£¼ÙÉèXMLÄÚÈÝÈçÏ£º
<opt>
<user login= ......
/*
* Ö÷Òª×÷ÓÃ;
* ´Ó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 ......
--XQuery »ùÓÚÏÖÓÐµÄ XPath ²éѯÓïÑÔ£¬²¢Ö§³Ö¸üºÃµÄµü´ú¡¢¸üºÃµÄÅÅÐò½á¹ûÒÔ¼°¹¹Ôì±ØÐèµÄ XML µÄ¹¦ÄÜ¡£
--1.ÉùÃ÷Ò»¸ö xml ÀàÐ͵ıäÁ¿£¬È»ºóʹÓà xml Êý¾ÝÀàÐ굀 query() ·½·¨À´²éѯ´Ë±äÁ¿
DECLARE @x xml
SET @x = '<ROOT><a>111</a></ROOT>'
SELECT @x.query('/ROOT/a')
--²éÕÒÊôÐÔaid=20µÄa½ ......
XML ÃüÃû¿Õ¼äÌṩÁËÒ»ÖÖ±ÜÃâÔªËØÃüÃû³åÍ»µÄ·½·¨¡£
--------------------------------------------------------------------------------
ÃüÃû³åÍ»
ÒòΪXMLÎĵµÖÐʹÓõÄÔªËز»Êǹ̶¨µÄ£¬ÄÇôÁ½¸ö²»Í¬µÄXMLÎĵµÊ¹ÓÃͬһ¸öÃû×ÖÀ´ÃèÊö²»Í¬ÀàÐ͵ÄÔªËصÄÇé¿ö¾Í¿ÉÄÜ·¢Éú¡£¶øÕâÖÖÇé¿öÓÖÍùÍù»áµ¼ÖÂÃüÃû³åÍ»¡£Çë¿´ÏÂÃæÁ½¸öÀý×Ó
......