[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] curly quotes in XML


Subject: Re: [xsl] curly quotes in XML
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Fri, 10 May 2002 11:45:04 -0400

But I'm afraid Cihan might be talking about a case in which he has "smart quotes" in tags, in lieu of the correct "dumb quotes" (paired " or ' characters).

If this is the case, Cihan, your XML is lying to you: it's not XML, but merely almost-XML. An XML parser won't parse it.

Pre-process it with the string-processing language of your choice, such as Perl, Python or sed. It can't be done in XSLT.

(Trying to exercise his own mind-reading powers),
Wendell

At 11:03 AM 5/10/2002, David wrote:
> What is the best way to get rid of curly quotes/smart quotes in XML to
> XML transformation. I have no control over incoming XML document.

replace by nothing or replace by straight quotes?

translate(.,'&#201C;&#201D;','&quot;&quot;')

will replace the left and right " by '


translate(.,'&#201C;&#201D;','')


will remove them,

David


======================================================================
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
Keywords
xml