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

¹ýÂËxmlÖеķǷ¨×Ö·û´®


Ò»°ãxmlÖÐÈç¹ûº¬ÓÐ&µÈ×Ö·û£¬¿ÉÒÔͨ¹ýCDATAÀ´¹ýÂË£¬µ«ÊǺ¬ÓÐһЩ²»ÈÏʶµÄÌØÊâ×Ö·ûʱºò¾Í»á²»Æð×÷Óã¬ÏÂÃæÊÇ´Ó±ðÈËÄǶùÄÃÀ´µÄÒ»¸ö¹ýÂË·½
·¨£¬¹ýÂËxmlÖеķǷ¨×Ö·û:
//XML±ê×¼¹æ¶¨µÄÎÞЧ×Ö½ÚΪ£º
/*
0×00 – 0×08
0×0b – 0×0c
0×0e – 0×1f
*/
//ËùÒԺܼòµ¥£¬Êä³öµÄʱºò¹ýÂËÕâЩ×Ö·û¾ÍÍòÎÞһʧÁË£¬ÏÂÃæÊÇPHPµÄʵÏÖ¡£
/* PHP ʵÏÖ */
function XmlSafeStr($s)
{
return preg_replace(“/[\\x00-\\x08\\x0b-\\x0c\\x0e-\\x1f]/”,”,$s);
}
W3CµÄXML¹æ·¶ÖйØÓÚ×Ö·ûµÄ¶¨ÒåÇë²Î¿´ÕâÀhttp://www.w3.org/TR/2004/REC-xml-20040204
/#charsets¡£
¹ýÂË·Ç·¨×Ö·û¶ÔÓ¦µÄJava°æ±¾ÈçÏ£º
public
String
filter(
String
s)
{
return
s.replaceAll
(
"[\\
x00-\\
x08\\
x0b-\\
x0c\\
x0e-\\
x1f]"
, ""
)
;
}


Ïà¹ØÎĵµ£º

xmlÎĵµÀí½â

<!DOCTYPE struts PUBLIC
        "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
        "http://struts.apache.org/dtds/struts-2.0.dtd">
xmlѧϰ£ºhttp://www.w3school.com.cn/x.asp ......

xml¼ò¼Ç

SGML¹ýÓÚ¸´ÔÓ£¬¹Ø¼üÖ®´¦»¹ÔÚÓÚÖ÷Á÷ä¯ÀÀÆ÷³§É̲»Ö§³ÖSGML£¬webÓ¦ÓúܺÃ
Little version£ºXML
html => xhtml =>xml¿ÉÒÔÀí½â³ÉÊÇÒ»¸ö¹ý¶ÉµÄ¹ý³Ì
SGMLµÄÉè¼ÆÀíÄî¾ÍÊÇ°ÑÎı¾µÄÄÚÈݺÍÑùʽ·Ö¿ª£¬×ÔÈ»xmlÒ²ÊÇÈç´Ë¡£
xmlÒ»°ã°üÀ¨ÒÔÏÂÎļþ£º
DTD-->schema(xsd) ¶¨ÒåÎĵµ½á¹¹µÈ£¨ÄÚÈÝ£©
CSS-->XSLT (Ñùʽ)
xml ---- ......

XmlÖÐSelectSingleNode·½·¨ÖеÄxpathÓ÷¨

×î³£¼ûµÄXMLÊý¾ÝÀàÐÍÓУºElement, Attribute£¬Comment, Text.  
 
   Element, Ö¸ÐÎÈç<Name>Tom<Name>µÄ½Úµã¡£Ëü¿ÉÒÔ°üÀ¨£ºElement, Text, Comment, ProcessingInstruction, CDATA, and EntityReference.  
 
   Attribute, Ö¸ÔÚ<Employee >Ö ......

jaxpÏÂÓÃDOM½øÐÐxmlÎĵµ½âÎö

jaxpÊÇsun¹«Ë¾µÄ½âÎöxmlÎĵµµÄapi,ËûÖ§³ÖÓÃdomºÍsaxÁ½ÖÖ·½·¨½âÎöÒ»¸öxmlÎĵµ.
dom·½·¨ÊǽâÎöÒýÇ潫Õû¸öxmlÎĵµ×°Ôص½ÄÚ´æÖÐ×÷Ϊһ¸ödocument¶ÔÏó,dom·½·¨µÃµ½Ò»¸ö¶ÔÏó¾ÍÖªµÀËùÓеĽڵã
Ôöɾ¸Ä²éºÜ·½±ã,ȱµãÊÇҪװÔØÕû¸öxmlÎĵµ,Èç¹ûxmlÎĵµºÜ´ó,ЧÂʾͱȽϵÍ
sax·½·¨ÊDzÉÓÃʼþ×÷ΪÇý¶¯µÄ,Óöµ½Ò»¸ö±êÇ©ÊÇÒ»¸öʼþ,¶Áµ½±ê ......

ÓÃWebService´«µÝXMLÊý¾Ý

WebService£¬¼òµ¥Ò»µã˵£¬¾ÍÊǸö¶ÔÍâµÄ½Ó¿Ú,ÀïÃæÓк¯Êý¿É¹©Íⲿ¿Í»§µ÷ÓÃ(×¢Òâ:ÀïÃæͬÑùÓпͻ§²»¿Éµ÷Óõĺ¯Êý).¼ÙÈôÎÒÃÇÊÇ·þÎñ¶Ë,ÎÒÃÇдºÃÁ˸öwebservice,È»ºó°ÑËü¸øÁË¿Í»§(ͬʱÎÒÃǸøÁËËûÃǵ÷ÓùæÔò),¿Í»§¾Í¿ÉÒÔÔÚ´Ó·þÎñ¶Ë»ñÈ¡ÐÅϢʱ´¦ÓÚÒ»¸öÏà¶Ô͸Ã÷µÄ״̬.¼´ÊÇ¿Í»§²»Á˽â(Ò²²»ÐèÒª)Æä¹ý³Ì,ËûÃÇÖ»»ñÈ¡Êý¾Ý. Webservice´«µ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ