Re: [xsl] Wrapping two different elements in parent element.

Subject: Re: [xsl] Wrapping two different elements in parent element.
From: George Cristian Bina <george@xxxxxxxxxxxxx>
Date: Fri, 28 Sep 2007 14:16:39 +0300
Hi Bruno,

That is very easy with XSLT 2.0:

<?xml version="1.0"?>
<xsl:stylesheet version="2.0" xmlns:xsl="";>
<xsl:output indent="yes"/>
<xsl:template match="something">
<xsl:for-each-group select="*" group-ending-with="word_form">
<form><xsl:apply-templates select="current-group()"/></form>

 <xsl:template match="word_case">
  <case><xsl:value-of select="."/></case>

 <xsl:template match="word_form">
  <form><xsl:value-of select="."/></form>

Best Regards,
George Cristian Bina -
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger

Bruno Nahod wrote:

Im working on transforming xml export from a dictionary application; witch is unbelievably unstructured into a well formed xml document (based on TEI recommendations). My biggest problem is how to wrap two (or more) elements into parent element. This is the simplified example of what I have and what Im hoping to get;

This I have (export)

<?xml version="1.0" encoding="UTF-8"?>









This I hope to get;

<?xml version="1.0" encoding="UTF-8"?>

















Thank you very much


Current Thread