PDA

View Full Version : Issue with SimpleXML - HELP :(



theSchtickler
April 29th, 2008, 09:57 PM
Hi there,

I'm facing an issue with simpleXML, that it bugs out when it reads a xml node that doesnt have a value like....


<info></info>

Is there a way to stop it getting all upset when this happens? I have empty nodes all thru my xml and it would be a nightmare to actually have to alter the xml as its automatically generated. Any suggestions anyone?

Thanks

theSchtickler
April 30th, 2008, 01:54 AM
All good, appears to have been something to do with it erroring on the & symbol, then it pulled up the empty node errors. Once all the & symbols were gone, it went away :)

icio
April 30th, 2008, 11:06 AM
If you need/want to use a "&" character in an XML file, you should use the escaped value: "&amp;" in their place, just like you would with "<" and "&lt;" and ">" and "&gt;"