XSLT声明

1、XSL声明:

把文档声明为 XSL 样式表的根元素是 <xsl:stylesheet> 或 <xsl:transform>,并且必须包含属性 version="1.0"。

<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

 

2、把 XSL 样式表链接到 XML 文档

向 XML 文档("cdcatalog.xml")添加 XSL 样式表引用:

<?xml version="1.0" encoding="ISO-8859-1"?>

<?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?>

<catalog>

<cd>

<title>Empire Burlesque</title>

<artist>Bob Dylan</artist>

<country>USA</country>

<company>Columbia</company>

<price>10.90</price>

<year>1985</year>

</cd>

.

.

.

</catalog>

posted @ 2014-07-09 12:52  ghpaas  阅读(179)  评论(0编辑  收藏  举报