+ Reply to Thread
Results 1 to 3 of 3

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

  1. #1
    Junior Member
    Join Date
    Nov 2009
    Posts
    0

    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. #2
    Junior Member
    Join Date
    Nov 2009
    Posts
    0

    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. #3
    Junior Member
    Join Date
    Nov 2009
    Posts
    0

    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