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 ¸ñʽÌṩ¸ø Web Ó¦ÓóÌÐòµÄ¡£µ«ÊÇ£¬XML Êý¾Ý±¾ÖÊÉÏÊÇ·Ö²ãµÄ£¬Òò´ËÄú¿ÉÄÜÏ£ÍûÄܹ»ÔÚ»ùÓÚÁбíµÄ¿Ø¼þÖÐʹÓà XML Êý¾Ý£¬Èç GridView »ò DropDownList ¿Ø¼þ¡£´ËÑÝÁ·ÑÝʾÈçºÎ½« XML Êý¾ÝÊÓΪ±í¸ñÊý¾Ý¿â±íÖеÄÊý¾Ý½øÐд¦Àí¡£
ͨ¹ý´ËÑÝÁ·£¬Äú½«Ñ§»áÈçºÎÖ´ÐÐÒÔÏÂÈÎÎñ£º
·Ê¹ÓÃÊý¾ÝÔ´¿Ø¼þ¶ÁÈ¡ XM ......
½ñÌì²ÅÖªµÀCMarkup¿ÉÒÔÖ±½Ó½âÎö×Ö·û´®ÐÎʽµÄXML¡£ÒÔǰ¶¼ÊÇÏÈ´æÈëÒ»¸öÎļþ£¬È»ºó´ÓÎļþÖÐload¡£¶à×öÁËI/O²Ù×÷£¬Ð§Âʲ»¸ß¡£
CMarkup xml;
CString str;
xml.SetDoc(str);
tinyXmlÒ²¿ÉÒÔÖ±½Ó½âÎöXML×Ö·û´®£¬·½Ê½ÈçÏ£º
// directly parsing string with tinyxml
const char* ......
±¾´ÎÓöµ½µÄÎÊÌâÊÇ£ºÔÚÉÏ´«Îļþʱ£¬·µ»ØµÄjsonÊý¾Ý±»¼ÓÉÏÁË<pre></pre>±êÇ©¡££¨ÔÚÆÕͨµÄ±íµ¥Ìá½»²¢²»»á¼ÓÉÏ<pre>±êÇ©£©
ÀûÓÃfirebug²é¿´´íÎóÐÅϢΪ£º
missing } in XML expression (<pre>{success:true, msg:'³É¹¦'}</pre>)
¶Ô´ËÎÊÌâ½â¾öÈçÏ£º
¶Ôresponse¶ÔÏóÉèÖ÷µ»ØÀàÐÍ£ºresp.s ......
ËäÈ»XMLÉè¼ÆµÄ³õÖÔÊÇΪÁË·½±ã»úÆ÷Ö®¼äµÄ½»»¥£¨interoperability£©£¬¶øÐèÒªÂú×ã»úÆ÷¿ÉÔĶÁ£¨machine readable£©µÄÌØÐÔ¡£È»¶ø£¬ÓÉÓÚ³ÌÐòԱΪÁË·½±ã¿ª·¢£¬¼ÈÈ»XMLÊÇͨ¹ýÎı¾±íʾµÄ£¬²»ÈçÔÙÇ¿»¯Ò»Ð©£¬×öµ½ÈËÀà¿ÉÔĶÁ£¨human readable£©°É¡£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 ......