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

¡¾×ª¡¿+¡¾¸Ä¡¿DOM4J´¦ÀíXML´øÓÐÃüÃû¿Õ¼äµÄËÄÖÖ·½·¨

µ±Äã½âÎöXMLʱ£¬ÊÇ·ñ»áÒòΪÃüÃû¿Õ¼äµÄ´æÔÚ¶ø²»Äܵó¥ËùÔ¸ÄØ£¿
java·½Ã棬ºÃ¶àÈËÍÆ¼öÓÃdom4j´¦Àíxml£¬ÎÒÒ²¾Í˵˵ÔÚdom4jÉÏ´¦Àí´øÃüÃû¿Õ¼äµÄxml
xml´úÂëexample: ÔÙ˵ǰÈýÖÖ·½·¨£¬Ò²ÊÇ´ÓÍøÉÏ¿´À´µÄ¡£http://www.cnblogs.com/patrickchen/articles/1188920.html
D: eport.css
µÚÒ»¸ö·½°¸.ÉèÖÃÄãµÄxpathµÄÃüÃû¿Õ¼äsetNamespaceURIs
1: public class TransferXML { 2: public static void main(String[] args) throws Exception{ 3: Map map = new HashMap(); 4: map.put("design","http://www.eclipse.org/birt/2005/design"); 5: SAXReader saxReader = new SAXReader(); 6: File file = new File("D:\test.xml"); 7: Document document = saxReader.read(file); 8: XPath x = document.createXPath("//design:list-property"); 9: x.setNamespaceURIs(map); 10: List nodelist = x.selectNodes(document); 11: System.out.println(nodelist.size()); 12: } 13: }
µÚ¶þ¸ö½â¾ö·½°¸:ÉèÖÃÄãµÄDocumentFactory()µÄÃüÃû¿Õ¼ä setXPathNamespaceURIs
1: public class TransferXML { 2: public static void main(String[] args) throws Exception{ 3: Map map = new HashMap(); 4: map.put("design","http://www.eclipse.org/birt/2005/design"); 5: SAXReader saxReader = new SAXReader(); 6: File file = new File("D:\test.xml"); 7: saxReader.getDocumentFactory().setXPathNamespaceURIs(map); 8: Document document = saxReader.read(file); 9: List tmp = document.selectNodes("//design:list-property"); 10: System.out.println(tmp.size()); 11: } 12: }
µÚÈýÖÖ·½·¨£º±¾ÈËÓõģ¬×ҲÊÇ×îͨÓõķ½·¨£¬¾ÍÊDz»Ê¹Óÿª·¢»·¾³¸øÄãÌṩµÄһϵÁжÔÏ󣬶øÊÇÓÃXPathÓï·¨ÖÐ×Ô´øµÄlocal-name() ºÍ namespace-uri() Ö¸¶¨ÄãҪʹÓõĽڵãÃûºÍÃüÃû¿Õ¼ä¡£
µ±ÄãÓöµ½Ê¹ÓÃxsltÀ´Ñùʽ»¯xmlʱ£¬¾ÍÖªµÀÕâ¸ö±¿·½·¨µÄºÃ´¦ÁË£º
1: public class TransferXML { 2: public static void main(String[] args) throws Exception 3: SAXReader saxReader = new SAXReader(); 4: File file = new File("D:\test.xml")


Ïà¹ØÎĵµ£º

VSÖÐʹÓÃTinyXml²Ù×÷xmlÎļþ

µ½http://sourceforge.net/projects/tinyxml/ÏÂÔØTinyXmlµÄ¹Ù·½Àý×Ó£¬
ÀïÃæÓкü¸¸öÎļþ£¬ÎÒÃǰÑ
tinyxml.h
tinystr.h
tinystr.cpp
tinyxml.cpp
tinyxmlparser.cpp
tinyxmlerror.cpp
Õ⼸¸öÎļþ°üº¬µ½ÎÒÃǵŤ³ÌÄÚ¡£
Òª°üº¬Í·Îļþ #include "tinyxml.h"
ÕâÓþͿÉÒÔ¿ªÊ¼Ê¹ÓÃtinyxml¿ªÊ¼²Ù×÷xmlÎļþÁË£¬¾ßÌåµÄ²Ù×÷· ......

ÔõôÓÃXML´«ËÍͼÏñÊý¾Ý

DelphiÖÐÓÐÒ»¸öEncdDecdµ¥Ôª,uses   Ëü,ÒÔϵĺ¯Êý³ö×ÔÕâ¸öµ¥Ôª  
   
  1.ÓÃTBitmap¶ÔÏóLoadͼƬ  
    TBitmap.LoadfromFile  
  2.°ÑTBitmap´æÈëÒ»¸öStreamÖÐ    
TBitmap.SaveToStream(mapStream)  
  3.°ÑͼƬÁ÷½øÐÐbase64±àÂë,É ......

ÔÚXMLÎļþÖжÁÈ¡ÊôÐÔÎļþ£¨.properties£©ÖеÄÔªËØÖµ

ÔÚXMLÎļþÖжÁÈ¡ÊôÐÔÎļþ£¨.properties£©ÖеÄÔªËØÖµ£º
web.xml
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/conf/dataAccessContext.xml</param-value>
</context-param>

<listener>
<listener-class>
......

Jdom ¶ÁÈ¡ xmlÎļþÀý×Ó


Jdom
¶ÁÈ¡
xml
ÎļþÀý×Ó
1.         
ÓÃ
JDOM
¶ÁÈ¡
XML
ÎļþÐèÏÈÓÃ
org.jdom.input.SAXBuilder
¶ÔÏóµÄ
build()
·½·¨´´½¨
Document
¶ÔÏó
,
È»ºóÓÃ
Document
Àà¡¢
Element
ÀàµÈµÄ·½·¨¶ÁÈ¡
1.
Sample1.java
import
java.util.*;
import
org.j ......

ʹÓÃMsXML¶ÁдXMLÎļþ

// MsXmlTest.cpp : ¶¨Òå¿ØÖÆÌ¨Ó¦ÓóÌÐòµÄÈë¿Úµã¡£
//
#include "stdafx.h"
#include "MsXmlTest.h"
#include <clocale>
#include "comutil.h"
#import "msxml4.dll"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// ΨһµÄÓ¦ÓóÌÐò¶ÔÏó
CWinApp theApp;
using namespace std;
void WritePerson(MSXML2: ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ