XMLµÄ¶Áд
XMLÊÇÒ»ÖÖ¿ÉÀ©Õ¹ÖñêÓïÑÔ£¬ÓֳƿÉÀ©Õ¹µÄ±à¼ÓïÑÔ¡£XMLÎĵµµÄ¶¨Òå¸ñʽÓÐÁ½ÖÖ£ºDTDºÍSchema¸ñʽ£¬ÓÉÓÚSchemaÊÇxml±¾ÉíµÄ£¬ËùÒÔÓ¦Óõķdz£ÆÕ±é¡£xmlµÄ×÷ÓÃÊÇÎļþµÄ¶Áд£¬ËùÒÔÔÚweb¿ª·¢ÖÐÒ²µÃµ½Á˹㷺ӦÓã¬×÷ΪһÖÖÅäÖÃÎļþ£¬³ä·Ö·¢»ÓÁËËü¶ÁдµÄ¹¦ÄÜ¡£XMLµÄ½âÎö·½Ê½ÓÐËÄÖÖ£ºDOM£¬SAX£¬JDOM£¬DOM4J¡£DOMÊÇÒ»ÖÖ±ê׼ģÐÍ£¬Ò²ÊÇW3CËùÍÆ¼öµÄ¡£¼¸ÖÖ½âÎö·½Ê½¸÷ÓÐÓÅȱµã£¬µ«ÊÇDOM4J¼¸ÖÖÁËǰ¼¸ÖÖµÄÓе㣬ÔÚweb¿ª·¢Öеõ½¹ã·ºÓ¦Ó㬱¾ÈËÒ²ÍÆ¼öÕÆÎÕDOM4J¡£ËÄÖÖ½âÎö·½Ê½ÖÁÉÙÕÆÎÕÒ»ÖÖ¼´¿É£¬Èç¹û×Ô¼ºÓÐʱ¼ä¾«Á¦×îºÃÈ«²¿ÕÆÎÕ¡£ÏÂÃæÊÇÒÔDOM4J½øÐÐÎļþµÄ¶ÁдʵÀý£º
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import org.dom4j.Attribute;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.io.OutputFormat;
import org.dom4j.io.SAXReader;
import org.dom4j.io.XMLWriter;
public class Dom4j {
public static void main(String[] args) {
File file=new File("src/XML/gg.txt");
try {
file.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
write(file);
read(file);
}
//XMLµÄдÈë
private static void write(File file) {
// ´´½¨documentÎĵµ
Document doc=DocumentHelper.createDocument();//µÃµ½documentÎļþ
//Ìí¼ÓÔªËØ
Element e=doc.addElement("root");//Ìí¼Ó¸ùÔªËØ
Element student=e.addElement("student");//Ìí¼Ó×ÓÔªËØ
Element name=student.addElement("name");
Element age=student.addElement("age");
Element num=student.addElement("num");
Element hight=student.addElement("hight");
//¸øÔªËظ³Öµ
student.a
Ïà¹ØÎĵµ£º
<?
/**
* xml2array() will convert the given XML text to an array in the XML structure.
* Link: http://www.bin-co.com/php/scripts/xml2array/
* Arguments : $contents - The XML text
* $get_attributes - 1 or 0. If this is 1 the function will get the attributes as well as the ......
¿ìÒݱ¨±íÓÐ×ÅÇ¿´óµÄÊä³ö¹¦ÄÜ£¬¿ÉÒÔÖ±½Ó°Ñweb±¨±íµ¼³öΪExcel¡¢Word¡¢Pdf¡¢TxtµÈÎļþÐÎʽ¡£µ«ÊÇһЩweb±¨±íÓû§Ï£Íû¿ÉÒÔ½«±¨±íµ¼³öµ½XMLÎļþÖÐÒÔ±ã¶ÔÊý¾Ý½øÐзÖÎöÓë½âÎö£¬ÕâÑù¾ÍÐèÒªÎÒÃÇÓÃÒ»Ð©ÌØÊâµÄ·½·¨È¥ÊµÏÖÁË¡£
ʵÏÖ˼·
£ºµ¼³öXML¹¦ÄܵĿÉÒÔͨ¹ý½«¼ÆËãºÃµÄIReport¶ÔÏ󴫵ݸø¿ìÒÝÌṩµÄcom.runqian.report4.view.xml ......
XML DTD ÈëÃÅ(2009-12-14 09:08:49)
±êÇ©£ºÔÓ̸
DTDʵ¼ÊÉÏ¿ÉÒÔ¿´×÷Ò»¸ö»ò¶à¸öXMLÎļþµÄÄ£°å£¬ÕâЩXMLÎļþÖеÄÔªËØ¡¢ÔªËصÄÊôÐÔ¡¢ÔªËصÄÅÅÁз½Ê½/˳Ðò¡¢ÔªËØÄܹ»°üº¬µÄÄÚÈݵȣ¬¶¼±ØÐë·ûºÏDTDÖе͍Òå¡£XMLÎļþÖеÄÔªËØ£¬¼´ÎÒÃÇËù´´½¨µÄ±ê¼Ç£¬ÊǸù¾ÝÎÒÃÇÓ ......
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:amq="http://activemq.org/config/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/bea ......