|
Subject: Re: [xsl] Wrap changing element sequence into container: with 'for-each-group'? From: Abel Braaksma <abel.online@xxxxxxxxx> Date: Fri, 26 Jan 2007 11:33:14 +0100 |
<a>
<b>
<b1/>
<b2/>
</b>
<c/>
</a>
<a>
<b>
<b2/>
</b>
<c/>
</a><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
Cheers, -- Abel Braaksma http://www.nuntia.nl
Given two XML fragments
<a> <b1/> <b2/> <c/> </a>
and
<a> <b2/> <c/> </a>
I would like to wrap <b1/><b2/> into a <b/> container, and the same should happen to <b2/> when occurring alone. The other elements can be assumed to remain unchanged.
While I found quite some hints on solving grouping problems in the XSLT FAQ and in the XSL list archive, I can't figure out how to solve this wrapping task using XSLT 2.0. There is an interesting posting here: http://www.biglist.com/lists/xsl-list/archives/200201/msg00804.html
But I don't know how this could serve as a basis for a solution to my problem.
I suspect that "for-each-group" should be my friend; how would I need to use it here? Or is there any other, more elegant solution?
Yours,
Yves
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] Wrap changing element seq, David Carlisle | Thread | Re: [xsl] Wrap changing element seq, Yves Forkl |
| Re: [xsl] XHTML templating (best me, David Carlisle | Date | [xsl] [ANN] oXygen XML Editor 8.1, George Cristian Bina |
| Month |