dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: HTML text from XML file

  1. #1
    Junior Member
    Join Date
    Aug 2001
    Posts
    5

    HTML text from XML file

    I'm pulling in text from an XML file and trying to render the text as HTML. I seem to be running into a problem. When it hits a node with HTML tags in it it get's confused and doesn't display anything.

    Example:
    HTML Code:
    <news_body>Here is a <a href="http://www.google.com" target="_blank">website</a>!</news_body>
    Anything from the link on is not displayed.

    Any help would be appreciated.
    Last edited by zufferguffin; 10-17-2005 at 12:46 PM.

  2. #2
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    Use a trace statement to look at what you are actually assigning to the html text box.

    You haven't posted your code but I bet you are using firstChild to get the text. Well the <a href=""> is another node and appears as the second child node.

    Here is a code example that shows how to extract and format html text from XML:

    http://tupps.com/flash/examples/load.../demoText.html

    Thanks

    Luke
    Flash-XML FAQ
    http://www.tupps.com/flash/faq/

  3. #3
    Junior Member
    Join Date
    Aug 2001
    Posts
    5
    Thanks a ton Tupps. That was a huge help. I was able to get it working the way needed now.

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