Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old February 28th, 2006, 04:32 AM
Authorized User
Join Date: Jan 2006
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default ' = ' issue

I am trying to have in the out put a String with ' in the begining and in its end (for example, I want it to print 'hello' in that way in the out put.)

I thought of using the ' phrase but I dont think it is working.
<xsl:value-of select= "concat('try', &apos;hello&apos;)"/>
(I thought to use it just like I use " when I want to write ")

I will appreciate if you have an idea how to write it or what is wrong.

thank you

Old February 28th, 2006, 05:51 AM
mhkay's Avatar
Wrox Author
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts

You need to appreciate that &apos; is translated to ' by the XML parser, so this produces the text

concat('try', 'hello')

which is what the XPath processor then evaluates.

I find the simplest way to handle quotes and apostrophes is to declare

<xsl:variable name="apos">'</xsl:variable>
<xsl:variable name="quot">"</xsl:variable>

and then use things like concat($quot, 'hello', $quot)

Michael Kay
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
Old February 28th, 2006, 09:52 AM
Authorized User
Join Date: Jan 2006
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts

thank you very much


Similar Threads
Thread Thread Starter Forum Replies Last Post
Safari & Just-In-Time Debugger Issue gabster Visual Studio 2005 0 January 22nd, 2008 01:55 PM
Form & Table issue Grafixx01 Access 7 April 30th, 2007 08:13 PM
Gridview & DetailsView Database Image Issue ayadrocks ASP.NET 2.0 Basics 1 December 27th, 2005 05:50 PM
JSP & Proxy Issue mmcgough JSP Basics 0 March 29th, 2005 11:05 AM
Office automation & ASP issue Greg Griffiths VBScript 2 July 5th, 2003 05:42 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.