Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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

asp.net³ÌÐòExcelת³ÉXMLµµ

ͨ¹ýAsp.net(C#)Ó¦ÓóÌÐò¶ÁÈ¡±¾µØÉÏ´«µÄExcleÎļþ,´æ·Åµ½DataSetÖÐ,ͨ¹ýDataSetÖеķ½·¨Ö±½ÓÉú³ÉXMLÎļþ.
C# Code
 if (this.FileUpload1.PostedFile != null)
        {
            string filename = this.FileUpload1.FileName.ToString();
            string path = @Server.MapPath("../File/") + filename;
            this.FileUpload1.PostedFile.SaveAs(path);
            //¶ÁÈ¡Óû§ÉÏ´«µÄExcleÎļþ
            string conn="Provider = Microsoft.Jet.OLEDB.4.0 ;Data Source ='"+path+"';Extended Properties=Excel 8.0";
            OleDbConnection olecon = new OleDbConnection(conn);
          ......

asp.net³ÌÐòExcelת³ÉXMLµµ

ͨ¹ýAsp.net(C#)Ó¦ÓóÌÐò¶ÁÈ¡±¾µØÉÏ´«µÄExcleÎļþ,´æ·Åµ½DataSetÖÐ,ͨ¹ýDataSetÖеķ½·¨Ö±½ÓÉú³ÉXMLÎļþ.
C# Code
 if (this.FileUpload1.PostedFile != null)
        {
            string filename = this.FileUpload1.FileName.ToString();
            string path = @Server.MapPath("../File/") + filename;
            this.FileUpload1.PostedFile.SaveAs(path);
            //¶ÁÈ¡Óû§ÉÏ´«µÄExcleÎļþ
            string conn="Provider = Microsoft.Jet.OLEDB.4.0 ;Data Source ='"+path+"';Extended Properties=Excel 8.0";
            OleDbConnection olecon = new OleDbConnection(conn);
          ......

ΪUrlRewriteµÄ¶à¸öXMLÅäÖÃÎļþµÄ¼ÓÔØÌṩģºýÆ¥Åä

 
ΪUrlRewriteµÄ¶à¸öXMLÅäÖÃÎļþµÄ¼ÓÔØÌṩģºýÆ¥Åä
 
@for&ever 2009-11-27
 
֮ǰдÁËһƪÎÄÕ£¬¡¶ÐÞ¸ÄUrlRewriterʹÆäÓɵ¥ÅäÖÃÎļþµ½Ö§³Ö¶àÅäÖÃÎļþ¡·£¬ÍøÖ·http://blog.csdn.net/forandever/archive/2009/08/07/4423808.aspx £¬¶Ô UrlRewriteµÄ´úÂë½øÐÐÁ˼òµ¥Ð޸ģ¬
ÎÄÕÂÖеÄÄܹ»Ö§³Ö¶à¸öÅäÖÃÎļþµÄÇé¿ö¡£
        
         ×î½ü£¬ÔÚÏîÄ¿ÖÐʹÓþõµÃ»¹ÊDz»Ì«·½±ã£¬Ã¿´ÎÔö¼ÓÒ»¸öÅäÖÃÎļþ£¬¶¼ÐèÒªÐÞ¸Äweb.xml £¬ÓÚÊÇ£¬ÔÚÉÏ´ÎÐ޸ĵĻù´¡ÉÏ£¬¼ÌÐøÐ޸ĴúÂ룬Ôö¼ÓÄ£ºýÆ¥Åäij¸öĿ¼ÏµÄÒ»¶¨¹æÔòµÄÎļþµÄ¹¦ÄÜ¡£
                  
Ò»¡¢ÐèÇó£º
         Äܹ»ÊµÏÖÔÚ web.xml ÖÐͨ¹ý * µÄ·½Ê½ÅäÖã¬Ò»´Î¼´¿ÉÅäÖúÃһϵÁеÄÅäÖÃÎļþ¡£ÀýÈ磺
                  
ÔÚweb.xmlÖÐÈçÏÂÅäÖãº
     &nb ......

SAXºÍDOM½âÎöXMLÎĵµµÄÇø±ð

ÔÚÕë¶ÔXMLÎĵµµÄÓ¦Óñà³Ì½Ó¿ÚÖУ¬×îÖ÷ÒªµÄÓÐW3CÖƶ¨µÄDOM(Document Object Method£¬Îĵµ¶ÔÏóÄ£ÐÍ)ºÍÓÉDavid MegginsonÁìµ¼µÄSAX(SimpleAPI for XML£¬ÓÃÓÚXMLµÄ¼òµ¥API)[19]¡£
SAXºÍDOMÔÚʵÏÖ¹ý³ÌÖУ¬·Ö±ð²àÖØÓÚ²»Í¬µÄ·½ÃæÒÔÂú×㲻ͬµÄÓ¦ÓÃÐèÇó¡£DOMΪ¿ª·¢»ùÓÚXMLµÄÓ¦ÓÃϵͳÌṩÁ˱ãÀû¡£Ëüͨ¹ýÒ»ÖÖËæ»ú·ÃÎÊ»úÖÆ£¬Ê¹µÃÓ¦ÓóÌÐòÀûÓøýӿڿÉÒÔÔÚÈκÎʱºò·ÃÎÊXMLÎĵµÖеÄÈκÎÒ»²¿·ÖÊý¾Ý£¬Ò²¿ÉÒÔ¶ÔXMLÎĵµÖеÄÊý¾Ý½øÐвåÈ롢ɾ³ý¡¢Ð޸ġ¢Òƶ¯µÈ²Ù×÷¡£ÔÚDOMÖУ¬ÎĵµµÄÂß¼­½á¹¹ÀàËÆÒ»¿ÃÊ÷¡£Îĵµ¡¢ÎĵµÖеĸù¡¢ÔªËØ¡¢ÔªËØÄÚÈÝ¡¢ÊôÐÔ¡¢ÊôÐÔÖµµÈ¶¼ÊÇÒÔ¶ÔÏóÄ£Ð͵ÄÐÎʽ±íʾµÄ¡£DOMµÄÓŵãÔÚÓÚËüÔÚÄÚ´æÖб£´æÎĵµµÄÕû¸öÄ£ÐÍ¡£ÕâʹµÃÄÜÒÔÈκÎ˳Ðò·ÃÎÊXMLÔªËØ¡£È»¶ø£¬¶ÔÓÚ´óÐÍÎĵµÀ´Ëµ£¬ÕâÑù×ö¿ÉÄܲ»·½±ã¡£ÒòΪËü¿ÉÄÜ»áÓþ¡Äڴ棬»òÕßµ±ÏµÍ³´ïµ½ÁËËüµÄ¼«ÏÞʱ£¬»úÆ÷µÄÐÔÄܽ«
»áÂýÏÂÀ´¡£
SAXÌṩÁËÒ»ÖÖ¶ÔXMLÎĵµ½øÐÐ˳Ðò·ÃÎʵÄģʽ£¬ÕâÊÇÒ»ÖÖ¿ìËÙ¶ÁдXMLÊý¾ÝµÄ·½Ê½¡£SAX½Ó¿ÚÊÇʼþÇý¶¯µÄ£¬µ±Ê¹ÓÃSAX·ÖÎöÆ÷¶ÔXMLÎĵµ½øÐзÖÎöʱ£¬¾Í»á´¥·¢Ò»ÏµÁÐʼþ£¬²¢¼¤»îÏàÓ¦µÄʼþ´¦Àíº¯Êý£¬´Ó¶øÍê³É¶ÔXMLÎĵµµÄ·ÃÎÊ¡£SAX´¦ÀíXMLµÄ·½Ê½ÓëDOM²»Í¬¡£SAX½âÎöÆ÷²»Êǽ«DOMÊ÷½âÎöºÍ±íÏÖΪÊä³ö£¬ËüÊÇ»ùÓÚʼþµÄ£¬Ë ......

5.1½«Excelת»¯ÎªXMLµ¼ÈëÊý¾Ý¿âÖ®Ò»

½«Excelת»¯ÎªXML¡£ÒÔExcel2003ΪÀý˵Ã÷ÈçºÎ½«Êý¾Ýµ¼ÈëMS SQLÊý¾Ý¿â
˵ÏÈ°³µÄϵͳÅäÖãº
ϵͳ£ºWindows Server 2003 R2 X64
¿ª·¢Èí¼þ£ºMicrosoft VS 2008 Team
Office°æ±¾£ºExcel 2003 Excel2007
Êý¾Ý¿â£ºMS SQL 2008
 
5.1.1½¨Á¢Excel XML Ó³É䣺Êý¾Ý¸ñʽ¼û±í¡£
 
ÏÖ´òË㽫¡ºÓû§Ãû³Æ¡»£¬¡º¿Í»§ÁªÏµÈË¡»£¬¡ºÁªÏµµç»°¡»£¬¡º¿Í»§¾­Àí¡»£¬¡º¿Í»§¾­ÀíÁªÏµµç»°¡»£¬¡ºÒµÎñÀàÐÍ¡»£¬¡ºÇ°¶ËÊýÁ¿¡»£¬¡ºÒµÎñÀà±ð¡»£¬¡ºÇøÓò¡»µ¼ÈëMS SQLÏàÓ¦×Ö¶ÎÖÐ
Öƶ¨XML XSDÎļþ£¬T1schema.xlsÎļþÈçÏ£º
<?xml version="1.0" standalone="yes"?>
<QQTintDataSet xmlns="http://tempuri.org/QQTintDataSet.xsd">
  <xs:schema id="QQTintDataSet" targetNamespace="http://tempuri.org/QQTintDataSet.xsd" xmlns:mstns="http://tempuri.org/QQTintDataSet.xsd" xmlns="http://tempuri.org/QQTintDataSet.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" attributeFormDefault="qualified" elementFormDefault="qualified">
    <xs:element name="QQTintDataSet" msdata:Is ......

ʹÓÃSAX½âÎöXML

SAX£¨Simple API for XML¼ò³ÆSAX£©Ê¼þÊÇÎÞ״̬µÄ£¬Ò²¾ÍÊÇ˵£¬µ±½ÓÊÕµ½×Ö·ûÊý¾ÝµÄʼþºó£¬²¢²»ÖªµÀ¸Ã×Ö·ûÊý¾ÝÊÇÄÄÒ»¸öÔªËصÄ
ÄÚÈÝ¡£Í¬ÑùµØ£¬µ±ÊÕµ½ÔªËØ¿ªÊ¼µÄʼþºó£¬Ò²ÎÞ·¨ÖªµÀ¸ÃÔªËØÊÇ·ñÓи¸ÔªËØ£¬ÊÇ·ñÓÐ×ÓÔªËØ£¬ÕâÊÇ
SAXºÍDOM²»Í¬µÄµØ·½¡£SAX½âÎöÆ÷±¾Éí²¢²»ÌṩԪËصÄÉÏÏÂÎÄÐÅÏ¢£¬ËùÓÐÏà¹ØÐÅÏ¢µÄ¼Ç¼ÐèÒªÎÒÃÇ×Ô
¼º±à³ÌȥʵÏÖ
SaxXmlÀà¼ÓÔØXMLÊý¾ÝÁ÷£¬£¨Ä¿Ç°ÓÃ×Ö·û´®´úÌ棩£¬½¨Á¢½âÎö¹¤³§£¬Éú²úSAX½âÎö¶ÔÏó
import java.io.ByteArrayInputStream;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.SAXException;
public class SaxXml {
private SaxXml() {
       }
SaxXml(String xmlFile) {
        try{
    String xmltest = "<?xml version=\"1.0\" encoding=\"gb2312\"?>"
      +"<home>"
      +"<name>ÕÅÈý</name>"
      +"<sex>Ä ......

java½âÎöxmlÎļþ

==========================================
xmlÎļþ
£¼?xml version="1.0" encoding="GB2312"?£¾
£¼RESULT£¾
£¼VALUE£¾
¡¡¡¡ £¼NO£¾A1234£¼/NO£¾
¡¡¡¡ £¼ADDR£¾ËÄ´¨Ê¡XXÏØXXÕòXX·X¶ÎXXºÅ£¼/ADDR£¾
£¼/VALUE£¾
£¼VALUE£¾
¡¡¡¡ £¼NO£¾B1234£¼/NO£¾
¡¡ ¡¡£¼ADDR£¾ËÄ´¨Ê¡XXÊÐXXÏçXX´åXX×飼/ADDR£¾
£¼/VALUE£¾
£¼/RESULT£¾
ÐèҪʲô°ü×Ô¼ºµ½ÍøÉÏÕÒÏ°ɣ¿
==========================================
1£©DOM£¨JAXP Crimson½âÎöÆ÷£©
DOMÊÇÓÃÓëƽ̨ºÍÓïÑÔÎ޹صķ½Ê½±íʾXMLÎĵµµÄ¹Ù·½W3C±ê×¼¡£DOMÊÇÒÔ²ã´Î½á¹¹×éÖ¯µÄ½Úµã»òÐÅϢƬ¶ÏµÄ¼¯ºÏ¡£Õâ¸ö²ã´Î½á¹¹ÔÊÐí¿ª·¢ÈËÔ±ÔÚÊ÷ÖÐÑ°ÕÒ
Ìض¨ÐÅÏ¢¡£·ÖÎö¸Ã½á¹¹Í¨³£ÐèÒª¼ÓÔØÕû¸öÎĵµºÍ¹¹Ôì²ã´Î½á¹¹£¬È»ºó²ÅÄÜ×öÈκι¤×÷¡£ÓÉÓÚËüÊÇ»ùÓÚÐÅÏ¢²ã´ÎµÄ£¬Òò¶øDOM±»ÈÏΪÊÇ»ùÓÚÊ÷»ò»ùÓÚ¶ÔÏóµÄ¡£DOM
ÒÔ¼°¹ãÒåµÄ»ùÓÚÊ÷µÄ´¦Àí¾ßÓм¸¸öÓŵ㡣Ê×ÏÈ£¬ÓÉÓÚÊ÷ÔÚÄÚ´æÖÐÊdz־õģ¬Òò´Ë¿ÉÒÔÐÞ¸ÄËüÒÔ±ãÓ¦ÓóÌÐòÄܶÔÊý¾ÝºÍ½á¹¹×÷³ö¸ü¸Ä¡£Ëü»¹¿ÉÒÔÔÚÈκÎʱºòÔÚÊ÷ÖÐÉÏÏÂ
µ¼º½£¬¶ø²»ÊÇÏñSAXÄÇÑùÊÇÒ»´ÎÐԵĴ¦Àí¡£DOMʹÓÃÆðÀ´Ò²Òª¼òµ¥µÃ¶à¡£
import java.io.*;
import java.util.*;
import org.w3c.dom.*; ......

java½âÎöxmlÎļþ

==========================================
xmlÎļþ
£¼?xml version="1.0" encoding="GB2312"?£¾
£¼RESULT£¾
£¼VALUE£¾
¡¡¡¡ £¼NO£¾A1234£¼/NO£¾
¡¡¡¡ £¼ADDR£¾ËÄ´¨Ê¡XXÏØXXÕòXX·X¶ÎXXºÅ£¼/ADDR£¾
£¼/VALUE£¾
£¼VALUE£¾
¡¡¡¡ £¼NO£¾B1234£¼/NO£¾
¡¡ ¡¡£¼ADDR£¾ËÄ´¨Ê¡XXÊÐXXÏçXX´åXX×飼/ADDR£¾
£¼/VALUE£¾
£¼/RESULT£¾
ÐèҪʲô°ü×Ô¼ºµ½ÍøÉÏÕÒÏ°ɣ¿
==========================================
1£©DOM£¨JAXP Crimson½âÎöÆ÷£©
DOMÊÇÓÃÓëƽ̨ºÍÓïÑÔÎ޹صķ½Ê½±íʾXMLÎĵµµÄ¹Ù·½W3C±ê×¼¡£DOMÊÇÒÔ²ã´Î½á¹¹×éÖ¯µÄ½Úµã»òÐÅϢƬ¶ÏµÄ¼¯ºÏ¡£Õâ¸ö²ã´Î½á¹¹ÔÊÐí¿ª·¢ÈËÔ±ÔÚÊ÷ÖÐÑ°ÕÒ
Ìض¨ÐÅÏ¢¡£·ÖÎö¸Ã½á¹¹Í¨³£ÐèÒª¼ÓÔØÕû¸öÎĵµºÍ¹¹Ôì²ã´Î½á¹¹£¬È»ºó²ÅÄÜ×öÈκι¤×÷¡£ÓÉÓÚËüÊÇ»ùÓÚÐÅÏ¢²ã´ÎµÄ£¬Òò¶øDOM±»ÈÏΪÊÇ»ùÓÚÊ÷»ò»ùÓÚ¶ÔÏóµÄ¡£DOM
ÒÔ¼°¹ãÒåµÄ»ùÓÚÊ÷µÄ´¦Àí¾ßÓм¸¸öÓŵ㡣Ê×ÏÈ£¬ÓÉÓÚÊ÷ÔÚÄÚ´æÖÐÊdz־õģ¬Òò´Ë¿ÉÒÔÐÞ¸ÄËüÒÔ±ãÓ¦ÓóÌÐòÄܶÔÊý¾ÝºÍ½á¹¹×÷³ö¸ü¸Ä¡£Ëü»¹¿ÉÒÔÔÚÈκÎʱºòÔÚÊ÷ÖÐÉÏÏÂ
µ¼º½£¬¶ø²»ÊÇÏñSAXÄÇÑùÊÇÒ»´ÎÐԵĴ¦Àí¡£DOMʹÓÃÆðÀ´Ò²Òª¼òµ¥µÃ¶à¡£
import java.io.*;
import java.util.*;
import org.w3c.dom.*; ......
×ܼǼÊý:815; ×ÜÒ³Êý:136; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [127] [128] [129] [130] [131] [132] [133] 134 [135] [136]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ