Help with ampersand in xml
dave.cragg at lacscentre.co.uk
Fri Oct 19 04:47:27 EDT 2012
On 18 Oct 2012, at 16:35, Chris Sheffield <cmsheffield at me.com> wrote:
> For all you xml experts out there. Hoping someone has the answer for this...
> I need to use an ampersand character (&) in xml. It's in a company name like Levi Strauss & Co. Everything I can find on the topic says to use the entity reference "&", but this doesn't seem to be working. I just end up with a blank space. Does anyone know how to make this work?
> I'm beginning to think I've run into a bug in the LiveCode xml parser. I'm currently using the revXMLNodeContents() function. Should I be using some other function?
The following works here (LC 4.6)
In field 1:
<name>Marks & Spencer</name>
In button script:
put revCreateXMLTree(field 1,true,true,false) into tID
put revXMLNodeContents(tID, "/data/company/name") into field 2
Produces 'Marks & Spencer'
More information about the Use-livecode