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

RE: String manipulations with quotes

Subject: RE: String manipulations with quotes
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Thu, 10 Apr 2003 18:54:54 -0400
translate quot
Hi again Betty,

At 06:21 PM 4/10/2003, you wrote:
I don't have control over the authoring.  The quotes are already
embedded in the file.

If the XML file has


<text>"Oh foo!" said Tonya, as she looked at her list of warnings.</text>

and you say

<xsl:template match="text">
  <xsl:value-of select="translate(.,'&quot;','#')"/>
</xsl:template>

you should get

#Oh foo!# said Tonya, as she looked at her list of warnings.

(But note you can't say translate(.,'&quot;','&apos;'), since once it is parsed the stylesheet processor still chokes on translate(.,'&quot;',''') -- in a case like that you have to resort to binding the problem character to a variable.)

The entity is so the *stylesheet* can be parsed; it still represents the character literal it represents.

But in your case I'd simply try:

<xsl:variable name="name1">
     <xsl:value-of select="substring-after($definition, '&quot;')"/>
</xsl:variable>
<xsl:variable name="name2">
     <xsl:value-of select="substring-before($name1,  '&quot;')"/>
</xsl:variable>

The parser reports the values of the select attributes as, e.g.

substring-after($definition, '"')

which should be fine.

Cheers,
Wendell


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================


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.