您现在的位置: 无忧电子商务网 >> 信息学院 >> 程序开发 >> js >> 正文

xml&Java的结合应用(今天就先讲这些,下课啦)

作者:作者:未…    信息学院来源:网络收集    点击数:    更新时间:2006-8-27 我要参与讨论

  关键词:Java, XML

采用JAVA处理XML非常容易
1,你需要一个JDK
2,你需要一些 free class libraries,如XML4J,XERCES,LOTUSXSL
3,你需要一个text editor
4,你需要一些待处理的DATA



预备条件
熟悉Java尤其是I/O, classes, objects, polymorphism等概念.
知道XML要well-formedness(格式准确), validity(有法为证), namespaces(名字空间)等。

I will briefly review proper terminology
一个简单的例子:
--------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/css" href="song.css"?>
<!DOCTYPE SONG SYSTEM "song.dtd">
<SONG xmlns="http://metalab.unc.edu/xml/namespace/song"
      xmlns:xlink="http://www.w3.org/1999/xlink">
  <TITLE>Hot Cop</TITLE>
  <PHOTO
    xlink:type="simple" xlink:show="onLoad" xlink:href="hotcop.jpg"
    ALT="Victor Willis in Cop Outfit" WIDTH="100" HEIGHT="200"/>
  <COMPOSER>Jacques Morali</COMPOSER>
  <COMPOSER>Henri Belolo</COMPOSER>
  <COMPOSER>Victor Willis</COMPOSER>
  <PRODUCER>Jacques Morali</PRODUCER>
  <!-- The publisher is actually Polygram but I needed
       an example of a general entity reference. -->
  <PUBLISHER xlink:type="simple" xlink:href="http://www.amrecords.com/">
    A & M Records
  </PUBLISHER>
  <LENGTH>6:20</LENGTH>
  <YEAR>1978</YEAR>
  <ARTIST>Village People</ARTIST>
</SONG>
<!-- You can tell what album I was
     listening to when I wrote this example -->


Markup and Character Data Markup includes:
1,Tags
2,Entity References
3,Comments
4,Processing Instructions
5,Document Type Declarations
6,XML Declaration
7,CDATA Section Delimiters
8,Character data includes everything else



例子:(标记和Character Data例子)
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/css" href="song.css"?>
<!DOCTYPE SONG SYSTEM "song.dtd">
<SONG xmlns="http://metalab.unc.edu/xml/namespace/song"
      xmlns:xlink="http://www.w3.org/1999/xlink">
  <TITLE>Hot Cop</TITLE>
  <PHOTO
    xlink:type="simple" xlink:show="onLoad" xlink:href="hotcop.jpg"
    ALT="Victor Willis in Cop Outfit&qu

[1] [2] [3] [4] [5] [6] 下一页

在google里搜索更多xml&Java的结合应用(今天就先讲这些,下课啦)

Google
Web www.51ec.org
【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
我来说两句 对此文章发表了评论
  昵 称: *必填    ·注册用户·
  评 分: 1分 2分 3分 4分 5分     严禁发表危害国家安全、政治、黄色淫秽等内容的评论,用户需对自己在使用本网站服务过程中的行为承担法律责任。本站管理员有权保留或删除评论内容,评论内容只代表机友个人观点,与本网站立场无关。  
评 论
内 容

 
评论列表 (最新 评论仅限网友观点!)

推荐文章
  • 此栏目下没有推荐信息学院
  • 供求信息




    | 设为首页 | 加入收藏 | 关于我们 | 广告服务 | 联系方式 | 友情链接 | 版权申明