Quote: http://www.w3.org/TR/xpath#section-Expressions


Each character within a CDATA section is treated as character data. Thus, |<![CDATA[<]]>| in the source document will treated the same as |&lt;|. Both will result in a single |<| character in a text node in the tree. Thus, a CDATA section is treated as if the |<![CDATA[| and |]]>| were removed and every occurrence of |<| and |&| were replaced by |&lt;| and |&amp;| respectively.

   *NOTE: *When a text node that contains a |<| character is written
   out as XML, the |<| character must be escaped by, for example, using
   |&lt;|, or including it in a CDATA section.




Morten Barklund Shockwaved wrote:

Merrill, Jason wrote:

[...]

Problem overview: using Xpath, HTML tags inside of XML does not render,
even with CDATA tags applied.

[...]

Does the same thing with a regular dynamic text field.  If I hard code
the same string directly in the .fla, it renders properly in the text
field and/or component. The string from XPath returns, interestingly
enough, looks like this:

   Welcome to the &lt;a
href=&apos;http://www.fda.gov/cdrh/&apos;&gt;Center for Devices of
Radiological Health&lt;/a&gt;. More text...

Not sure why Xpath is changing the string from "</a>". to "&lt;/a&gt;",
but Flash doesn't like it obviously.  Anyone come across this before and
have a solution?


If you used the regular XML and XMLNode-classes in Flash, you'd come to the same "problem" if you tried to insert the node directly - and didn't use the nodeValue-property of the XMLNode-object.

If your XPath implementation returns XMLNode-object, just use the my_xmlnode.nodeValue-property and insert this in the textfield.

If the XPath implementation returns a string and this string is the toString-value of the XMLNode (which the above is) and *not* the nodeValue-property, then the writer of the XPath implementation should read his manual once again :)

Hope that helps. :)


_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to