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

ÓÃjdom¶ÔxmlÎļþµÄ¶ÁÈ¡

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;
import org.jdom.xpath.XPath;
public class XMLReader {
 private static final String CONFIG_FILE_NAME = "testSuits.xml";
 private Element rootElt;
 
 public XMLReader() {
  SAXBuilder sb = new SAXBuilder();
  try {
   //Document doc = sb.build(Thread.currentThread().getContextClassLoader().getResourceAsStream(CONFIG_FILE_NAME));
   Document doc = sb.build(new FileInputStream("F:/report/testSuits.xml"));
   //È¡µÃ<sys-configure>
   rootElt = doc.getRootElement(); //Ï൱Äõ½ÁËÕû¸öÎļþÒ»Ñù,¶¼ÔÚrootEltÖÐ
   
  } catch (Exception e) {
   e.printStackTrace();
  }
 }
 
 
 public void readXmlInfo() throws Exception {
  List yongList = XPath.selectNodes(rootElt, "//sys-configures/sys-configure");
  for (Iterator iter = yongList.iterator(); iter.hasNext();) {
   Element yongElt = (Element)iter.next();
   String test = yongElt.getAttributeValue("test");
   System.err.println(test);
   String err = yongElt.getAttributeValue("err");
   System.err.println(err);
   String time = yongElt.getAttributeValue("time");
   System.err.println(time);
   
  }
 }
 
 public static void main(String[] args) throws Exception {
  XMLReader reader = new XMLReader();
  reader.readXmlInfo();
 }
}


Ïà¹ØÎĵµ£º

J2MEÖÐKXMLÓëNanoXML½âÎöXML×ܽá

ÔÚJ2MEÌåϵÖУ¬¶ÔxmlµÄ½âÎöÓбȽÏÓÐÃûµÄµÚÈý·½½âÎöAPI£¬·Ö±ðΪKXMLºÍNanoXML£¬ËûÃǶ¼ÌṩÁ˶ԽâÎöxmlµÄÖ§³Ö¡£KXMLÔÚ½âÎöXML¹ý³ÌÖлá¶ÔÎļþÄÚÈÝÒ»²ãÒ»²ã½øÐнâÎö£¬Òò´Ë³ÉΪÔöÁ¿Ê½½âÎöÆ÷£¬±È½ÏÊʺϴóÎļþµÄ½âÎö¡£¶øNanoXMLÊÇÒ»´ÎÐÔ½âÎöÆ÷£¬ÔÚÒ»´Îʱ¼äÀï¾Í°ÑÕû¸öxmlÎĵµ½âÎöÍ꣬Òò´Ë²»ÊʺϴóÎļþµÄ½âÎö£¬»áÔì³ÉÄÚ´æ²»×ãµÄÏÖÏó¡ ......

xml jboss problem

the content of element type "jboss" must matched  loader-respository ,jmx-name,enforce-ejb-restriction,
security-domain,missing-method-permission-excluded-mode,unauthenticated-principal,exception-on-rollback,
webservices,enterprice-beans,assembly-descriptor,resource-managers,invoker-proxy-bin ......

java¶ÁÈ¡xmlÅäÖÃÎļþ

xmlÎļþÈçÏ ÅäÖù¦ÄÜ¿ª¹Ø
<Configurations>
    <Samples>true</Samples>
    <Excepts>true</Excepts>
    <CheckFace>false</CheckFace>
    <ThumbNail>false</ThumbNail>
  &nbs ......

C#.Net²Ù×÷XMLÎļþµÄÊý¾Ý

XMLÎļþ×÷ΪÊý¾ÝÊý¾Ý´æ´¢½éÖʵÄÒ»ÖÖ£¬ºÃ´¦ÔÚÓÚ£ºÈκεÄϵͳ¾ù¿ÉÒÔ½âÎöËü¡£
XMLÈ«³Æ£ºExtensible Markup Language£¨À©Õ¹±ê¼ÇÓïÑÔ£©Ê¹ÓÃÎĵµÀàÐͶ¨Ò壨DTD£©»òÕßģʽ£¨Schema£©À´ÃèÊöÊý¾ÝµÄ¡£¿É¹©ÈËÔĶÁ£¬¶øÇÒ»¹»ùÓÚÒ»ÖÖ¹«¹²µÄ¿ª·¢±ê×¼¡£
×î½üÓÉÓÚ¿ª·¢µÄÐèÒª£¬Ò²ÊÇÑо¿ÒÔÏÂXMLµÄ²Ù×÷£¬±¾ÆªÈÕÖ¾Ö÷Òª×ܽáC#.NETÖÐÊÇÈçºÎ²Ù×÷XM ......

ÔÚVisual C#ÖÐʹÓÃXMLÖ¸ÄÏÖ®¶ÁÈ¡XML

ÎÒÃǽñÌìÀ´½²Ò»Ï¸ÃÌåϵ½á¹¹ÖеÄXmlTextReaderÀ࣬¸ÃÀàÌṩ¶ÔXmlÎļþ½øÐжÁÈ¡µÄ¹¦ÄÜ£¬Ëü¿ÉÒÔÑéÖ¤ÎĵµÊÇ·ñ¸ñʽÁ¼ºÃ£¬Èç¹û²»ÊǸñʽÁ¼ºÃµÄXmlÎĵµ£¬¸ÃÀàÔÚ¶ÁÈ¡¹ý³ÌÖн«»áÅ׳öXmlExceptionÒì³££¬¿ÉʹÓøÃÀàÌṩµÄһЩ·½·¨¶ÔÎĵµ½Úµã½øÐжÁÈ¡£¬É¸Ñ¡µÈ²Ù×÷ÒÔ¼°µÃµ½½ÚµãµÄÃû³ÆºÍÖµ£¬ÇëÀμǣºXmlTextReaderÊÇ»ùÓÚÁ÷Ä£Ð͵ÄʵÏÖ£¬´ò¸ö ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ