Hi all,
I have the following XML-document
Code:
<?xml version="1.0" encoding="utf-8" ?>
<datarows>
<datarow>1.Some text
<br/>bla bla 1<br/></datarow>
<datarow>2.Some text
<br/>bla bla 2<br/></datarow>
</datarows>
And i want to end up with the following textfile:
"1.Some text";"bla bla 1";
"2.Some text";"bla bla 2";
All text in a datarow-element must be on a single line and every br-element must be replaced by a ';'.
I can't seem to remove the newlines that are in the datarow-elements.
Here's my stylesheet. I'm sure it is a minor adjustment.
Code:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" encoding="utf-8" />
<xsl:strip-space elements="*"/>
<xsl:template match="datarow">
<xsl:text>"</xsl:text>
<xsl:apply-templates />
<br/>
<xsl:text>";</xsl:text>
</xsl:template>
<xsl:template match="br">
<xsl:text>";"</xsl:text>
</xsl:template>
</xsl:stylesheet>
Many thanks in advance,
Raoul.