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

This is a discussion on How can I write ampersand(&) symbol in XML file? - PHP ; 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.youtube.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 ...

+ Reply to Thread
Results 1 to 3 of 3

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

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

    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.youtube.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.

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

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


    Try: &


    JW

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

    Php Developer:

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


    &

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

    --
    Jock

+ Reply to Thread