XSL: copy subnodes and process some of them

This topic is 4132 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

Hi, I am currently trying to get the following result (HTML):
Microsoft has issued five new bulletins providing patches to solve
several problems.  Due to the criticlality of some of the problems the
application of the patches is highly recommended. Microsoft
from this piece of XML code:
<body tg-ref="en-admin"  headline="Summary">
Microsoft has issued five new bulletins providing patches to solve
several problems.  Due to the criticlality of some of the problems the
</body>
The problem is to copy the text from the body-node and process the child nodes as well. And in the end, everything must fit together. My current approach is to iterate along the descendant-or-self axis and process depending on the node type:
<xsl:for-each select="descendant-or-self::*">
<xsl:if test="name() = 'body'">
<xsl:value-of select="name()"/><xsl:copy-of select="."/>
</xsl:if>
</xsl:if>
</xsl:for-each>

The result is not exactly what I need, but I think it is logical that I don't get what I need. The stylesheet copies the text of the body-node and concatenates the following nodes at the end of this text. Is there a way to get the required results? Maybe a two-pass algorithm where I first copy the body-node's contents and then process all the links in the second pass? Thanks, Enrico

1. 1
2. 2
3. 3
4. 4
Rutin
17
5. 5

• 13
• 14
• 9
• 9
• 9
• Forum Statistics

• Total Topics
632927
• Total Posts
3009241
• Who's Online (See full list)

There are no registered users currently online

×