博客首页 注册 建议与交流 排行榜 加入友情链接
推荐 投诉 搜索: 帮助 

天堂あ飞翔

Things do not change; we change...
heavenflying.cublog.cn
关于作者  
     ^V^^V^^V^^V^^V^^V^
     LOVE MY GF FOREVER
     ^V^^V^^V^^V^^V^^V^

我的分类  




a simple example using xalan command
xalan command is a flexible tool to translate the xml file into another xml file or others files. You can have a general understanding through an easy example.
At the first, create a file named testXalan.xml with vi and input the following.
<?xml version="1.0" encoding="ISO-8859-1"?>
<maphrase>
My First Xalan XML Page!
</maphrase>
Secondly, create a file named testXalan.xsl and input the following.
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="maphrase">
<html><body><xsl:apply-templates/></body></html>
</xsl:template>
</xsl:stylesheet>
At last, type the next command the translate the testXalan.xml into testXalan.htm.
xalan -IN testXalan.xml -XSL testXalan.xslt > testXalan.htm
You can view the result of the file testXalan.htm as the following.
<html>
<body>
My First Xalan XML Page!
</body>
</html>
In a word, the xsl file is a rule to describe how to translate the original xml file and the xalan is a cute tool to accomplish it.

 发表于: 2008-03-06,修改于: 2008-03-06 17:41
 已浏览420次,有评论0条
推荐 投诉

  网友评论

  发表评论



Copyright © 2001-2006 ChinaUnix.net All Rights Reserved

感谢所有关心和支持过ChinaUnix的朋友们
页面生成时间:10.7748

京ICP证041476号