Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : xml

xml ÉùÃ÷¡¾×¢ÊÍ¡¿ Òý·¢µÄÒì³£


xml -ÉùÃ÷-Òý·¢µÄÒì³£
XML ÉùÃ÷ [XML ±ê×¼]
XML ÉùÃ÷ͨ³£ÔÚ XML ÎĵµµÄµÚÒ»ÐгöÏÖ¡£XML ÉùÃ÷²»ÊDZØÑ¡Ïµ«ÊÇÈç¹ûʹÓà XML ÉùÃ÷£¬±ØÐëÔÚÎĵµµÄµÚÒ»ÐУ¬Ç°Ãæ²»µÃ°üº¬ÈκÎÆäËûÄÚÈÝ»ò¿Õ°×¡£
ÎĵµÓ³ÉäÖÐµÄ XML ÉùÃ÷°üº¬ÏÂÁÐÄÚÈÝ£º
°æ±¾ºÅ <?xml version="1.0"?>¡£
ÕâÊDZØÑ¡Ïî¡£¾¡¹ÜÒÔºóµÄ XML °æ±¾¿ÉÄÜ»á¸ü¸Ä¸ÃÊý×Ö£¬µ«ÊÇ 1.0 Êǵ±Ç°µÄ°æ±¾¡£
±àÂëÉùÃ÷ <?xml version="1.0" encoding="UTF-8"?>¡£
ÕâÊÇ¿ÉÑ¡Ïî¡£Èç¹ûʹÓñàÂëÉùÃ÷£¬±ØÐë½ô½ÓÔÚ XML ÉùÃ÷µÄ°æ±¾ÐÅÏ¢Ö®ºó£¬²¢ÇÒ±ØÐë°üº¬´ú±íÏÖÓÐ×Ö·û±àÂëµÄÖµ¡£
XML ÉùÃ÷»¹¿ÉÒÔ°üº¬¶ÀÁ¢ÉùÃ÷£¬ÀýÈç <?xml version="1.0" encoding="UTF-8" standalone="yes"?>¡£Óë±àÂëÉùÃ÷ÀàËÆ£¬¶ÀÁ¢ÉùÃ÷Ò²ÊÇ¿ÉÑ¡Ïî¡£Èç¹ûʹÓöÀÁ¢ÉùÃ÷£¬±ØÐëÔÚ XML ÉùÃ÷µÄ×îºó¡£
------------------------------------------------------------------------------------------------------------------------------------
×¢ÒâÔÚʹÓà java (org.apache.common.digester..)µÄʱºò£¬ Èç¹û xml  ÉùÃ÷Ç°¼ÓÓÐ×¢ÊÍ£º
½«Å׳öÈçÏ Òì³££º
The   processing   instruction   target   matching   "[xX][mM][lL]" ......

ÓÃjdomʵÏÖ½«Êý¾Ý¿â×ÊÁÏÉú³ÉxmlÎļþ

½ñÌìµÄÏîÄ¿Ä£¿éÖÐÓõ½¸ù¾ÝÊý¾Ý¿âÀïµÄ×ÊÁÏÉú³ÉxmlÎļþ£¬Ö÷Òª²½ÖèÈçÏ£º
£¨1£© Á¬½ÓÊý¾Ý¿â£¬È¡³öÊý¾Ý£»
£¨2£© ´´½¨½áµã£¬Ìí¼Ó×ÓÏ
£¨3£© дÈëÎļþ“test.xml”ÖУ»
¾ßÌå´úÂëÈçÏ£º
import java.io.FileOutputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.output.XMLOutputter;
public class CreateXml {
 /**
  * @param args
  * @throws ClassNotFoundException
  * @throws SQLException
  */
 public static void main(String[] args) throws ClassNotFoundException,SQLException {
  
  Class.forName("com.mysql.jdbc.Driver");
  Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/lalayi?user=root&password=root");
  Statement stmt = conn.createStatement();
  ResultSet rs = stmt.executeQuery("select * from stor ......

TinyXML(C++ XML½âÎö¿â)

дһ¸öXMLÎļþ TinyXML ÊÇÒ»¸öminiµÄC++ XML½âÎö¿â,ËüÊÇ·ÇÑéÖ¤µÄ,Ëü¿ÉÒÔºÜÈÝÒ׵ļ¯³Éµ½ÆäËûµÄ³ÌÐòÖÐ.Ëü½âÎöÒ»·ÝXML doc,ÒÔ´Ë´´½¨Ò»¸ö¿ÉÒÔ±»¶Á¡¢Ð´£¬±£´æµÄDOM.ËüÖ÷ÒªµÄÀà²ã´Î¼Ü¹¹£¬º¯ÊýÔ­ÐÎÏêϸ˵Ã÷²Î¿´: http://www.grinninglizard.com/tinyxml/index.html
// ÒÔÏÂÒÔ¼òµ¥µÄ³ÌÐòTinyXMLTestΪÀý TinyXMLÖÐ×î¸ù±¾µÄ¾ÍÊÇDocument£¬ËùÒÔÎÞÂÛÊÇÐèҪдһ¸öXMLÎļþ£¬»¹ÊÇÒª¶Á£¬¶¼±ØÐë´ÓÒ»¸öDocument¿ªÊ¼,¾ÍÊÇ(1)µÄ¶¯×÷,ÔÚ´ËûÓиø¹¹Ô캯ÊýÒ»¸ö²ÎÊýÊÇÒòΪÎÒÃǵÄÄ¿µÄÊÇΪÁËд³öÒ»¸öXMLÎļþ£¬ÎļþµÄÃû×Ö¾ÍÊÇ´«¸øTiXmlDocumentµÄ²ÎÊý¡£ÉùÃ÷£¬Îĵµ£¬×¢ÊÍ£¬Îı¾,ÔªËØ£¬²»Ã÷ÀàÐͶ¼ÊÇTinyXmlNodeµÄ×ÓÀ࣬¶¼ÊÇÒ»¸öNode,TinyXmlNodeÊÇÒ»¸öºÜ¸´ÔӵĶ«Î÷£¬ËüÈçÉÏËùʾ:
#include
#include "tinyxml.h"
using namespace std;
int main(int argc, char** argv)
{
// (1) create a XML document
TiXmlDocument *myDoc = new TiXmlDocument();
DocumentÀàÐ͵Ľڵ㽨Á¢ºÃÒԺ󣬾ÍÐèÒª¸ø¸Ã£Ä£Ï£ÍÊ÷½á¹¹Ò»¸ö¸ù,¼´ÏÂÃæµÄ(2),(3),(5),ÓÉÓÚTinyXmlÊÇ·ÇÑéÖ¤µÄ£¬ËùÒÔÀíÂÛÉÏËûÊÇ¿ÉÒÔÓÐÁ½¸öDocumentµÄ£¬£¨ÔÚÄÚ²¿Í¨¹ý¶ÔÀàÐ͵ÄÅжÏÀ´±ÜÃâÕâÒ»Çé¿öµÄ·¢Éú£©,ÓÉÓÚ¸ùÊÇÒ»¸öÔªËØ£¬¶øÔªËر¾ÖÊÉϾÍÊÇÒ»¸öÈ ......

TinyXML(C++ XML½âÎö¿â)

дһ¸öXMLÎļþ TinyXML ÊÇÒ»¸öminiµÄC++ XML½âÎö¿â,ËüÊÇ·ÇÑéÖ¤µÄ,Ëü¿ÉÒÔºÜÈÝÒ׵ļ¯³Éµ½ÆäËûµÄ³ÌÐòÖÐ.Ëü½âÎöÒ»·ÝXML doc,ÒÔ´Ë´´½¨Ò»¸ö¿ÉÒÔ±»¶Á¡¢Ð´£¬±£´æµÄDOM.ËüÖ÷ÒªµÄÀà²ã´Î¼Ü¹¹£¬º¯ÊýÔ­ÐÎÏêϸ˵Ã÷²Î¿´: http://www.grinninglizard.com/tinyxml/index.html
// ÒÔÏÂÒÔ¼òµ¥µÄ³ÌÐòTinyXMLTestΪÀý TinyXMLÖÐ×î¸ù±¾µÄ¾ÍÊÇDocument£¬ËùÒÔÎÞÂÛÊÇÐèҪдһ¸öXMLÎļþ£¬»¹ÊÇÒª¶Á£¬¶¼±ØÐë´ÓÒ»¸öDocument¿ªÊ¼,¾ÍÊÇ(1)µÄ¶¯×÷,ÔÚ´ËûÓиø¹¹Ô캯ÊýÒ»¸ö²ÎÊýÊÇÒòΪÎÒÃǵÄÄ¿µÄÊÇΪÁËд³öÒ»¸öXMLÎļþ£¬ÎļþµÄÃû×Ö¾ÍÊÇ´«¸øTiXmlDocumentµÄ²ÎÊý¡£ÉùÃ÷£¬Îĵµ£¬×¢ÊÍ£¬Îı¾,ÔªËØ£¬²»Ã÷ÀàÐͶ¼ÊÇTinyXmlNodeµÄ×ÓÀ࣬¶¼ÊÇÒ»¸öNode,TinyXmlNodeÊÇÒ»¸öºÜ¸´ÔӵĶ«Î÷£¬ËüÈçÉÏËùʾ:
#include
#include "tinyxml.h"
using namespace std;
int main(int argc, char** argv)
{
// (1) create a XML document
TiXmlDocument *myDoc = new TiXmlDocument();
DocumentÀàÐ͵Ľڵ㽨Á¢ºÃÒԺ󣬾ÍÐèÒª¸ø¸Ã£Ä£Ï£ÍÊ÷½á¹¹Ò»¸ö¸ù,¼´ÏÂÃæµÄ(2),(3),(5),ÓÉÓÚTinyXmlÊÇ·ÇÑéÖ¤µÄ£¬ËùÒÔÀíÂÛÉÏËûÊÇ¿ÉÒÔÓÐÁ½¸öDocumentµÄ£¬£¨ÔÚÄÚ²¿Í¨¹ý¶ÔÀàÐ͵ÄÅжÏÀ´±ÜÃâÕâÒ»Çé¿öµÄ·¢Éú£©,ÓÉÓÚ¸ùÊÇÒ»¸öÔªËØ£¬¶øÔªËر¾ÖÊÉϾÍÊÇÒ»¸öÈ ......

XMLµÚÒ»¿Î

HTML.htmlÎļþ
<div align="center" class="style1">
  <p>±ù¹÷Áбí</p>
  <p></p>
  <table width="400" border="1">
    <tr>
      <th scope="col"><font size="4">Æ·ÅÆ</font></th>
      <th scope="col"><font size="4">ζµÀ</font></th>
      <th scope="col"><font size="4">¼Û¸ñ</font></th>
      <th scope="col"><font size="4">Éú²ú³§ÉÌ</font></th>
    </tr>
    <tr>
      <td><font size="3">´óºì¹û</font></td>
      <td><font size="3">ÖÐ</font></td>
      <td><font size="3">1.0</font></td>
      <td>< ......

XMLµÚ¶þ¿Î

wsdl.xmlÎļþ
<?xml version="1.0" encoding="UTF-8" ?>
<definitions  name="MobilePhoneService"
     targetNamespace="www.mobilephoneservice.com/MobilePhoneService-interface"
     xmlns="http://schemas.xmlsoap.org/wsdl/"
     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
     xmlns:tns="http://www.mobilephoneservice.com/MobilePhoneService"
     xmlns:xsd="http://www.w3.org/1999/XMLSchema">
     <portType name="MobilePhoneService_port">
             <operation name="getListOfModels ">
                     .......
                     .......
      ......

XMLµÚËÄ¿Î

book_schema.xmlÎļþ
<?xml version="1.0" encoding="gb2312"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
 <xs:element name="´ÔÊé">
  <xs:complexType>
   <xs:sequence>
    <xs:element name="Êé">
     <xs:element name="Ãû"  minoccurs="1"></xs:element>
     <xs:element name="ÈË"></xs:element>
     <xs:element name="¼Û">
      <xs:attribute name="unit">
       <xs:enumeration value="RMB"/>
       <xs:enumeration value="ÃÀÔª"/>
       <xs:enumeration value="ÈÕÔª"/>
      </xs:attribute>
     </xs:element>
    </xs:element>
......
×ܼǼÊý:815; ×ÜÒ³Êý:136; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [125] [126] [127] [128] 129 [130] [131] [132] [133] [134]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ