XML ³£Ó÷½·¨¼¯
ÏÂÃæµÄ±í¸ñÁгöÁË°üº¬ÔÚDOM Level 1Öеķ½·¨£¬²¢Áгö²»Í¬µÄä¯ÀÀÆ÷ÊÇ·ñÖ§³ÖÏî¡£
·½ ·¨
Ãè Êö
IE
MOZ
OP
SAF
createAttribute
(name
)
Óøø¶¨Ãû³Æname
´´½¨ÌØÐÔ½Úµã
×
×
×
£
createCDATASection
(text
)
Óðüº¬Îı¾
text
µÄÎı¾×Ó½Úµã
´´½¨Ò»¸ö
CDATA
Section
£
×
£
£
createComment(text
)
´´½¨°üº¬Îı¾text
µÄ×¢Êͽڵã
×
×
×
×
createDocument
Fragment()
´´½¨ÎĵµËéƬ½Úµã
×
×
×
×
createElement
(tagname
)
´´½¨±êÇ©ÃûΪtagname
µÄÔªËØ
×
×
×
×
createEntity
Reference(name
)
´´½¨¸ø¶¨Ãû³ÆµÄʵÌåÒýÓýڵã
£
×
£
£
createProcessing
Instruction(target
,
data
)
´´½¨°üº¬¸ø¶¨target
ºÍdata
µÄPI
½Úµã
£
×
£
£
createTextNode(text
)
´´½¨°üº¬Îı¾text
µÄÎı¾½Úµã
×
×
×
×
×¢£ºIE = Windows
µÄIE 6
£»MOZ =
ÈÎÒâƽ̨µÄMozilla 1.5
£»OP=
ÈÎÒâƽ̨µÄOpera 7.5
£»SAF=MacOS
µÄSafari 1.2
ÒÔÏÂΪNode½Úµã·½·¨:
ÌØÐÔ
/
·½·¨
ÀàÐÍ
/
·µ»ØÀàÐÍ
˵
Ã÷
nodeName
String
½ÚµãµÄÃû×Ö£»¸ù¾Ý½ÚµãµÄÀàÐͶø¶¨Òå
nodeValue
String
½ÚµãµÄÖµ£»¸ù¾Ý½ÚµãµÄÀàÐͶø¶¨Òå
nodeType
Number
½ÚµãµÄÀàÐͳ£Á¿ÖµÖ®Ò»
ownerDocument
Document
Ö¸ÏòÕâ¸ö½ÚµãËùÊôµÄÎĵµ
firstChild
Node
Ö¸ÏòÔÚ
childNodes
ÁбíÖеĵÚÒ»¸ö½Úµã
lastChild
Node
Ö¸ÏòÔÚ
childNodes
ÁбíÖеÄ×îºóÒ»¸ö½Úµã
childNodes
NodeList
ËùÓÐ×Ó½ÚµãµÄÁбí
previousSibling
Node
Ö¸ÏòÇ°Ò»¸öÐֵܽڵ㣻Èç¹ûÕâ¸ö½Úµã¾ÍÊǵÚÒ»¸öÐֵܽڵ㣬ÄÇô¸ÃÖµ
Ϊ
null
nextSibling
Node
Ö¸ÏòºóÒ»¸öÐֵܽڵ㣻Èç¹ûÕâ¸ö½Úµã¾ÍÊÇ×îºóÒ»¸öÐֵܽڵ㣬ÄÇô¸Ã
ֵΪ
null
hasChildNodes()
Boolean
µ±
childNodes
°üº¬Ò»¸ö»ò¶à¸ö½Úµãʱ£¬·µ»ØÕæ
attributes
NamedNodeMap
°üº¬ÁË´ú±íÒ»¸öÔªËصÄÌØÐÔµÄ
Attr
¶ÔÏó£»½öÓÃÓÚ
Element
½Úµã
appendChild(node
)
Node
½«
node
Ìí¼Óµ½
childNodes
µÄĩβ
removeChild(node
)
Node
´Ó
childNodes
ÖÐɾ³ý
node
replaceChild
(newnode
, oldnode
)
Node
½«
Ïà¹ØÎĵµ£º
ÉùÃ÷¶ÔÏóʵÀý
var xmlhttp = false;
//²úÉúÒ»¸öXMLHttpRequest¶ÔÏóʵÀý
getHTTPRequestObject();
function getHTTPRequestObject()
{
try
{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
try
{
xmlhttp = new ActiveXObject("Micr ......
¡¡¡¡ÔÚƽʱ¹¤×÷ÖУ¬ÄÑÃâ»áÓöµ½°Ñ XML ×÷ΪÊý¾Ý´æ´¢¸ñʽ¡£Ãæ¶ÔÄ¿Ç°ÖÖÀà·±¶àµÄ½â¾ö·½°¸£¬Äĸö×îÊʺÏÎÒÃÇÄØ£¿ÔÚÕâƪÎÄÕÂÖУ¬ÎÒ¶ÔÕâËÄÖÖÖ÷Á÷·½°¸×öÒ»¸ö²»ÍêÈ«ÆÀ²â£¬½ö½öÕë¶Ô±éÀú XML Õâ¿éÀ´²âÊÔ£¬ÒòΪ±éÀú XML Êǹ¤×÷ÖÐʹÓÃ×î¶àµÄ£¨ÖÁÉÙÎÒÈÏΪ£©¡£
¡¡¡¡Ô¤ ±¸
¡¡¡¡²âÊÔ»·¾³£º
¡¡¡¡AMD ¶¾Áú1.4G OC 1.5G¡¢256M DDR333¡¢Wind ......
ÕâÊÇÒ»¸öÓÃJAVA W3C DOM ½øÐÐXML²Ù×÷µÄÀý×Ó£¬°üº¬Á˲éѯ¡¢Ôö¼Ó¡¢Ð޸ġ¢É¾³ý¡¢±£´æµÄ»ù±¾²Ù×÷¡£½ÏÍêÕûµÄÃèÊöÁËÒ»¸öXMLµÄÕû¸ö²Ù×÷Á÷³Ì¡£ÊʺϸÕÈëÃÅJAVA XML²Ù×÷µÄÅóÓѲο¼ºÍѧϰ¡£
¼ÙÉèÓÐXMLÎļþ£ºtest1.xml
<?xml version="1.0" encoding="UTF-8"?>
<books>
<book>
<name>¹þÀï²¨Ì ......
Xml, xslt, xsd, xpathÃèÊöÒ»ÏÂ
XML: Extensible Markup LanguageÀ©Õ¹±ê¼ÇÓïÑÔ£¬ÓÃÀ´´¦Àí½á¹¹»¯Îĵµ¡£
XSLT: XSL Transformations¡£ÓÃÀ´½«Ò»ÖÖXMLת»»³ÉÁíÍâÒ»ÖÖXMLÎĵµ¡£Ò²¿ÉÒÔ½«XMLת»»³ÉXHTML»òÕßHTMLÔÚä¯ÀÀÆ÷ÖÐÏÔʾ¡£
XSD: XML Schemas Definition¡£ÓÃÀ´¶¨ÒåXMLÎĵµµÄ½á¹¹¡£XML Schema ÊÇDTD(Document Type Definiti ......
£¨µÚ1Õ£©
(P1~3)1£®ÓÃ×Ô¼ºµÄÓïÑÔ¶ÔSGML¡¢HTMLºÍXML×÷¼òµ¥½éÉܺͶԱȡ£
SGML ÊÇÒ»ÖÖ²ÉÓñê¼ÇÀ´ÃèÊöÎĵµÊý¾ÝµÄͨÓÃÓïÑÔ£¬SGML¶¨ÒåÁË»ù±¾µÄÓï·¨ºÃ£¬Í¬Ê±Ò²ÔÊÐíÓû§½¨Á¢×Ô¼ºµÄÔªËرê¼Ç¡£
HTML ²ÉÓÃÁ˺ÜСһ²¿·ÖSGMLµÄ±ê¼Ç£¬Í¬Ê±HTML²ÉÓõÄÊǹ̶¨±ê¼ÇÒ²²»ÐèÒª°üº¬DTD¡£
XML ͬHTMLÒ»Ñù£¬¶¼Êdzö×ÔÓÚSGML±ê׼ͨÓñê¼ÇÓï ......