User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the RSS, Web Services and SOAP section within the Web Development category of DaniWeb, a massive community of 374,612 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,494 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our RSS, Web Services and SOAP advertiser:
Views: 6499 | Replies: 6 | Solved
Reply
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 10,873
Reputation: cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice 
Rep Power: 32
Solved Threads: 108
Admin
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb

Special characters with XSLT

  #1  
May 10th, 2006
I am using an XSL document to pretty print my RSS feed. However, special characters don't parse - they appear within the feed as   and &

What line(s) do I need to specify in my RSS and XSL XML documents in order to get these to work? It's my understanding that & " < > should work by default but I need to do extra to work to map   to a space.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: May 2006
Posts: 6
Reputation: bwhiti is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
bwhiti bwhiti is offline Offline
Newbie Poster

Re: Special characters with XSLT

  #2  
May 10th, 2006
In your dtd try this

<!ENTITY &nbsp; " ">
Reply With Quote  
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 10,873
Reputation: cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice 
Rep Power: 32
Solved Threads: 108
Admin
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb

Re: Special characters with XSLT

  #3  
May 10th, 2006
I was reading up about that but I haven't tried it yet. What I'm most in need of is getting &amp; to work, but from what I understand, it should by default? I'm using UTF-8 if that matters.
Reply With Quote  
Join Date: May 2006
Posts: 6
Reputation: bwhiti is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
bwhiti bwhiti is offline Offline
Newbie Poster

Re: Special characters with XSLT

  #4  
May 10th, 2006
Entities such as &amp; and &quote; will need to be specified into the dtd but you could always use the hex value so for a single quote you could use &39; and whitespace you could use   this will always be transformed for you with no problems and saves you declaring the entities in the dtd.
Reply With Quote  
Join Date: May 2006
Posts: 6
Reputation: bwhiti is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
bwhiti bwhiti is offline Offline
Newbie Poster

Re: Special characters with XSLT

  #5  
May 10th, 2006
sorry a space is and a single quote qould be
Reply With Quote  
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 10,873
Reputation: cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice cscgal is just really nice 
Rep Power: 32
Solved Threads: 108
Admin
Staff Writer
cscgal's Avatar
cscgal cscgal is offline Offline
The Queen of DaniWeb

Re: Special characters with XSLT

  #6  
May 10th, 2006
Thank you for your help. I did some research and the following worked:

I replaced
[html]<xsl:value-of select="description" />[/html]
with
[html]<xsl:value-of select="description" disable-output-escaping="yes" />[/html]
Reply With Quote  
Join Date: Mar 2008
Posts: 1
Reputation: aparvaiz is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
aparvaiz aparvaiz is offline Offline
Newbie Poster

Re: Special characters with XSLT

  #7  
Mar 23rd, 2008
great tip, thx for the help

Originally Posted by cscgal View Post
Thank you for your help. I did some research and the following worked:

I replaced
[html]<xsl:value-of select="description" />[/html]
with
[html]<xsl:value-of select="description" disable-output-escaping="yes" />[/html]
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb RSS, Web Services and SOAP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the RSS, Web Services and SOAP Forum

All times are GMT -4. The time now is 8:35 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC