this advice is all crazy talk.

the proper way to do it is to use CDATA tags.



On Aug 9, 2006, at 12:04 PM, Ryan Potter wrote:

Another way that works pretty well is to do a join on the child nodes.

So your trace would look like this:

trace(newsNode.childNodes[i].childNodes.join(""));

As long as your html is xml compliant (<br/> instead of <br>) it will
work just fine.



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Lucy
Thomson
Sent: Wednesday, August 09, 2006 9:56 AM
To: Flashcoders mailing list
Subject: [Flashcoders] HTML in XML

Yep use cdata tags, except I think you have 2 nodes there, so open and
close them within each one. They basically tell flash to treat
everything defined between them as html, so your symbols < and > don't
mess up the xml format.

<newsitem date="8/5/2006" headline="Some headline"><![CDATA[ Body of the
news
article. <a href="http://www.google.com";>Google</a> More body of the
article]]></newsitem>  <newsitem date="8/1/2006" headline="Another
headline"><![CDATA[ Body of the second article ]]></newsitem>


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Geoff
Stearns
Sent: 09 August 2006 15:22
To: Flashcoders mailing list
Subject: Re: [Flashcoders] HTML in XML

you just need to put the html content inside a cdata tag:

<newsitem date="8/5/2006" headline="Some headline"><![CDATA[ Body of
the news
article. <a href="http://www.google.com";>Google</a> More body of the
article</newsitem>  <newsitem date="8/1/2006" headline="Another
headline">Body of the second article ]]></newsitem>

On Aug 8, 2006, at 4:15 PM, Burns, John D wrote:

I'm having a very weird problem and I'm hoping it's something simple
that I'm overlooking. I have an xml document similar to this:

<news>
 <newsitem date="8/5/2006" headline="Some headline">Body of the news
article. <a href="http://www.google.com";>Google</a> More body of the
article</newsitem>  <newsitem date="8/1/2006" headline="Another
headline">Body of the second article</newsitem> </news>

The problem I'm having is that on the first article where the link is, flash is seeing that as the end of the first node and then it skips to
the next one. I'm looping over the nodes in news and using this code:

trace(newsNode.childNodes[i].firstChild.nodeValue);

and all I would see for the first record is "Body of the news article"
and then it goes on to the next one. A client is maintaining news
through a flat xml file and wants to be able to add links. Am I
missing
something simple? Is there something else I need to do? Please help.

John Burns
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to