How can I write ampersand(&) symbol in XML file?

How can I write ampersand(&) symbol in XML file?

am 08.01.2008 18:28:44 von php.developer2007

I am trying to write "http://www.youtube.com/v/8mVuBC7hQnU&rel=1"
in an XML file as
$nlink->appendChild($this->createElement('URI','http://www.y outube.com/
v/8mVuBC7hQnU&rel=1'));
It gives me error as DOMDocument::createElement()
[function.DOMDocument-createElement]: unterminated entity reference
rel=1
My question is How can I write ampersand(&) symbol in XML file ??
I also tried as $nlink->appendChild($this->createElement('URI','abc
& xyz'));
But It didnt solve my problem.

Re: How can I write ampersand(&) symbol in XML file?

am 09.01.2008 12:03:36 von Janwillem Borleffs

Php Developer schreef:
> I also tried as $nlink->appendChild($this->createElement('URI','abc
> & xyz'));
> But It didnt solve my problem.

Try: &


JW

Re: How can I write ampersand(&) symbol in XML file?

am 10.01.2008 10:53:11 von John Dunlop

Php Developer:

> My question is How can I write ampersand(&) symbol in XML file ??

&

http://www.w3.org/TR/REC-xml/#syntax

--
Jock