当前位置: 首页 > 网络学院 > XML相关教程 > XML > 用 XSL 显示 XML

XML
XML DHTML行为
XML 相关技术
XML 编辑器
XML 摘要
XML 实例
XML字符编码
xml 文档树
IE和火狐读取XML方法比较

XML 中的 用 XSL 显示 XML


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-01   浏览: 846 ::
收藏到网摘: n/a

With XSL you can add display information to your XML document.
用XSL你可以为XML文档添加对应的显示信息。


Displaying XML with XSL
使用XSL显示XML

XSL is the preferred style sheet language of XML.
XSL是XML最好的样式表语言。

XSL (the eXtensible Stylesheet Language) is far more sophisticated than CSS. One way to use XSL is to transform XML into HTML before it is displayed by the browser as demonstrated in these examples:
XSL(可扩展样式表语言)远比CSS成熟,使用XSL的一种方式是:在XML被浏览器显示之前,事先将其转换成HTML格式。下面的案例很好地阐释了这点:

查看XML文件, XSL样式表结果

Below is a fraction of the XML file. The second line, <?xml-stylesheet type="text/xsl" href="simple.xsl"?>, links the XML file to the XSL file:
下面列举的是这份XML文件中的其中一个代码段。第二行语句:<?xml-stylesheet type="text/xsl" href="simple.xsl"?> ,意指把XML文件链接到xsl文件中:

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="simple.xsl"?>
<breakfast_menu>

<food>
<name>Belgian Waffles</name>
<price>$5.95</price>
<description>
two of our famous Belgian Waffles
</description>

<calories>650</calories>
</food>
</breakfast_menu>

If you want to learn more about XSL, please visit our XSL tutorial.
如果你想了解更多关于XSL的知识,请查阅我们的 XSL 教程 。

评论 (1) 1 All

登陆 | 还没注册?