Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Special character in CDATA

 
Ian Craig
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to render a trademark symbol within this CDATA tag within an XML document ( I'm using: <?xml version="1.0" encoding="UTF-8"?> )

<head><![CDATA[Product name ™]]> </head>

It just gets rendered as Product name ™

Any help greatly appreciated!


Thanks....

 
Paul Clapham
Sheriff
Pie
Posts: 20966
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, that looks perfectly fine to me the way you posted it.

But perhaps you were trying to say that you used the HTML named entity &trade;? (If you're going to post HTML entities, you have to escape them properly.)

In any case, your document is encoded in UTF-8. So either put the character itself into the document, encoded in UTF-8, or use a character entity like &#x2122;. And by the way it doesn't make any difference that it's inside a CDATA section, the same character rules apply there as for everywhere else in the document.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic