A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: CDATA section

  1. #1
    Member
    Join Date
    Sep 2000
    Posts
    70

    CDATA section

    Hi guys

    How can I load xml with CDATA so part of node can be formatted

    Tried this but only the first text appears not CDATA part


    <?xml version="1.0" encoding="utf-8"?>
    <images>
    <image url="img/flashgallery/images/1.jpg" thumb="img/flashgallery/images/thumbs/1.jpg" rollText = "name 1" caption ="description" ><![CDATA[with html formated text <font color="#ff7700">XML</font> driven]]></image>
    </images

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    your CDATA section requires its own node
    PHP Code:
    myXML = new XML();
    myXML.ignoreWhite = true;
    myXML.load("xml.xml");

    myXML.onLoad = function(){
    txt.html = true;
    txt.htmlText = this.firstChild.childNodes[1].firstChild.nodeValue;
    };

    /**

    <?xml version="1.0" encoding="UTF-8" ?>
    <images>
    <image url="img/flashgallery/images/1.jpg" thumb="img/flashgallery/images/thumbs/1.jpg" rollText = "name 1" caption ="description" ></image>
    <node><![CDATA[with html formated text <font color='#FF7700'>XML</font> driven ]]></node>
    </images>

    */

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center