[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

How do you prevent ' from being escaped within an

Subject: How do you prevent ' from being escaped within an attribute value
From: "Jonathan Miller" <jhmiller001@xxxxxxxxx>
Date: Sun, 5 Aug 2001 16:21:07 -0400
output apos
How do you prevent &apos; from being escaped in an attribute value?

For example:

===================================
XML input:
===================================
<values person="John Doe"/>

===================================
XSL input:
===================================

<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  version="1.0">

  <xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>

  <xsl:template match="values">
    <xsl:variable name="person" select="string(./@person)"/>

    <xsl:variable name="Tree">
      <QUERY where="NAME LIKE &apos;{$person}&apos;"></QUERY>
    </xsl:variable>

    <xsl:copy-of select="$Tree"/>

  </xsl:template>

</xsl:stylesheet>

====================================
Output:
====================================
<QUERY where="NAME LIKE 'John Doe'"/>


I have tried many different variations of the above example and I can't seem
to achieve the desired output of:
<QUERY where="NAME LIKE &apos;John Doe&apos;"/>

If I use another escaped character such as &amp; the output will be:
<QUERY where="NAME LIKE &amp;John Doe&amp;"/>
>From the XML spec I gather this has something to do with the fact that it is
an attribute.

If a quick fix isn't available, is there a way to access XSL variables from
within a CDATA section.

Any help you could provide would be much appreciated!

Thanks,
Jon





_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.