Click to See Complete Forum and Search --> : XML '£' sign not displaying on site


fri3ndly
07-18-2008, 05:57 AM
Hello there everyone

I am not experienced in XML in the slightest and we requirea bit of help please.

One of my clients has an issue on her site which needs fixing and I cannot seem to get hold of the developer of it

Basically it's a flash website front end, and a php cms backend which writes to XML files which the flash can then load.

She is trying to insert ‘£’ and ‘&’ symbols which are being converted somewhere down the line but we are unable to find where.

There is a PHP statement that converts the '&' to 'and', but unable to find anything for '£'.

Does anyone know if there is a way to display the £ sign? Thanks

Mr. E. Cryptic
07-18-2008, 06:36 AM
Not exactly sure what your problem is, what is the & being converted to. Anyway, if you're trying to output the ampersand symbol (&) you should be using & and for the £ symbol you should use £

fri3ndly
07-18-2008, 06:47 AM
Hi Thanks for the reply

The problem is that the Flash just displays the '£' and '&' as text if its converted like that. I wish it was that simple :(

Marcin
07-18-2008, 06:53 AM
with xml £ entity is invalid. I think you should use:


<description>
<![CDATA[Sample description £$&.]]>
</description>


<![CDATA[...........]]> is designed for ignore its content by paraser:
http://www.w3schools.com/xml/xml_cdata.asp

bogocles
07-18-2008, 11:34 AM
You may also use the proper entity reference, which for XML, is almost always the entity number.

The pound sign can be referenced by an entity name or number, which are &pound; and 163 (preceded by a &# and followed by a ;, of course) respectively. In XML, the only entity names allowed are &gt;, &lt;, and one or two others. Everything else, even &nbsp; has to be referenced by number, or else a parse error will occur or the entity will be skipped, depending on the compliance level of the parser.

CDATA blocks are good to use and I wish I saw more XML developers use these for long element values. However, using them to encapsulate a single character you don't want parsed can lead to more typing and overhead (and, for some, more confusion).

Being somewhat of the forum newb, I don't know how to disable entity parsing which is why I didn't combine all the characters in the entity number (which ends up being the £)

Check this out for more entity name/numbers:

http://www.w3schools.com/tags/ref_entities.asp