LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-17-2007, 05:49 AM   #1
vasudevadas
Member
 
Registered: Jul 2003
Location: Bedford, UK
Distribution: Slackware 11.0, LFS 6.1
Posts: 519

Rep: Reputation: 30
Transforming XML to HTML: how do I replace ' with '


Hi all,

I am transforming XML data into XHTML using XSLT. Pretty standard stuff. Some of the data in my XML document contains apostrophes, which have been appropriately escaped as "'". But I do not want this escape sequence to appear in my output HTML, because "'" is not an escape sequence in HTML. Firefox does seem to translate the sequence back to an apostrophe anyway, but Internet Explorer does not, and this matters.

I would have thought this must be a standard thing that people must deal with, but I am having trouble finding the answer to my question by Googling. Can anybody help? The solution must be implemented in XSLT 1.0 btw.

Thanks all.
 
Old 08-17-2007, 11:12 PM   #2
95se
Member
 
Registered: Apr 2002
Location: Windsor, ON, CA
Distribution: Ubuntu
Posts: 740

Rep: Reputation: 32
What happens in MSIE if you set the DTD to be XHTML transitional?
 
Old 08-18-2007, 12:05 AM   #3
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
You can always quote the apostrophe...

Hi -

This link has what appears to be a fairly simple workaround:

http://www.stylusstudio.com/xsllist/...post20710.html
 
Old 08-20-2007, 09:41 AM   #4
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,515

Rep: Reputation: 239Reputation: 239Reputation: 239
what about
Code:
<xsl:output method="text"/>
    or
<xsl:output method="html"/>
???

Last edited by bigearsbilly; 08-20-2007 at 09:46 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Search & Replace Technique to Fix html HREFs w/o html extension donv2 Linux - Newbie 1 01-30-2007 11:59 PM
text to xml to html osio Programming 5 07-28-2005 12:39 PM
How to "Search & Replace" in html files using Perl? rebel Red Hat 8 04-09-2005 12:58 PM
html, xml, php, mysql atheist Programming 8 06-07-2004 01:28 PM
XML can't store HTML?!? Travis86 Programming 10 08-25-2003 07:18 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration