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


相关文档:

Myeclipse 启动 xml 自动配置

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

为什么使用 XML?


Web 使我们能够与任何地方的任何人通讯。广泛接受的标准(这对完全使用 Web 的潜力是至关重要的)允许 Web 在多种交互操作的技术层上通讯。一个重要层是可视化显示和用户界面,例如 HTML、GIF 和 JScript(TM) 之类的现有标准。这些标准允许创建一次页面,并且在不同时间向众多接收者显示。
尽管可视化和用户界面标准是必 ......

Symbian OS下解析XML文档的一些方法

2009-10-27 22:44资料来源于网络,四种方式,大家可以自己尝试下.
=========11111=================
tinyXML
www.grinninglizard.com/tinyxml/
=========22222================================
symbian s60 第三版之后,已经提供了解析xml的系统api,采用的是SAX方式。
XML parsing in Symbian OS v9.x 来源目录:
htt ......

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

XML Parser 安装问题1

  关于安装multiget出现XML::Parser perl module is required for intltool错误问题的解决 收藏
在安装Multiget,在configure的时候提示XML::Parser perl module is required for intltool错误。具体解决的方法如下: #perl -MCPAN -e shell 之后跟据提示一步步往下,配置完后会出现一个 >的命令提示 >install ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号