XSLT-match不';好像不行
我的变换中有一行:XSLT-match不';好像不行,xslt,match,Xslt,Match,我的变换中有一行: 当我将其应用于以下情况时: <detaileddescription> <para><simplesect kind="since"> <para>yesterday</para> </simplesect></para></detaileddescription> 昨天 我希望它能起作用 但是,我注意到和标记之间需要有一个空格 因此,以下内
当我将其应用于以下情况时:
<detaileddescription>
<para><simplesect kind="since">
<para>yesterday</para>
</simplesect></para></detaileddescription>
昨天
我希望它能起作用
但是,我注意到和标记之间需要有一个空格
因此,以下内容与上述内容不匹配
<detaileddescription>
<para> <simplesect kind="since">
<para>yesterday</para>
</simplesect></para></detaileddescription>
昨天
我被难住了。你知道我为什么打电话吗?现在,我唯一的解决方案是找到
的每个实例,并将其更改为此样式表:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="simplesect[@kind='since']">
<modified><xsl:apply-templates/></modified>
</xsl:template>
</xsl:stylesheet>
应用于第一个输入时,产生:
<?xml version="1.0" encoding="utf-8"?>
<detaileddescription>
<para>
<modified>
<para>yesterday</para>
</modified>
</para>
</detaileddescription>
昨天
它在两方面都起作用。问题在于您访问它的方式。如果您只向我们显示XSLT的一行,就很难告诉您XSLT有什么问题。你给我们看的线路看起来不错,所以问题可能在别处。