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

ÓÃDom4J½âÎö´øÃüÃû¿Õ¼äµÄXMLÎļþ

Dom4JÊÇÒ»¸ö¿ªÔ´µÄÓÅÐãµÄXML½âÎöAPI£¬ÏÖÔÚÔ½À´Ô½¶àµÄÏîÄ¿ÖпªÊ¼²ÉÓÃÕâÖÖ½âÎö·½Ê½£¬ÆäÖаüº¬ÁËÖøÃûµÄHibernate¡£ÕâÀïÎÒÃÇʹÓÃDom4J½âÎöÒ»¸ö´øÃüÃû¿Õ¼äµÄCXFµÄSpringÅäÖÃÎļþ¡£Ïȵ¼Èëdom4j-1.6.1.jar
spring ÅäÖÃÎļþ applicationContext-cxf.xml:
 <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws
http://cxf.apache.org/schemas/jaxws.xsd"
default-autowire="byName" default-lazy-init="true">
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<bean id="jaxWsServiceFactoryBean" class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean" scope="prototype">
<property name="wrapped" value="true"/>
<property name="dataBinding" ref="aegisBean"/>
<property name="serviceConfigurations">
<list>
<bean class="org.apache.cxf.jaxws.support.JaxWsServiceConfiguration"/>
<bean class="org.apache.cxf.aegis.databinding.AegisServiceConfiguration"/>
<bean class="org.apache.cxf.service.factory.DefaultServiceConfiguration"/>
</list>
</property>
</bean>
<bean id="aegisBean" class="org.apache.cxf.aegis.databinding.AegisDatabinding"/>

<jaxws:endpoint id="WSpersonService" implementor="#personService" address="/PersonService">
<jaxws:serviceFactory>


Ïà¹ØÎĵµ£º

XML£¬XMLList

5.  ÃüÃû¹æÔò£¨²»ÄܰüÀ¨ xml£¬¿Õ¸ñ£¬¼âÀ¨ºÅ£¬µÈÌØÊâ·ûºÅ£¬²»ÄÜÊý×Ö¿ªÍ·£©
6.  ¿ÉÒÔ×Ô´øÊôÐÔ¡£ÊôÐÔÖµÓÓ”±êʾ
7.  ×¢ÊÍ<!--×¢Ê͵ÄÄÚÈÝ-->
8.  Èç¹ûÒªÏÔÊ¾ÌØÊâ·ûºÅ¿ÉÓÃ<![CDATA[  ÕâÀïÐ´ÌØÊâ·ûºÅ  ]]>
 
´´½¨
var xml:XML=<shuiGuo>
  & ......

java Éú³ÉxmlÎļþ

import java.awt.Image;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import javax.imageio.ImageIO;
public class createXml
{
public static boolean writeXml(String path,String dir,String wpath,String wname)
{
File[] files = ReaderListFiles(path);
boo ......

XML Îļþsax½âÎö Ö®´´½¨document¶ÔÏó

Ò».Éú³Édocument¶ÔÏó¡£
import org.jdom.*;
import org.jdom.input.SAXBuilder;
public class ReportDocUtil {
  public ReportDocUtil() {
  }
  /**
   * <p>Description:covert xml file to Document</p>
   * @param url ¸ñʽxmlÎļþµÄ´æ·ÅµÄÏà¶Ô·¾¶
 & ......

xml Îĵµ½âÎö


XMLÎļþµÄ½âÎö£­£­libxml¿âº¯Êý½âÊÍ
ÕªÒª
LibxmlÊÇÒ»¸öÓÐÃâ·ÑÐí¿ÉµÄÓÃÓÚ´¦ÀíXML¡¢¿ÉÒÔÇáËÉ¿çÔ½¶à¸öƽ̨µÄCÓïÑÔ¿â¡£Õâ¸öÖ¸ÄÏÌṩËüµÄ»ù±¾º¯ÊýµÄÀý×Ó¡£
Ð÷ÂÛ
Libxml ÊÇÒ»¸öʵÏÖ¶Á¡¢´´½¨¼°²Ù×ÝXMLÊý¾Ý¹¦ÄܵÄCÓïÑÔ¿â¡£Õâ¸öÖ¸ÄÏÌṩÀý×Ó´úÂë²¢¸ø³öËü»ù±¾¹¦ÄܵĽâÊÍ¡£ÔÚÕâ¸öÏîÄ¿µÄÖ÷Ò³ÉÏÓÐLibxml¼°¸ü¶à¹ØÓÚËü¿ÉÓõÄ×ÊÁÏ¡ ......

¶ÁдxmlËùÓнڵã¸öÈËС½á ºÍ ¶ÁÈ¡xml½ÚµãµÄÊý¾Ý×ܽá

//´ò¿ªÄ³Îļþ(¼ÙÉèweb.configÔÚ¸ùĿ¼ÖÐ)
     string filename=Server.MapPath("/") + @"WebApplication1\web.config";
     XmlDocument xmldoc= new XmlDocument();
     xmldoc.Load(filename);
     //µÃµ½¶¥²ã½ÚµãÁбí
  ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ