Reputation: 8836
What is a XSLT template that will get the <title></title>
that contains the name of a blog and put it in every <entry></entry>
or as an attribute in every <entry>
?
from
<feed>
<title>title of feed</title>
<entry>...</entry>
<entry>...</entry>
</feed>
to
<feed>
<entry><blog>title of feed</blog>...</entry>
<entry><blog>title of feed</blog>...</entry>
</feed>
or
<feed>
<entry blog="title of blog">...</entry>
<entry blog="title of blog">...</entry>
</feed>
Upvotes: 0
Views: 100
Reputation: 1144
for the attribute solution, something like this should work :
<xsl:template match="entry">
<entry blog="{/feed/title}">
<xsl:apply-templates/>
</entry>
</xsl:template>
Upvotes: 2