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

ÓÃ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 store");
  try {
   Element root = new Element("µêÃæÀà");
   Document Doc = new Document(root);
   int i = 0;
   while (rs.next()) {
    Element elements = new Element("µêÃæ");
    elements.addAttribute("id","" + i);
    elements.addContent(new Element("µêÃæID").setText(rs.getString(1)));
    elements.addContent(new Element("Ãû³Æ").setText(rs.getString(2)));
    elements.addContent(new Element("ÃÜÂë").setText(rs.getString(3)));
    elements.addContent(new Element("ÓÊÏä").setText(rs.getString(4)));
    elements.addContent(new Element("ÈÕÆÚ").setText(rs.getString(5)));
    elements.addContent(new Element("ÊÖ»ú").setText(rs.getString(6)));
    elements.addContent(new Element("ÊÖ»ú2").setText(rs.getString(7)));
   &nbs


Ïà¹ØÎĵµ£º

spring xmlÖеÄpropery µÄnameÊôÐÔÃû×ÔÀ´Ô´

½ñÌìÔÚÔËÓÃspringµÄPropertyPlaceholderConfigurerʱ·¢ÏÖÒ»¸öÓÐÒâ˼µÄÄÚÈÝ£¬µ±ÄãÔÚapplicationContextÖÐÅäÖÃÒ»¸öPropertyPlaceholderConfigurerµÄbeanʱ£¬ÓÐlocationºÍlocationsµÄÊôÐÔ£¬²»Ã÷˼Òâlocation¶ÔÓ¦Ò»¸ö.propertiesÎļþ£¬
locations¶ÔÓ¦¶à¸ö.propertiesÎļþ£¬³å×ÅÏë¿´Ò»ÏÂPropertyPlaceholderConfigurerµÄʵÏÖ»úÖ ......

ËÄÑÛ¿´ÊÀ½ç XMLÓï·¨


XML (EXtensible Markup Language)
XML is a
cross-platform, software and hardware independent tool for transmitting
information.
Prolog
XML
Declaration
Processing
Instructions
DOCTYPE
Declaration
Elements
Attributes
XML
Comments
CDATA
Sections
Character
and Entity Refere ......

XMLÈëÃŵij£¼ûÎÊÌâ(Ò»)

ʲôÊÇ XML£¿
¡¡¡¡¿ÉÀ©Õ¹±ê¼ÇÓïÑÔ (XML) ÊÇ Web ÉϵÄÊý¾ÝͨÓÃÓïÑÔ¡£Ëüʹ¿ª·¢ÈËÔ±Äܹ»½«½á¹¹»¯Êý¾Ý£¬´ÓÐí¶à²»Í¬µÄÓ¦ÓóÌÐò´«µÝµ½×ÀÃæ£¬½øÐб¾µØ¼ÆËãºÍÑÝʾ¡£XML ÔÊÐíÎªÌØ¶¨Ó¦ÓóÌÐò´´½¨Î¨Ò»µÄÊý¾Ý¸ñʽ¡£Ëü»¹ÊÇÔÚ·þÎñÆ÷Ö®¼ä´«Êä½á¹¹»¯Êý¾ÝµÄÀíÏë¸ñʽ¡£
¡¡¡¡Ê²Ã´ÊÇ MSXML£¿
¡¡¡¡MSXML ÊÇÌṩºËÐÄ XML ·þÎñµÄ Microsoft Èí ......

XML½âÎö·½·¨½²½â

XMLÏÖÔÚÒѾ­³ÉΪһÖÖͨÓõÄÊý¾Ý½»»»¸ñʽ,ËüµÄƽ̨ÎÞ¹ØÐÔ,ÓïÑÔÎÞ¹ØÐÔ,ϵͳÎÞ¹ØÐÔ,¸øÊý¾Ý¼¯³ÉÓë½»»¥´øÀ´Á˼«´óµÄ·½±ã¡£¶ÔÓÚXML±¾ÉíµÄÓ﷨֪ʶÓë¼¼Êõϸ½Ú,ÐèÒªÔĶÁÏà¹ØµÄ¼¼ÊõÎÄÏ×,ÕâÀïÃæ°üÀ¨µÄÄÚÈÝÓÐDOM(Document Object Model),DTD(Document Type Definition),SAX(Simple API for XML),XSD(Xml Schema Definition),XSLT(Exten ......

flex xmlºÍarraycollectionÏ໥ת»»

1¡¢arraycollectionת»¯Îªxml£¬´úÂëÈçÏ£º
    
    //¶¯Ì¬Éú³ÉÊ÷Ðνṹ
public static function flatArrayToXML(arr:Object,rootname:String=null,nodename:String=null, outputString:Boolean=false):Object{
if (arr is Array){

......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ