thank you iilsley.  Your suggestion to use CDATA works.

However, I have a large number of these input XML files and rather
than changing each one of them, I was hoping to be able to specify
globally which tags should be ignored (<b>, <a>, etc) and that they
could be ignored in all of the XML files.  

Is there a way to do this globally?  Perhaps by specifying an HTML
namespace or something similar?  
Or is it possible to programatically tell the XML class that <text>
has no child nodes, in other words to programatically force the XML
class to treat the contents of <text></text> as CDATA?

Thank you


--- In [email protected], "iilsley" <[EMAIL PROTECTED]> wrote:
>
> 
> try
> 
> <text>
> <![CDATA[
> This is the text with <b>html</b> tags
> ]]>
> </text>
> 
> 
> --- In [email protected] <mailto:[email protected]> ,
> "jamalwally" <jamalwally@> wrote:
> >
> > Hi there,
> >
> > I am using an external XML file to define the content for a Text
> > component in Flex.  The xml file has HTML tags (e.g. <b> for bold).
> >
> > When I assign the XML to the Text component's htmlText property, I get
> > unwanted extra line breaks around the HTML tags.
> >
> > For example, here is the external XML file:
> >
> > <text>
> >   This is the text with <b>html</b> tags
> > </text>
> >
> > Then in actionscript I load the XML file and create the Text component
> >
> >   // create the XML file loader
> >   var xmlLoader = new URLLoader();
> >   xmlLoader.load(new URLRequest(externalFilename));
> >
> >   // create an XML object from the file contents
> >   var myxml:XML = new XML(xmlLoader.data);
> >
> >   // make the Text component
> >   var mytext:Text = new Text();
> >   mytext.htmlText = myxml;
> >
> > The displayed text component has three lines of text because of
> > unwanted line breaks around the HTML <b> tag:
> >   "This is the text with
> >   *html*
> >   tags"
> >
> > Instead of just one line of text as I was hoping for:
> >   "This is the text with *html* tags"
> >
> > Is there a way around this (perhaps a way to specify a set of tags
> > (e.g. <b>) that should not be interpreted as XML sub-nodes of <text>?
> >
> > Thanks in advance
> >
>


Reply via email to