易截截图软件、单文件、免安装、纯绿色、仅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>


相关文档:

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

使用kxml解析xml文件(二)

一. 不同XML格式上的差异
<Bil BilID="09120005">
<Product PID="XS000-3">
<Package Needuan="10"/>
<Package Needuan="8"/>
</Product>
</Bil>
 

<channel>
<title>Meerkat: An Open2 Wire Service</title>
<link>http://meerkat. ......

传智播客——XML语法细节

一: XML的运用场合
     XML语言出现的根本目标在于描述在现实生活中经常出现的有关系的数据。在XML语言中,它允许用户自定义标签。一个标签用于描述一段数据;一个标签可分为开始标签和结束标签,在开始标签和结束标签之间,又可以使用其它标签描述其它数据,以此来实现数据关系的描述。例如:
&nb ......

XML文件修改操作

此XML实例以服务器端部门管理为例:(其界面如下)
  private void btn_UpdateGroup_Click(object sender, EventArgs e)
        {  
            XmlDocument xmlDoc = new XmlDocument();
  & ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号