Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

newbie question ² problem

Status
Not open for further replies.
Jul 28, 2005
358
FR
Hi,

I'm completely new to xml, but have been asked to write a php script to create an xml file from database enties.

Everything was going fine, I came up against a problem when there was a & sign in the database fields but worked that out by changing it to & but I now need to change a superscript 2 (to denote square metres - 10m²). I looked through and saw that I needed to replace this with ² which wasn't difficult (using php preg_replace function), but when I go to view the xml file I get the following error:

Code:
Reference to undefined entity 'sup2'. Error processing resource '[URL unfurl="true"]http://path/to/file.xml'[/URL]

One of the lines in question is formed like this:
Code:
Big original villa, 276m ² /3050ft ²  LA, 5 bedrooms, second villa 110m ²
- This is only a part of the line as it's a big desription.

Can anyone point me in the right direction as to what I need to do; just the correct way to form the line would be fine, I'm not worried about the xml tags as I have them all sorted.

Thanks,

Richard
 
It's ok now I think,

Just found a link to the html entities on w3schools and replaced them with entity number (²) and all seems fine.

Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top