XML¶ÁÈ¡
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import org.dom4j.Document;
import org.dom4j.Element;
import org.dom4j.io.SAXReader;
public class XMLReader {
public static List<File> fileList = null;
public static List<String> startWidth = null;
public static void main(String[] args) throws Exception {
File root = new File("xml");
File[] files = root.listFiles();
fileList = Arrays.asList(files);
SAXReader reader = new SAXReader();
for (File file : fileList) {
Document document = reader.read(file);
startTest(document, file);
}
System.out.println("------------ end ------------");
}
public static void startTest(Document document, File file) {
if (!startWithSE(document, file))
return;
if (!isN(document, file))
return;
if (!isNGBOrTenNumber(document, file))
return;
if (!startWithNGBS(document, file))
return;
if (!hasNode(document, file))
return;
if (!notZero(document, file))
return;
}
/*
* /FMS/SEA_OBL/JOB_NO ÒÔSE¿ªÊ¼
*
*/
public static boolean startWithSE(Document document, File file) {
String path = "/FMS/SEA_OBL/JOB_NO";
List list1 = document.selectNodes(path);
String text = null;
for (Element tel : (List<Element>) list1) {
text = tel.getTextTrim();
if (!text.startsWith("SE")) {
// fileList.remove(file);
System.out.println(file.getName() + " " + path
+ " not startWithSE");
copyFiles( file);
return false;
}
}
return true;
}
// /FMS/SEA_OBL/NORMAL_DIRECT ΪN
public static boolean isN(Document document, File file) {
String path = "/FMS/SEA_OBL/NORMAL_DIRECT";
List list1 = document.selectNodes(path);
String text = null;
for (Element tel : (List<Element>) list1) {
text = tel.getTextTrim();
if (!text.equals("N")) {
// fileList.remove(file);
S
Ïà¹ØÎĵµ£º
xmlÎļþΪ£º
<?xml version="1.0" encoding="UTF-8"?>
<mobile-list>
<mobile type="Nokia2652">
<wap2>false</wap2>
<width>115</width>
</mobile>
<mobile type="Nokia2650">
<wap2>false</wa ......
<%
'
Set http=Server.CreateObject("Microsoft.XMLHTTP")
http.Open "GET","http://127.0.0.1/1.xml",False
http.send
Dim xml
Set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.async = False
'xml.load (Server.MapPath("1.xml"))¡¡'Èç¹û²»ÊÇÔ¶³ÌÎļþÖ±½ÓÕâÒ»²½
xml.Load(http.ResponseXML)
Dim t ......
ʹÓÃMetadata¼ò»¯±íÊý¾ÝÏòXMLÐÎʽת»¯µÄʵÏÖ
Èç¹ûÐèÒª½«±íÊý¾Ýת»¯ÎªXMLÐÎʽÊý¾ÝµÄ»°£¬Èç¹ûÎÒÃÇʹÓÃSpringµÄJDBC Template£¬ÄÇô³£ÐèÒª×öµÄ¹¤×÷ÊÇ´´½¨Ò»¸öRowMapperÄäÃûÀ࣬ÔÚÆäÖн«×Ö¶ÎÓëÁìÓò¶ÔÏóµÄij¸öÊôÐÔÆ¥ÅäÉÏ£¬È»ºóµÃµ½ÁìÓò¶ÔÏóÁ´±íÐÎʽµÄ½á¹û£¬´ËºóÕ¹¿ªÕâ¸ö¼¯ºÏ£¬ÔÙ½«×Ö¶Îת»¯Îª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Éè¼ÆµÄ³õÖÔÊÇΪÁË·½±ã»úÆ÷Ö®¼äµÄ½»»¥£¨interoperability£©£¬¶øÐèÒªÂú×ã»úÆ÷¿ÉÔĶÁ£¨machine readable£©µÄÌØÐÔ¡£È»¶ø£¬ÓÉÓÚ³ÌÐòԱΪÁË·½±ã¿ª·¢£¬¼ÈÈ»XMLÊÇͨ¹ýÎı¾±íʾµÄ£¬²»ÈçÔÙÇ¿»¯Ò»Ð©£¬×öµ½ÈËÀà¿ÉÔĶÁ£¨human readable£©°É¡£XML¾¿¾¹ÊÇÄÄÖÖ¿ÉÔĶÁµÄÌÖÂÛÒѾÊÇÀÏÉú³£Ì¸ÁË£¬ÕâÀï²»»áÉîÈë̽ÌÖ£¬Ö»ÊǽèÖúÕâ¸ö»ú»á½éÉÜÒ ......