XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
seema rSubject: 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.

Postnext
Tony LavinioSubject: problem writing & character in output xml
Author: Tony Lavinio
Date: 12 Sep 2006 09:20 AM
Showing us how you are writing this out would help.
But taking a wild guess, I suspect you need to say
& instead of just plain &.

Postnext
seema rSubject: 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.

Postnext
Tony LavinioSubject: problem writing & character in output xml
Author: Tony Lavinio
Date: 12 Sep 2006 11:51 PM
Can you paste an example here?
Remember in your code you need to say &nnn; - the final semicolon
is necessary.

Postnext
seema rSubject: problem writing & character in output xml
Author: seema r
Date: 13 Sep 2006 12:26 AM
I am using the follo code, which gives the expected result, but the resulting xml is not well formed and I get a message saying ; expected.

<xsl:text disable-output-escaping="yes">&amp;name:</xsl:text>
<xsl:value-of select="."/>


I have also tried:
<xsl:text disable-output-escaping="yes">&amp;amp;name:</xsl:text>
<xsl:value-of select="."/>
this gives output as &amp;name: but in browser view gives the expected contents. which one is right..

Posttop
Tony LavinioSubject: 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>&amp;name:</xsl:text>
to get &name: into the output, or use
<xsl:text>&amp;amp;name:</xsl:text> to get
&amp;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.

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.