【发布时间】:2011-01-04 17:10:39
【问题描述】:
我是 xsl 新手,正在尝试编写一个模板来将 xml 转换为 html。
我有一个开始的 xml 文档
<?xml version="1.0" encoding="UTF-8"?>
<data xmlns:autn="http://schemas.com/aci/"
xmlns="http://iptc.org/std/nar/2006-10-01/">
<name>Bob</name>
我的 xsl 模板开始
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:autn="http://schemas.autonomy.com/aci/">
<xsl:output method="html" omit-xml-declaration="yes"/>
<xsl:template match="/">
...
<body>
<p>user name:</p>
<p><xsl:value-of select="data/name"/></p>
问题是,如果我这样做 对于 select 的值,我没有得到任何回报。
如果我这样做 我得到了“鲍勃”,但我失去了所有的 html。
我错过了什么?
【问题讨论】: