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
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
- XSLT Help and Discussion (7625)
-> + pass xsl-variable to javascrip... (2)
-> + Character Encoding of an exist... (5)
-> + Convert xml to Spss syntax (2)
-> + Appending XML data (4)
-> + newbie..... create XSL from XM... (5)
-> + Mapping xslt files - beginner ... (3)
-> + consolidating footnotes (2)
-> + xslt tranformation using msxml... (2)
-> + xslt - one input xml and outpu... (2)
-> + XSL record lookup via a extern... (3)
-> + difficult problem for an xslt ... (2)
-> + Help, is it possible to have a... (2)
-> + XML Scenarios (2)
-> + Too Many XSLTs Need a better o... (3)
-> + Transforming ADO output (4)
-> + remove commas, single quotes, ... (2)
-> - problem writing & character in... (6)
-> ->problem writing & charact...
-> ->problem writing & charact...
-> ->problem writing & charact...
-> ->problem writing & charact...
-> ->problem writing & charact...
-> + get a default value for any at... (2)
-> - set new value fro a default te... (1)
-> - get a default value for xslt (1)
-- Previous [1321-1340] [1341-1360] [1361-1380] Next
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
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.

   
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.