Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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


Ïà¹ØÎĵµ£º

DTD£¬XML SchemaºÍRelax NGµÄ±È½Ï¼°Ï໥ת»¯£¡

±È½Ï£º
1. DTD
a. ×îÔçµÄXML Contraint
b. ÓÉW3C¶¨Òå
C. ·Ç³£¼òµ¥
2. XML Schema
a. ĿǰӦÓÃ×î¹ãµÄXML Contraint
b. ÓÉW3C¶¨Òå
c. ºÜÁé»î£¬µ«·Ç³£¸´ÔÓ
3. Relax NG
a. ÊǸöÒ°º¢×Ó£¬²»ÊÇÓÉW3C¶¨Òå
b. ·Ç³£·Ç³£¼òµ¥Ö±¹Û
c. ¶ÔÓÚÐèҪƵ·±¶¨ÒåContraintµÄEngineer·Ç³£ºÏÊÊ
Ï໥ת»¯£º
1. XML Document -> DTD ......

½â¶ÁPHP DOMDocumentÔÚ½âÎöXMLÎļþÖеÄ×÷ÓÃ

½â¶ÁPHP DOMDocumentÔÚ½âÎöXMLÎļþÖеÄ×÷ÓÃ
http://developer.51cto.com  2009-12-02 10:39  ØýÃû  Áø³Ç²©¿Í  ÎÒÒªÆÀÂÛ(0)
PHP DOMDocumentµÄ¹¦Äܷdz£Ç¿´ó£¬ÎÒÃÇÔÚÕâÆªÎÄÕÂÖн«½éÉÜÈçºÎÕýÈ·µÄÔËÓÃPHP DOMDocumentÀ´½øÐÐXMLÎļþµÄ½âÎö¡£Ï£Íû¶ÔÓÖÐèÒªµÄÅóÓÑÓÐËù°ïÖú¡£
ÔÚʹÓÃPHP¶ÔXMLÎļþ½øÐнâÎöµÄʱ ......

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ÎļþÃüÃû¿Õ¼ ......

javascript½âÎö·µ»ØµÄxml¸÷ʽµÄ×Ö·û´®

<script>
var flags ;
  if(window.XMLHttpRequest) { 
   XMLHttpReq = new XMLHttpRequest(); //firefoxÏÂÖ´ÐдËÓï¾ä
   }
   else if(window.ActiveXObject) {
    try{
    XMLHttpReq = new Acti ......

¸üРxml²½Öè

ÔÚservice(spring)ÖÐÍê³É
step 1:
´ò¿ªÒ»¸ösession
д sql Óï¾ä£¬
×¢Òâµã£ºÐ´sqlÓï¾äʱ,Ëù²éѯµÄÊÔͼΪ£ºkangaroo_VW_UnitView£¬´ËÊÔͼµÄÉú³É
ÓÐ kangaroo_unit±í×óÁ¬½Óµ½kangaroo_img±í¶øÉú³É¡£
step 2:
°ÑËù²éѯµÄ·ûºÏÌõ¼þµÄ¼¯ºÏ·ÅÈëÁÙʱµÄArrayListÖУ¬²¢¶ÔÁÙʱµÄArrayList½øÐÐ
µü´ú¡£
step 3:
°Ñµü´ú³öÀ´µÄ¼¯ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ