Combine content from separate nodes
This is an open discussion with 1 reply, filed under XSLT.
Search
yes there's a simple solution if (only if) you have a coherent structure.
You can use a ninja technique. Use the standard HTML ninja technique packaged with symphony to manage HTML, then add the following templates to it. (I'd suggest you change the mode from html
as you might already be using this elsewhere.
<xsl:template match='div' mode='html> <blockquote> <xsl:apply-templates select='*' mode='html> </blockquote> </xsl:template> <xsl:template match='p' mode='html> <xsl:apply-templates select='*|text' mode='html> </xsl:template>
your additional templates should look like above; obviously then do a call template mode='html' on the whole block you want.
Create an account or sign in to comment.
Hi,
I have an unknown number of nodes (paragraphs). I would like to combine the contents from all these nodes, and whatever content there is outside the nodes, into one single, new node.
For example:
I would like to transform this to
Since I don't know the exact structure of my source, this proves more difficult than I anticipated. I'm thinking there must be a simple solution. Any help is welcome!