i need to insert values of several elements into one cdata… here is my code:
first, i made output:
<xsl:output method="xml" encoding="UTF-8" intend="yes" cdata-section-elements="embassy" />
and here is element definition:
<xsl:element name="embassy">
<xsl:value-of select="Visa/visa_velv/visa_velv_name" />
<xsl:element name="br" />
<xsl:value-of select="Visa/visa_velv/visa_velv_address" />
<xsl:element name="br" />
<xsl:value-of select="Visa/visa_velv/visa_velv_city" />
</xsl:element>
and here is bad output for my need:
<embassy><![CDATA[Ambasada e Republikes se Cekise]]>
<br/><![CDATA[Rruga Skënderbej 10]]>
<br/><![CDATA[Tirana]]>
</embassy>
i need this output:
<embassy>
<![CDATA[Ambasada e Republikes se Cekise<br/>Rruga Skënderbej 10<br/>Tirana]]>
</embassy>
i was reading documentation but i can’t find solution. thanks for helping 🙂
This complete and simple transformation:
when applied on the folowing XML document:
produces the wanted result: