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

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


Ïà¹ØÎĵµ£º

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

xml½âÎö


ÔÚjavaÓ¦Óÿª·¢ÖÐÎÒÃǺÍxml´ò½»µÀµÃ»ú»á̫ƽ·²ÁË£¬Ò»°ãÇé¿öÏÂÎÒ¿´»áÓÃJDOM»òÊÇDOM4jÀ´½âÎöÎÒÃǵÃXMLÎļþ£¬ÏÂÃæÊÇÒ»¸öDom4j½âÎöxmlÎļþµÃÀý×Ó£¬ÆäÖаüÀ¨Á˶ÔxmlÎļþµÃȡֵ¡¢¸³Öµ¡¢ÌáÈ¡½Úµã¡¢½ÚµãµÃ±éÀúµÈ¡£
SAXReader reader =
new
SAXReader();   
Document doc = reader.read(...);  &nb ......

¹ØÓÚRDFÓëXMLµÄÇø±ð

      ¸Õ¿ªÊ¼Ñ§Ï°ÓïÒåÍøµÄ֪ʶ£¬¸ù¾ÝÓïÒåÍø²ã´ÎÍÆ½ø£¬¿´ÍêXML½ô½Ó×ÅRDF£¬ºöÈ»ÓиöÒÉÎÊ£ºÎªÊ²Ã´ÎÒÃÇÒ»¶¨ÒªÓÃRDF¶ø·Ç½ö½öʹÓÃÒѾ­ºÜ³ÉÊìµÄXMLÄØ£¿Ã²ËÆXML±ÈRDFÉÙÁËÒ»¸öÍÆÀíµÄϵͳ£¬¿ÉÒÔ¾ÍÍÆÀí¶øÑÔ£¬RDFÒ²¾ø²»ÊÇ×îºÃµÄ£¬ÏÔÈ»OWLµÄÍÆÀíÒª±ÈRDFÇ¿ºÜ¶à°¡£¬ÄÇôΪʲô»¹ÐèÒªÕâ¸ö²ã´ÎÄØ£¿
  &n ......

¸ñʽ»¯XMLÊä³ö

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