Xml XSLT转换将一个元素移动到另一个元素中或将其设置为属性

Xml XSLT转换将一个元素移动到另一个元素中或将其设置为属性,xml,xslt,Xml,Xslt,什么是XSLT模板,它将获取包含博客名称的,并将其放在每个中,或者作为每个中的属性 从 提要标题 ... ... 到 提要的标题。。。 提要的标题。。。 或 ... ... 对于属性解决方案,类似这样的方法应该可以工作: <xsl:template match="entry"> <entry blog="{/feed/title}"> <xsl:apply-templates/> </entry> <

什么是XSLT模板,它将获取包含博客名称的
,并将其放在每个
中,或者作为每个
中的属性


提要标题
...
...


提要的标题。。。
提要的标题。。。


...
...

对于属性解决方案,类似这样的方法应该可以工作:

<xsl:template match="entry">
    <entry blog="{/feed/title}">
        <xsl:apply-templates/>
    </entry>
</xsl:template>


到目前为止,您尝试了什么?如果你能表现出一点努力尝试自己回答这个问题,你通常会得到更好、更多的答案。我们中的许多人都不喜欢回答问题,除非我们觉得你会因此学到一些东西(因此将来问的问题会更少)。如果我们不知道你为什么会有问题,那么我们就不知道你需要学习什么。
<feed>
<entry><blog>title of feed</blog>...</entry>
<entry><blog>title of feed</blog>...</entry>
</feed>
<feed>
<entry blog="title of blog">...</entry>
<entry blog="title of blog">...</entry>
</feed>
<xsl:template match="entry">
    <entry blog="{/feed/title}">
        <xsl:apply-templates/>
    </entry>
</xsl:template>