[英]xsl:apply-templates not iterating over each node given by select
[英]apply-templates select="@*|node()
我对xslt非常陌生。 请帮助我了解xslt下面的流程对于给定的xml如何工作
输出将与输入相同还是输出仅包含属性。
<xsl:template match="/">
<Request>
<xsl:apply-templates select="Envelope/body/*" />
</Request>
</xsl:template>
<xsl:template match="*">
<xsl:element name="{local-name()}">
<xsl:apply-templates select="@*|node()"/>
</xsl:element>
</xsl:template>
<xsl:template match="@*">
<xsl:attribute name="{local-name()}">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:template>
谢谢
<Request>
元素。 Envelope/body
下的元素( *
)。 *
)或属性( @*
)匹配,并输出相同的模板,但不包括组件名称的名称空间部分。
<xsl:apply-templates select="@*|node()"/>
),直到没有子级为止。 实际上,该脚本旨在输出封装在<Request>
元素中而没有名称空间的信封正文内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.