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

JDOMÉú³ÉXMLÎĵµ

Ê×ÏÈÏÂÔØJDOM.JAR¼ÓÈëµÄclasspathÖÐ
package com.test.search;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.output.XMLOutputter;
public class ToXML {
public void BuildXMLDoc(List<SearchBean> list) throws IOException, JDOMException {
//´´½¨¸ú½Úµã
Element root=new Element("search");

//½«¸ú½ÚµãÌí¼Óµ½ÎĵµÖÐ
Document document=new Document(root);
for (int i = 0; i < list.size(); i++) {
SearchBean bean=list.get(i);
Element element=new Element("object");
element.addContent(new Element("URL").setText(bean.getUrl()));
element.addContent(new Element("TITLE").setText(bean.getTitle()));
element.addContent(new Element("DESCRIBE").setText(bean.getDiscribe()));
element.addContent(new Element("INFO").setText(bean.getInfo()));

root.addContent(element);
}
XMLOutputter out=new XMLOutputter();

out.output(document, new FileOutputStream("search.xml"));
}
/*public static void main(String[] args) {
ToXML toXML=new ToXML();

}*/
}

Éú³ÉÍê³É£¬Ö»ÊÇÉú³ÉµÄxmlÎĵµµÄ½ÚµãÓеãÂÒ£¬²»ÊÇÊ÷Ð͵ġ£


Ïà¹ØÎĵµ£º

phpÖ®XMLתÊý×麯Êý

<?
/**
* 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 ......

Flex:ArrayCollectionתxmlÐÎʽµÄʵÀý

ArrayCollectionת³ÉxmlÀàÐÍʾÀý
ÏÂÃæÄ£ÄâÒ»×éÊý¾Ýexams,½«Æäת»¯ÎªxmlÐÎʽ.Ïêϸ´úÂë¼ûÏ£º
Xml´úÂë
<?xml version="1.0" encoding="utf-8"?>  
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" fontSize="12"  creationComplet ......

¸ñʽ»¯XMLÊä³ö

ËäÈ»XMLÉè¼ÆµÄ³õÖÔÊÇΪÁË·½±ã»úÆ÷Ö®¼äµÄ½»»¥£¨interoperability£©£¬¶øÐèÒªÂú×ã»úÆ÷¿ÉÔĶÁ£¨machine readable£©µÄÌØÐÔ¡£È»¶ø£¬ÓÉÓÚ³ÌÐòԱΪÁË·½±ã¿ª·¢£¬¼ÈÈ»XMLÊÇͨ¹ýÎı¾±íʾµÄ£¬²»ÈçÔÙÇ¿»¯Ò»Ð©£¬×öµ½ÈËÀà¿ÉÔĶÁ£¨human readable£©°É¡£XML¾¿¾¹ÊÇÄÄÖÖ¿ÉÔĶÁµÄÌÖÂÛÒѾ­ÊÇÀÏÉú³£Ì¸ÁË£¬ÕâÀï²»»áÉîÈë̽ÌÖ£¬Ö»ÊǽèÖúÕâ¸ö»ú»á½éÉÜÒ ......

jms xml namespace

<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 ......

ÈçºÎ±£´æÔÚxmlÎļþÉÏÊDz»»á±»Éú³É<>

                    XmlDocument XMLFile = new XmlDocument();
                    XMLFile.Load(HttpContext.Cur ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ