·â×°Êý¾Ý¿âÇý¶¯³ÌÐò£¬ÓýâÎöxmlÎļþµÄ·½Ê½»ñÈ¡Çý¶¯£¿
<?xml version="1.0" encoding="UTF-8"?>
<database>
<dbinfo id="100">
<dirver>com.mysql.jdbc.Driver </dirver>
<url>jdbc:mysql://localhost:3306/testdb </url>
<username>root </username>
<password>321 </password>
</dbinfo>
</database>
½âÎöxml£º
public class DBParse {
static DBConfig config = new DBConfig();
public static DBConfig parseXml(){
ConnectionDB con = new ConnectionDB();
SAXBuilder builder = new SAXBuilder();
File file = new File("c://MysqlDB.xml");
try {
Document doc = builder.build(file);
Element root = doc.getRootElement();
List list = root.getChildren();
for(Iterator iterator = list.iterator();iterator.hasNext();)
{
Element dbinfo = (Element) iterator.next();
config.setDriver(dbinfo.getChildText("driver"));
config.setUrl(dbinfo.getChildText("url"));
config.setUsername(dbinfo.getChildText("username"));
config.setPassword(dbinfo.getChildText("password"));
}
} catch (JDOMException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOExceptio
Ïà¹ØÎÊ´ð£º
vbÖÐÔõôͨ¹ýxmlÀ´½âÎöÊý¾Ý¿âÖеÄ×Ö¶ÎÖµ¡£
û°ì·¨ÓÃXML½âÎöÊý¾Ý¿âµÄ×Ö¶ÎÖµ£¬³ý·ÇÊý¾Ý¿âÖб£´æµÄÊÇXML¸ñʽµÄ×Ö·û´®Îĵµ¡£
XMLÓÃÀ´Õ¹Ê¾²ã´ÎµÄÊý¾Ý¡£
Êý¾Ý¿âÒ»°ãÊǶþάÊý¾Ý¡£
Êý¾Ý¿âÖб£´æµÄÊÇXML×Ö·û´®¸ñʽ£ ......
ÎÒÓиöflash Êý¾Ýд³ÉÁË xmlÐÎËÆ...
ÏÖÔÚflashÈ´¶ÁÈ¡²»ÁË ¶¯Ì¬Éú³ÉµÄxml...ÐÎÈ磺x.jsp?id=6 £¿£¿£¿
½«¶¯Ì¬Éú³ÉµÄxmlÁí´æΪ x.xml ºó flash±ã¿ÉÕý³£¶ÁÈ¡ ÇëÎÊÕâÊÇʲôÔÒò£¿£¿£¿
¹Ø×¢
²»¶®°ï¶ ......
ÎÒÊÇÀûÓÃaxiom¶Ôxml½øÐнâÎö£¡
µ«È´³öÏÖÏÂÃæµÄ´íÎó£¡
Exception in thread "main" org.apache.axiom.om.OMException: [com.ctc.wstx.exc.WstxLazyException] com.ctc.wstx.exc.WstxUnexpectedCharEx ......
DataSetµ¼³öxml Åú´¦Àí(Ñ»·)µÃÔõô´¦Àí
XMLÎļþ
<A>
<B>
<C>
</C>
&nb ......
ÇëÎÊ.netÈçºÎ¶ÁÈ¡xmlµÄÖµ дµ½Êý¾Ý¿â Ï£Íû¸ø³öÍêÕûµÄ´úÂë лл
<?xml version="1.0" encoding="utf-8" ?>
- <channel>
- <item>
......