Skip to main content
April 22, 2009
Question

Problem when importing a text from XML file

  • April 22, 2009
  • 1 reply
  • 606 views

Hi everyone,

I am trying to import a text from an xml file. It's an arabic text, I would like to add an html tag in the xml node.

Here is my xml node:

<price><![CDATA[صدار بديل  €]]></price>

Then I set the text property of a spanElement like this:

var _sPrice:String = myXML.price;

var span:SpanElement = new SpanElement(); 
span.text =_sPrice;
paragraphElement.addChild(span);

Everything works fine BUT when I try to add a <br/> tag to my xml node, like this:

<price><![CDATA[صدار بديل <br/>€]]></price>

It shows the <br/> tag and desn't convert it as a new line !

How can I go to the next line by adding a tag or a char code or .. ???

I also tryed using \n but deos't work as well !!

This topic has been closed for replies.

1 reply

Participating Frequently
April 22, 2009

Hi,

The text setter on a SpanElement interprets the passed-in string literally; it does not look for embedded XML tags like <br/>. However, a "\n" in that string should be handled like a newline; could you re-check this behavior?

On a related note, the ability to import an inner node of the markup (rather than the root of the markup) into an intermediate flow element (rather than the containing TextFlow) has been requested before, but we haven't got to it.

Abhishek

(Adobe Systems Inc.)