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

¶ÁÈ¡xmlÖ¸¶¨½ÚµãÖµ²¢Éú³ÉcsvÎļþ

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.List;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
public class XmlReader {
/**
* ¶ÁÈ¡xmlÎļþÖ¸¶¨½ÚµãÄÚÈݲ¢µ¼³öµ½csvÎļþÖÐ
* @param path
* Ö¸¶¨Îļþ¼Ð·¾¶
* @param destNode
* Ä¿±ê½Úµã
* @param fileName
* ³öÁ¦csvÎļþÃû
*/
public void readXmlFile(String path, String destNode, String fileName) {
File file = new File(fileName);
FileOutputStream out;
try {
// ½¨Á¢csvÊä³öÎļþÁ÷
out = new FileOutputStream(file);
OutputStreamWriter osw = new OutputStreamWriter(out);
BufferedWriter bw = new BufferedWriter(osw);
// ³õʼ»¯csvÎļþ
initCSV(bw);

// µÃµ½Ö¸¶¨Îļþ¼ÐϵÄËùÓÐxmlÎļþ
List fileList = getXmlFiles(path);
// ´´½¨xmlÎļþ
DocumentBuilderFactory factory = DocumentBuilderFactory
.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document doc = null;
String xmlFileName;
Node root;
NodeList links;
for (int k = 0; k < fileList.size(); k++) {
xmlFileName = fileList.get(k).toString();
doc = builder.parse(xmlFileName);
doc.normalize();
// xmlÎļþ¸ù½Úµã
root = doc.getDocumentElement();
// xmlÎļþÖÐËùÓÐÖ¸¶¨½Úµã
links = doc.getElementsByTagName(destNode);
for (int i = 0; i < links.getLength(); i++) {
Node link = links.item(i);
// Ö¸¶¨½ÚµãµÄËùÓÐ×Ó½Úµã
NodeList childNodes = link.getChildNodes();
StringBuffer sb = new StringBuffer();
// ±éÀú×Ó½Úµã
for (int j = 0; j < childNodes.getLength(); j++) {
Node chi


Ïà¹ØÎĵµ£º

ʹÓà PHP ´¦Àí XML ÅäÖÃÎļþ


ʹÓà PHP ´¦Àí XML ÅäÖÃÎļþ
ʹÓà XML ÅäÖÃÎļþÇáÒ×µØÅäÖà PHP Ó¦ÓóÌÐòºÍ¶ÔÏó
¼¶±ð£º Öм¶
Vikram Vaswani, ´´Ê¼ÈË, Melonfire
2007 Äê 11 ÔÂ 29 ÈÕ
XML ΪӦÓóÌÐòÅäÖÃÎļþÌṩÁËÒ»ÖÖ±ã½Ý¡¢Ò×Óõıí´ïÓïÑÔ¡£µ«ÓÐʱºò½«ÕâЩÐÅÏ¢ÌáÈ¡µ½ PHP ½Å±¾Öн«»áÃæ¶ÔÒ»¸ö²»Ð¡µÄÌôÕ½¡£ÕâÕýÊÇ XJConf for PHP °ü³öÏÖµÄÔ­Òò£ºËüÌá ......

xml£¬jsp,dtd,xsd ÌáʾÐÅÏ¢

½øÈëMyEclipse6.XÏÂ
Ð޸ģºeclipse.ini Îļþ
-Duser.language=en
¸Ä³É
-Duser.language=zh
µ¯³öÌáʾ£ºCtrl+"/"
dtd ÃüÃû¿Õ¼äµÄÌáʾÐÅÏ¢
window-->Preference-->xml-->XML Catalog-->add
Location :sql-map-2.dtd
key type :pubic ID
key:-//ibatis.apache.org//DTD SQL Map 2.0//EN (XMLÎļþÃüÃû¿Õ¼ ......

ʵÀýÆÊÎöxmlÓ¦Óã¨1£©

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
 //µ¼ÈëʹÓÃxmlÓ¦ÓÃËùÐèµ ......

delphi Éú³Éxml ·½·¨ Óë delphi txtÎļþ²Ù×÷

Procedure TForm1.Button1Click(Sender: TObject);
Var
xmlstr,FileName: String;
f: Textfile;
Begin
xmlStr := '<?xml version="1.0" encoding="gb2312"?>';
xmlstr := xmlstr + '<user><name>ÕÅÈý</name><sex>ÄÐ</sex></user>';
sh ......

½«Java¶ÔÏó±£´æΪXMLÎĵµ

package com.kiloway.trace.utils;
import java.lang.reflect.Field;
/**
* @author Zhang Qi
* @Create Time 2010/01/09
* */
public class ObjectToXML {
public String toString(Object object) throws Exception {
StringBuilder sb = new StringBuilder();
//µÃµ½ÀàµÄÃû³Æ
String classname = obj ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ