SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2006
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile XML create_text_node and tags.

    Which XML DOM (PHP4) function is used to put text data with HTML code in the XML Document (like <strong></strong> and <br />)?

    A little more in depth..:

    I created an XML document from MySQL data.
    On the string, I use the nl2br function which created <br /> for newlines.

    PHP Code:
    $value $XML->create_text_node(nl2br($Object['obj3_text1']));
    $value $a->append_child($value); 
    The output it creates is this:
    PHP Code:
          <a href="http://www.google.com" title="Google INC">Google is a market leader search engine. &lt;br /&gt;&#xD;
    </a
    The < > chars are showed as they would in HTML, and I don't really now what's "&#xD;".

    It seems that I need to add some kind of node as a whole here, with the inside tags.
    Last edited by Anabel; Mar 22, 2006 at 23:52.

  2. #2
    SitePoint Evangelist ClickHeRe's Avatar
    Join Date
    Mar 2005
    Location
    Ottawa, Canada
    Posts
    580
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    &#xD; is the Carriage return character
    David


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •