亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

PHP ???? ?? XML ? DOM ??

1.DOM??

W3C DOM? HTML ? XML ??? ?? ?? ?? ??? ?? ??? ??? ????? ???? ?? ??? ?????. .
W3C DOM? ??? ??(Core, XML ? HTML)? ??? ??(DOM ?? 1/2/3)? ?????.
* Core DOM - ?? ???? ??? ??? ???? ?? ?? ??
* XML DOM - XML ????? ?? ?? ?? ??
* HTML DOM - HTML ??? ?? ?? ?? ??

2.xml ?? ??

XML ??? ?? ????(?? ? ??)??? XML ??? ?????.

XML ???? ? ?? ?? ??? ????.

· ?? ?? ??: ? ??? XML ??? ?? ??? ?????. ?? ??? ???? DOM(?? ?? ??)? ?? ??? ??? ?? ???? ?????.

· ?? ?? ??: XML ??? ??? ???? ?????. ?? ???? ???? ??? ?? ???? ??? ?????.

DOM ??? ?? ?? ?????

?? xml ?? ??? ???

<?xml version="1.0" ???="ISO-8859 - 1"?>
<from>Jani</from>

XML DOM ?? XML? ?? ??? ?????.

?? 1: XML document

?? 2: ?? ??: <from>

?? 3: ??? ??: "Jani"

????:

??

<?xml version="1.0" encoding="ISO-8859-1"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>

??? ???? xml ?? head.xml? ?????. ?? ??

<?php
	$xmlDoc = new DOMDocument();
	$xmlDoc->load("head.xml");
	print $xmlDoc->saveXML();
?>

xml traverse ??? ???? php ??? ?????. ??>

?? XML ??? head.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>

? ?? ?? PHP ??? ????. ??? ??? ????.

<?php
	$xmlDoc = new DOMDocument();
	$xmlDoc->load("head.xml");
	$x = $xmlDoc->documentElement;
	foreach ($x->childNodes AS $item){
		print $item->nodeName . " = " . $item->nodeValue . "<br>";
	}
?>


???? ??
||
<?xml version="1.0" encoding="ISO-8859-1"?> <note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> </note>