Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Ò»¸ö¼òµ¥µÄxmlÀ࣬¿ÉÒÔ½âÎöºÍÉú³ÉxmlÎļþÊý¾Ý

<?php
include('xml.php');
$data = XML_unserialize($xml);
?>
$xml¼´ÊÇxmlÎļþµÄÄÚÈÝ£¬$dataÊǽâÎö³öµÄÊý×飻
<?php
include('xml.php');
$xml = XML_serialize($data);
?>
ÒÔÉÏΪʹÓÃʵÀý£¬·Ö±ð½âÎöxmlÎĵµºÍÉú³Éxml¸ñʽµÄÊý¾Ý
xml.phpÔ´Âë
<?php
###################################################################################
#
# XML Library, by Keith Devens, version 1.2b
# http://keithdevens.com/software/phpxml
#
# This code is Open Source, released under terms similar to the Artistic License.
# Read the license at http://keithdevens.com/software/license
#
###################################################################################
###################################################################################
# XML_unserialize: takes raw XML as a parameter (a string)
# and returns an equivalent PHP data structure
###################################################################################
function & XML_unserialize(&$xml){
$xml_parser = &new XML();
$data = &$xml_parser->parse($xml);
$xml_parser->destruct();
return $data;
}
###################################################################################
# XML_serialize: serializes any PHP data structure into XML
# Takes one parameter: the data to serialize. Must be an array.
###################################################################################
function & XML_serialize(&$data, $level = 0, $prior_key = NULL){
if($level == 0){ ob_start(); echo '<?xml version="1.0" ?>',"\n"; }
while(list($key, $value) = each($data))
if(!strpos($key, ' attr')) #if it's not an attribute
#we don't treat attributes by themselves, so for an empty element
# that has attributes you still need to set the element to NULL
if(is_array($value) and array_key_exists(0, $value)){
XML_serialize($value, $level, $key);
}else{
$tag = $prior_key ? $prior_key : $key;
echo str_repeat("\t", $level),'


Ïà¹ØÎĵµ£º

Jdom½¨Á¢XMLÎļþ


   JDOM ÊÇÒ»¸ö¿ªÔ´µÄ´¿java API,ÓÃÓÚ¿ìËÙ¿ª·¢ XML Ó¦ÓóÌÐò,JDOM½«XMLÎĵµ±íʾΪÊ÷£¬°üÀ¨ÔªËØ¡¢ÊôÐÔ¡¢ËµÃ÷¡¢´¦ÀíÖ¸Áî¡¢Îı¾½Úµã¡¢CDATA¶Î£¬µÈµÈ¡£JDOM¿ÉÒÔËæÊ±·ÃÎÊÊ÷ÖеÄÈÎÒⲿ·Ö¡£Ê÷ÖÐËùÓв»Í¬½Úµã¾ùΪ¾ßÌåµÄÀà¡£ÔÚhttp://jdom.org¿ÉÒÔÏÂÔØJDOMµÄ×îа汾(ÎÒÕâÀïÊÇ1.0)¡£ÏÂÔØºó½âѹ£¬JDOMµÄjarÎļþ¾ÍÊÇbuildÄ ......

ÓÃc¶ÁÈ¡XMLÎļþ

 
¡¡ ¿ÉÒÔ½«XMLÎļþµÄÊ÷(Ö»ÓÐÒ»¸ö¶¥²ã½Úµã).ÓÚÊÇÀíËùµ±È»µÄ¿ÉÒÔÓÃÊ÷×÷ΪXMLµÄÒ»ÖÖ´æ´¢½á¹¹.
ÎÒ½«ÔÚÕâÀïÓÃC++ʵÏÖ¶Ô¼òµ¥µÄXMLÎļþµÄ½âÎö.
1.Ñ¡Ôñ´æ´¢½á¹¹:
Ê÷ÐÍÊý¾Ý½á¹¹ÓжàÖÖ´æ´¢·½Ê½,ÎÒ½«ÓÃ"º¢×ÓÐֵܱíʾ·¨",¶¨ÒåÈçÏÂ:
typedef struct CSNode
{
int subNodes;
string data;
string name;
struct CSNode *fi ......

mssqlÖÐÓÃxmlµÄ·½·¨²ð·ÖÒÔ²»¶¨¿Õ¸ñΪ·Ö¸î·ûºÅµÄ×Ö·û´®

---xml²ð·ÖÒÔ²»¶¨¿Õ¸ñΪ·Ö¸î·ûºÅµÄ×Ö·û´®
--²âÊÔÊý¾Ý
if object_id('[tb]') is not null drop table [tb]
create table [tb]([a] varchar(200))
go
insert [tb]
select 'aaaa  bbbb cccc        dddd'
insert [tb]
select 'eeeeee  ffff hhhh     ......

HTML£¬XHTMLºÍXMLµÄÇø±ð

£¨1£©XML
XMLÊÇThe Extensible Markup Language(¿ÉÀ©Õ¹±êʶÓïÑÔ)µÄ¼òд¡£Ä¿Ç°ÍƼö×ñÑ­µÄÊÇW3CÓÚ2000Äê10ÔÂ6ÈÕ·¢²¼µÄXML1.0£¬²Î¿¼£¨www.w3.org/TR/2000/REC-XML-20001006£©¡£ºÍHTMLÒ»Ñù£¬XMLͬÑùÀ´Ô´ÓÚSGML£¬µ«XMLÊÇÒ»ÖÖÄܶ¨ÒåÆäËûÓïÑÔµÄÓï¡£XML×î³õÉè¼ÆµÄÄ¿µÄÊÇÃÖ²¹HTMLµÄ²»×㣬ÒÔÇ¿´óµÄÀ©Õ¹ÐÔÂú×ãÍøÂçÐÅÏ¢·¢²¼µÄÐèÒª£¬ºó ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ