Subject:problem writing & character in output xml Author:seema r Date:12 Sep 2006 05:29 AM
I am writing an xslt for xml to xml conversion, A tag in output xml must have a string value like &a=1,&b=2. am able to write the character '&' in output but the I get message not well formed expected ';'. How do I solve this. Please help me.
Subject:problem writing & character in output xml Author:seema r Date:12 Sep 2006 11:25 PM
I am writing it as &
i.e i need to write in output xml &num I write in xslt as &num
and the resulting xml contains &num as expected, when I try to validate the output xml it says ; expected.
I have also tried:
<xsl:text disable-output-escaping="yes">&amp;name:</xsl:text>
<xsl:value-of select="."/>
this gives output as &name: but in browser view gives the expected contents. which one is right..
Subject:problem writing & character in output xml Author:Tony Lavinio Date:13 Sep 2006 09:22 AM
Avoid using xsl:disable-output-escaping.
It's still not quite clear what you want.
Either use <xsl:text>&name:</xsl:text>
to get &name: into the output, or use
<xsl:text>&amp;name:</xsl:text> to get
&name: into the output.
The reason it might work in a browser is that
browsers are design to handle poorly-formed
HTML, but XML was designed to transfer data
with high fidelity. So XML is less forgiving.
But you should be able to satisfy both.