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

lucene ½âÎöxml ÉîδÀ´¼¼Êõ

1¡¢°²×°DOM4j
http://www.dom4j.org/
2¡¢°²×°jaxen
http://jaxen.org/releases.html
3¡¢´úÂë
package extract;
import java.io.*;
import org.dom4j.*;
import org.dom4j.io.*;
import java.util.*;
public class XmlExtract {
    private SAXReader reader;
    private Document document;
 
 /**
  * @param args
  */
    public XmlExtract(){
         reader=new SAXReader();
   try {
    document=reader.read(new File("./htmls/abcde.xml"));
   } catch (DocumentException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
   }
    }
 @SuppressWarnings("unchecked")
 public void exxml(String path){ 
         if (document==null) return;
      List l=document.selectNodes(path);
   System.out.println(path);
   Iterator it=l.iterator();
   while (it.hasNext()){
     Element ele=(Element) it.next();
     List li=ele.elements();
     Iterator i=li.iterator();
     while (i.hasNext()){
      Element e=(Element) i.next();
      System.out.println("name:"+e.getName()+"\t text:"+e.getText());
     }
                 
   }
 }
 public static void main(String[] args) {
  // TODO Auto-generated method stub
  XmlExtract xmlext=new XmlExtract();   
  xmlext.exxml("/Config/vmacore/threadPool");       
 }
}
4¡¢Ð§¹ûÓë½Øͼ
/Config/vmacore/threadPool
name:TaskMax  te


Ïà¹ØÎĵµ£º

(4).¶ÁÈ¡XMLÎļþ

//¶ÁÈ¡XMLÎļþ
//1¡¢LoadfromFile×°ÈëXMLÎļþ
//2¡¢Ö¸¶¨Â·¾¶£¬¼¤»î¶ÁÈ¡
//3¡¢´ÓÄÚ´æÁ÷¶ÁÈ¡
//4¡¢´ÓÍøÂçÉÏÖ±½Ó»ñÈ¡
//1¡¢LoadfromFile×°ÈëXMLÎļþ
procedure TForm1.Button1Click(Sender: TObject);
begin
XMLDocument1.LoadfromFile('c:\temp\test.xml');
// XMLDocument1.Active := True;
Memo1.Lines := X ......

Java½âÎöXMLÎļþµÄËÄÖÖ·½·¨

 1£©DOM£¨JAXP Crimson½âÎöÆ÷£©
    DOMÊÇÓÃÓëƽ̨ºÍÓïÑÔÎ޹صķ½Ê½±íʾXMLÎĵµµÄ¹Ù·½W3C±ê×¼¡£DOMÊÇÒÔ²ã´Î½á¹¹×éÖ¯µÄ½Úµã»òÐÅϢƬ¶ÏµÄ¼¯ºÏ¡£Õâ¸ö²ã´Î½á¹¹ÔÊÐí¿ª·¢ÈËÔ±ÔÚÊ÷ÖÐÑ°ÕÒÌض¨ÐÅÏ¢¡£·ÖÎö¸Ã½á¹¹Í¨³£ÐèÒª¼ÓÔØÕû¸öÎĵµºÍ¹¹Ôì²ã´Î½á¹¹£¬È»ºó²ÅÄÜ×öÈκι¤×÷¡£ÓÉÓÚËüÊÇ»ùÓÚÐÅÏ¢²ã´ÎµÄ£¬Òò¶ ......

xmlת»»Îªdataset

        /// <summary>
        /// ¶ÁÈ¡Êý¾Ý¼¯²¢¼ÓÈ뻺´æ
        /// sea 2009-12-11
        /// </summary>
      &nb ......

xml shema°ïÖúÎĵµ5

XML Schema union ÔªËØ
¶¨ÒåºÍÓ÷¨
union ÔªËض¨Òå¶à¸ö simpleType ¶¨ÒåµÄ¼¯ºÏ¡£
ÔªËØÐÅÏ¢
³öÏÖ´ÎÊý
Ò»´Î
¸¸ÔªËØ
simpleType
ÄÚÈÝ
annotation¡¢simpleType
Óï·¨
<union
id=ID
memberTypes="list of QNames"
any attributes
>
(annotation?,(simpleType ......

C#ÐòÁл¯Óë·´ÐòÁл¯Xml£¬ÀûÓ÷¶ÐÍ×öͨÓû¯´¦Àí

public class yzzSerialize
{
private yzzSerialize()
{ }
private static yzzCache cache = new yzzCache();
public static T GetfromXml<T>(string xmlpath, T t)
{
using (FileStream fs = new FileStream(xmlpath, FileMode.Open, FileAcces ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ