dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: HTML Format of XML attributes not working

  1. #1
    Senior Member
    Join Date
    Apr 2001
    Posts
    260

    HTML Format of XML attributes not working

    Hi there,

    I've got some xml in attribute format but I need to make one of the words bold. Sounds simple. I've done a search on this forum and the web looking for help but it's not really helping much.
    I can get the <b></b> tags to show up correctly in the dynamic text box but it doesn't actually bold the word.
    here is my code:
    XML
    PHP Code:
    <articles>
        
    <
    article
    image
    ="hero.jpg"
    title="&lt;b&gt; EDRA: &lt;/b&gt; GLOBAL TALENT MAGNET "
    intro="Vestibulum in quam vel nisi dapibus facilisis."
    body="
    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum in quam vel nisi dapibus facilisis. Sed laoreet turpis vel mi. Curabitur nunc pede, pharetra sed, luctus at, molestie eu, lacus. 
            
    Curabitur fringilla facilisis nulla. Quisque volutpat ante id lectus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In hac habitasse platea dictumst. 

    Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Ut tincidunt nisi quis ipsum. Suspendisse volutpat. Vivamus enim. Pellentesque vel sapien eget tellus porta aliquet."

    blogQuote=""
    blogLink=""
    />

    </
    articles
    I think I'm using the correct tags but the output is <b>EDRA:</b> Global....


    Is it possible to format attributes?

    Cheers
    Matt

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    html enable the dynamic textfield

    xx = new XML();
    xx.ignoreWhite = true;
    xx.load("xml.xml");

    xx.onLoad = function(){
    aNode = this.firstChild.childNodes;
    Title = aNode[0].attributes['title'];
    txt.html = true;
    txt.htmlText = Title;
    }
    Last edited by a_modified_dog; 04-21-2008 at 07:09 AM.

  3. #3
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    or make use of a CDATA section
    PHP Code:
    <articles
    <
    title><![CDATA[<b>EDRA:</b> GLOBAL TALENT MAGNET]]></title>     
    <
    article image="hero.jpg" 
    intro="Vestibulum in quam vel nisi dapibus facilisis." 
    body="Lorem ipsum dolor sit amet, consectetuer adipiscing."
    blogQuote="" 
    blogLink="" /> 
    </
    articles
    PHP Code:
    xx = new XML();
    xx.ignoreWhite true;
    xx.load("xml.xml");

    xx.onLoad = function(){
    aNode this.firstChild.childNodes;
    Title aNode[0].firstChild.nodeValue;
    txt.html true;
    txt.htmlText Title;


  4. #4
    Junior Member
    Join Date
    Feb 2002
    Posts
    4
    I'm having the same problem, but Evelyn's, (sorry, _modified dog ; ) ) isn't doing the trick for me.

    Anyone else have any suggestions on this problem?

    Thanks!

  5. #5
    Junior Member
    Join Date
    Feb 2009
    Posts
    1
    You are doing good, but you have to use in the dynamic text field: htmlText not text. That's it.

    Hek.

    Greetings from Costa Rica.

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