易截截图软件、单文件、免安装、纯绿色、仅160KB

Jdom建立XML文件


   JDOM 是一个开源的纯java API,用于快速开发 XML 应用程序,JDOM将XML文档表示为树,包括元素、属性、说明、处理指令、文本节点、CDATA段,等等。JDOM可以随时访问树中的任意部分。树中所有不同节点均为具体的类。在http://jdom.org可以下载JDOM的最新版本(我这里是1.0)。下载后解压,JDOM的jar文件就是build目录下的文件jdom.jar,将之加入类路径。
jdom中最重要的一个包是org.jdom,其中主要有以下类用来进行xml文档的操作: 
Attribute 
CDATA 
Comment 
DocType 
Document 
Element 
EntityRef 
Namespace 
ProcessingInstruction 
Text 
看看jdom怎样创建xml文档:
import java.io.*;
import org.jdom.*;
import org.jdom.output.*;
public class test1 {    
      public void BuildXMLDoc() throws IOException, JDOMException {  
      Element root, e1, e2;        
      Document Doc;        
      root = new Element("employees_information");    //首先建立根元素
      DocType type=new DocType("employees_information","employees.dtd"); //文档类型
      Doc = new Document(root,type);      //然后用root创建XML文档对象
      e1 = new Element("name");       //创建元素e1,设置内容,属性
      e1.setText("C.Y. 陈伟波");  
      e1.setAttribute("index","1");
      root.addContent(e1); 
      e2= new Element("name");       //创建元素e2,设置内容,属性
      e2.setText("a.Y. Shen");  
      e2.setAttribute("index","2");
  


相关文档:

JSP联系XML与数据库

  数据库应用系统包括数据库,数据库管理系统,数据库应用三大部分。
  世界上存在许多完全不同的客户平台,在不同平台间交换数据,需要保证数据的完整和服务的高效,数据格式的转换问题往往成为制约Web Service的瓶颈,采用XML作为数据交换的标准,可以使各个异构平台和各种格式的数据进行数据交换成为可能。
......

XML Schema nillable=”true” vs minOccurs=”0″

出处:http://www.dimuthu.org/blog/2008/08/18/xml-schema-nillabletrue-vs-minoccurs0/
【前言】一个月前研究过nillable="true"和 vs minOccurs="0"的区分,没有想到啊,今天就记不得了,看来真是好记性不如烂笔头啊,况且我还么的好记性。。。。
【总结】英文一眼看不出结论,说点汉语直接些,别说我土哈~
nillable=" ......

Myeclipse 启动 xml 自动配置

第一步:将XML编辑器设置默认为Myeclipse edit 
window__Preferences__General____Editors_____File Associations
找到*.xml,选择Myeclipse Xml editor,点default
第二步:配置dtd或者xsd文件
Window → Preferences... → MyEclipse → Files & Editors → ......

Use the XML Parser in OS 9.x


Paul.Todd | 09 April, 2007 15:24
I have noticed a couple of people seem to be having problems with using the XML parser in Symbian and there are no examples outside of the devkit. The parser I will be talking about is the xml one, not the one SOAP engine as the SOAP one is Nokia specific.
The ke ......

Example Code of Using XML Parser in Symbian OS

antonypr | 14 April, 2007 00:05
A couple of weeks ago, I had a plan to write an article and example code of using XML parser in Symbian OS. It seems that another Forum Nokia Champion, Paul Todd had the same idea. He posted a nice article about XML parser in Symbian OS 9.x to Forum Nokia Blogs. It's ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号