5 Replies Latest reply on Jun 29, 2011 2:22 PM by Maxime Chupin

    < XML and TextFlowUtil.importFromXML

    Maxime Chupin Level 1

      Hi,

       

      I want to display some Xml Files. Here I reproduce my code:

       

      * my main file

      <?xml version="1.0" encoding="utf-8" ?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                     xmlns:s="library://ns.adobe.com/flex/spark"
                     xmlns:mx="library://ns.adobe.com/flex/mx"
                     >  

       

         <fx:Script>
          <![CDATA[
               import spark.utils.TextFlowUtil;
               XML.ignoreWhitespace = false;        
          ]]>
         </fx:Script>
         <fx:Declarations>
           <fx:XML id="xmlFile" source="testxml.xml"/>
         </fx:Declarations>
         <s:Panel>
           <s:RichEditableText id="code2" editable="false"
                  textFlow="{TextFlowUtil.importFromXML(xmlFile)}"/>
         </s:Panel>
        
      </s:Application>

       

      * testxml.xml

      <?xml version="1.0" encoding="utf-8"?>
      <TextFlow xmlns="http://ns.adobe.com/textLayout/2008
            whiteSpaceCollapse="preserve">
      <span>Coucou</span> &lt;
      </TextFlow>

       

      If testxml.xml does not contain &lt; (or &rt;), this works fine, but as soon as I put this caracters, whereas the compilation works, the application does not appear in my brownser (I use Linux,  I don't have any error message).

       

      Thanks for your help.