1
我有下面一段XML:不能XSLT模板應用於XML元素
<?xml version="1.0"?>
<document xmlns="http://cnx.rice.edu/cnxml" xmlns:md="http://cnx.rice.edu/mdml" id="new" cnxml-version="0.7" module-id="new">
<metadata xmlns:md="http://cnx.rice.edu/mdml"
mdml-version="0.5">
<md:abstract>By the end of this section, you will be able to:
<list>
<item>Discuss the role of homeostasis in healthy functioning</item>
<item>Contrast negative and positive feedback, giving one physiologic example of each mechanism</item>
</list>
</md:abstract>
,我需要應用模板MD:抽象元素。我有以下XSL代碼:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:md="http://cnx.rice.edu/mdml/0.4">
<xsl:output omit-xml-declaration="yes" encoding="ASCII"/>
<xsl:template match="c:document">
<body>
<xsl:apply-templates select="c:metadata"/>
<xsl:apply-templates select="c:content"/>
</body>
</xsl:template>
<xsl:template match="c:metadata">
<xsl:apply-templates select="md:abstract"/>
</xsl:template>
<xsl:template match="md:abstract">
<xsl:apply-templates select="@*|node()"/>
</xsl:template>
但不幸的是,它並沒有捕捉MD:抽象元素。我無法弄清楚,想要是錯的。
非常感謝,我真的錯過了。 –