I would like to know the XSLT pattern for the below sample.
Input
<root>
<p>Sample data 1</p>
<data>1</data>
<data>2</data>
<data>3</data>
<data>4</data>
<p>Sample data 2</p>
<p>Sample data 3</p>
<data>a</data>
<data>b</data>
<data>c<i>d</i>e</data>
<data>d</data>
<p>Sample data 4</p>
</root>
Required Output:
<root>
<p>Sample data 1</p>
**<data>1 2 3 4</data>**
<p>Sample data 2</p>
<p>Sample data 3</p>
**<data>a b c<i>d</i>e d</data>**
<p>Sample data 4</p>
</root>
I want to group the tag "<data>" with space inside the "<data>" for the entire XML file. There might be many occurence of "<data>" tag in single file.
Thanks,
Muthu
This transformation:
when applied on the provided XML document:
produces the wanted, correct result: