Jdom½¨Á¢XMLÎļþ
JDOM ÊÇÒ»¸ö¿ªÔ´µÄ´¿java API,ÓÃÓÚ¿ìËÙ¿ª·¢ XML Ó¦ÓóÌÐò,JDOM½«XMLÎĵµ±íʾΪÊ÷£¬°üÀ¨ÔªËØ¡¢ÊôÐÔ¡¢ËµÃ÷¡¢´¦ÀíÖ¸Áî¡¢Îı¾½Úµã¡¢CDATA¶Î£¬µÈµÈ¡£JDOM¿ÉÒÔËæÊ±·ÃÎÊÊ÷ÖеÄÈÎÒⲿ·Ö¡£Ê÷ÖÐËùÓв»Í¬½Úµã¾ùΪ¾ßÌåµÄÀà¡£ÔÚhttp://jdom.org¿ÉÒÔÏÂÔØJDOMµÄ×îа汾(ÎÒÕâÀïÊÇ1.0)¡£ÏÂÔØºó½âѹ£¬JDOMµÄjarÎļþ¾ÍÊÇbuildĿ¼ÏµÄÎļþjdom.jar£¬½«Ö®¼ÓÈëÀà·¾¶¡£
jdomÖÐ×îÖØÒªµÄÒ»¸ö°üÊÇorg.jdom£¬ÆäÖÐÖ÷ÒªÓÐÒÔÏÂÀàÓÃÀ´½øÐÐxmlÎĵµµÄ²Ù×÷£º
Attribute
CDATA
Comment
DocType
Document
Element
EntityRef
Namespace
ProcessingInstruction
Text
¿´¿´jdomÔõÑù´´½¨xmlÎĵµ£º
import java.io.*;
import org.jdom.*;
import org.jdom.output.*;
public class test1 {
public void BuildXMLDoc() throws IOException, JDOMException {
Element root, e1, e2;
Document Doc;
root = new Element("employees_information"); //Ê×ÏȽ¨Á¢¸ùÔªËØ
DocType type=new DocType("employees_information","employees.dtd"); //ÎĵµÀàÐÍ
Doc = new Document(root,type); //È»ºóÓÃroot´´½¨XMLÎĵµ¶ÔÏó
e1 = new Element("name"); //´´½¨ÔªËØe1,ÉèÖÃÄÚÈÝ£¬ÊôÐÔ
e1.setText("C.Y. ³Âನ");
e1.setAttribute("index","1");
root.addContent(e1);
e2= new Element("name"); //´´½¨ÔªËØe2,ÉèÖÃÄÚÈÝ£¬ÊôÐÔ
e2.setText("a.Y. Shen");
e2.setAttribute("index","2");
 
Ïà¹ØÎĵµ£º
function $import(path,type,title,idname){
var s,i;
if(type=="js"){
&nb ......
DataSet ds = new DataSet();
ds.ReadXml(Server.MapPath(NetShop.Config.DbConfigs.GetSitePath + "images/flashdata/flash.config"));
DataRow[] drs = ds.Tables[0].Select("", "[SortOrder] ASC");
//·µ»ØµÄÊǸöDataRow[]£º
//DataR ......
antonypr | 14 April, 2007 00:05
A couple of weeks ago, I had a plan to write an article and example code of using XML parser in Symbian OS. It seems that another Forum Nokia Champion, Paul Todd had the same idea. He posted a nice article about XML parser in Symbian OS 9.x to Forum Nokia Blogs. It's ......
XML ÔªËØ
ÔªËØÃüÃû
XMLÔªËØ±ØÐë×ñÊØÒÔϵÄÃüÃû¹æÔò£º
Ãû×ֿɰüº¬×Öĸ¡¢Êý×ÖÒÔ¼°ÆäËûµÄ×Ö·û
Ãû×Ö²»ÄÜÒÔÊý×Ö»òÕß±êµã·ûºÅ¿ªÊ¼
Ãû×Ö²»ÄÜÒÔ×Ö·û“xml”£¨»òÕßXML¡¢Xml£©¿ªÊ¼
Ãû×Ö²»Äܰüº¬¿Õ¸ñ
µ±Äú“·¢Ã÷´´Ôì”ÔªËØÃû³ÆÊ±£¬ÇëÁôÒâ²¢×ñÑÏÂÃæµÄ¼òµ¥µÄ¹æÔò£º
Äú¿ÉÒÔʹÓóý±£Áô×ÖÍâµÄÈκÎÃû³Æ£ ......