Behavior of the XML in Flex vs Flex/AIR class

Hi, I created a small application without AIR which simply wraps the text value of a TextArea in a XML tags using the XML class (and the 'escape()' function) as shown in the attached code (see "application not PNEUMATIC").

The resulting XML is as follows (when seen in the debugger and recorded by the PHP script):
< list >
< element >... .text value of TextArea... < / point >
< / list >

In my real application, I then sends this via an HTTPService to a PHP script on my server. The PHP script receives the XML code in its entirety, no problem.

When I wrote an equivalent (same code) AIR application (see "AIR Application" in the attached code), the XML formatting becomes (when seen in the debugger and recorded by the PHP script):
< list >
& lt; point & gt;... text value of TextArea... & lt; / point & gt;
< / list >

When you send this through the HTTPService, the parent < list > tag is removed, which causes the PHP script to fail.

Is this a normal behavior and is there a way to get around this? I looked in the forums, but any reference to this strange behavior between AIR and no AIR Flex change is not found.

Anyone else has the same problem?

Thank you

Marc

Hi rtalton and thanks for the thoughts. This got me thinking about how the XML class constructor and appendChild methods should be called and found the question.

It seems that appeal to the "appendChild" method AIR produces a result different than when not in the AIR, which is curious in itself.

However, I changed my code to be 'good' according to the documentation, and it worked under AIR and airless. Here's what I changed:

The appendChild method is now called as follows:

list.appendChild ({escape (taText.text)});

The quotes have been removed and I'm dealing is no longer the XML as a string.

So, while I was there, I changed the call to the constructor as follows:

list = new XML ();

Same here, no longer treat the XML as a string.

Thank you

Marc

Tags: Flex

Similar Questions

  • How to access the XML in Flex

    < user >

    < UID = "HR" dept >

    < user >

    mm < fname > < / fname >

    < Email > [email protected] < / email >

    < / user >

    < user >

    SSS < fname > < / fname >

    < Email > [email protected] < / email >

    < / user >

    < / dept >

    < UID = 'Finance' dept >

    < user >

    FFFF < fname > < / fname >

    < Email > [email protected] < / email >

    < / user >

    < user >

    www < fname > < / fname >

    < Email > [email protected] < / email >

    < / user >

    < / dept >

    < / users >

    using the HTTP service with access to the data

    This my user.xml file I want to display all the item in flex datagrid using the function navigator tab... each browser tab contains a grid of data for corresponding like HR, sales, Finance Dept

    the corresponding information will be displayed in the data grid

    first tab navigatore is

    HR-> grid of data such as fname, Email field

    Finance-> fname, E Mail

    Try this if you have problems and the way in which you want to change it:


    <>
    "xmlns:MX ="http://www.adobe.com/2006/mxml"
    Layout = "vertical".
    "" xmlns:local = "*".
    creationComplete = "init ()" > "


           
               
                    
                          mm
                          [email protected]
                    

                    
                          SSS
                          [email protected]
                    

               

               
                    
                          FFFF
                          [email protected]
                    

                    
                          www
                          [email protected]
                    

               

           

       

       
       
           
    dataProvider = "{myXML.dept}" > "
               

                   
                       
                           
                           
                       

                   

                       
           
       
       

    Kind regards

    Adrian

  • Tutorial on the edition of Flex/Air app for Mac App Store, or simply using Developer ID for general distribution

    Everyone set up a tutorial on the publication of a Flex/AIR application for distribution as an OSX desktop application, or through Mac App Store, or just simply using the developer Certificate ID?

    In my time as a Flex developer, I've seen some well documented things and some that you had to dig for, but find clear instructions on this is really hard! I would have thought post your Flex/AIR application as a standalone application (captive runtime) users directly or through the Mac App Store (Apple Developer ID certificate signature) would be something that many people are trying to do. But most of the useful post there are dated or incomplete, as well as specifically targeted to iOS. In addition, whenever the AIR SDK changes it seems that many of the recent posts are no longer valid at certain stages.

    Many thanks for anyone who can provide some pointers or suggestions!

    The page of the official doc on presentation of the Mac App Store has been updated there is a little more than two months, recent changes in the recent SDK:

    http://helpx.Adobe.com/Flash-Player/KB/posting-air-app-Mac-app.html

    It must be current, even if I think I see typo in one of the appeals of command line that mentions "textcodesign", when it should just be "codesign".

  • How to convert project based on the web/flash flex AIR project

    I created a new project using Flex Builder 3. When he was asked to select the type of application, I choose the web application (ie, run using flash). Now I also want to make the application as a desktop application (i.e. based on air demand), is there a way to export or convert my existing application based on flash to become an AIR-based application?

    In general, it is possible to switch between applications based on flash and focused application on AIR on the fly, i.e. without creating a new project and by copying all the files to the new project.

    I don't think you can do it on the fly. Usually create us new AIR and copy paste the code.
    I hope this helps.

  • There are spaces in the XML created using Flex?

    Hi all

    I'm developing an extension for CS ID above using Flash Builder 4.6, Extension Builder 2.1.

    My extension requires some example output in the form of xml files. These xml files are then analyzed by software at the customer's end.

    The xml code is created using XML in Flex class.

    The problem is that there are a few spaces induced when a child is added to a node in the xml. For example,.

    <root>
            <Child>
              Os enis eium es
              <Child1 some_attributes>q</fo:inline>
              <Child1 some_attributes>u</fo:inline>
              <Child1 some_attributes>a</fo:inline>
              <Child1 some_attributes>s</fo:inline>
              evelit lab ipicto et volut
              <Child1 some_attributes>user/firstname</fo:inline>
               doluptus.
            </Child>
            <Child>As dis</Child>
    </root>
    

    When I look at the XML above, I see that there are spaces before "Os enis Mert are." I was taking them for indenting that xml uses to distinguish between parent and child. This xml file is not serious?

    The expected results of the customer happens all wrong, it contains spaces, and I suspect if the XML can be a problem.

    Please guide.

    The XML you have posted is not valid, it was wrong with opening and closing tags...

    Flash will add a spacing output XML format if XML.prettyPrinting = true. You could try that setting to false before you send the XML code.

  • Is it possible to read the contents of the XML file rather than the properties for the location of FLEX

    Is it possible to read the contents of the XML file rather than the properties for the location of FLEX

    Strictly speaking, this is not really true. When running, the ResourceManager of IResourceBundles for localization, not deal with XML files or properties files. As long as you implement IResourceBundle, you can back it up with XML, properties, JSON, AMF files - what you want. The problem is that mxmlc will not build modules of resources for you what it is, with the exception of properties files, and cannot compile just resource bundles in a .swf using anything other than properties files. If you build your own interface to spit IResourceBundles, this could work, but it is probably more trouble that it's worth.

    (Assuming that you establish the link in the application) the best solution is to write a script to pre-process the XML in properties files.

  • Problems with the Web Service using XML in Flex

    Hello

    I use a ColdFusion CFC, which is configured to generate an XML string. It runs on ColdFusion MX 6.1 and is configured as a remote web service. I tested the call and it returns the string XML fine when it is called from another method of Flex unfounded. My problem is this simple Flex application to call the same function via a service web, I wrote below. I cannot get to the exit results, keeps showing as NULL. I can't use the HTTP of Flex appeal for remote access because I'm not under MX7. Does anyone know what is wrong with my code? BTW, I would do the work of cross - domain.xml file to call the cfc, let me know if you want to test and I can add your domain name. Thank you!

    <? XML version = "1.0" encoding = "utf-8"? >
    "" < mx:Application xmlns:mx = ' http://www.adobe.com/2006/mxml ' layout = "absolute" >

    <! - set Web Service to get the XML data of course catalog - >
    < mx:WebService
    ID = "cd".
    "WSDL =" http://training.wonderware.com/components/courses.cfc?wsdl "
    Load = "CD.getCourseCatalogXML.Send ()" "
    showBusyCursor = "true" fault = "Alert.show (event.fault.message), 'Error' ' result =" cdResult (event) ">"
    < mx:operation name = "getCourseCatalogXML" resultFormat = "e4x" >
    < mx:request >
    < IDCalendrier > 3 < / IDCalendrier >
    < / mx:request >
    < / mx:operation >
    < / mx:WebService >

    < mx:Script >
    <! [CDATA]
    Import mx.controls.Alert;
    Import mx.rpc.events.ResultEvent;
    Import mx.rpc.events.FaultEvent;

    [Bindable]
    public var outputString:String

    public void cdResult(event:ResultEvent):void
    {
    outputString = event.result as String
    }
    []] >
    < / mx:Script >

    < mx:Canvas horizontalScrollPolicy = "off" verticalScrollPolicy = "off" >
    < mx:Text width = '100% ' paddingLeft = "4" paddingRight = paddingTop "4" = "4" >
    < mx:text > OUTPUT: {outputString} < / mx:text >
    < / mx:Text >
    < / mx:Canvas >

    < / mx:Application >

    Thank you very much! I do not have the notion that the HTTPService is indded just an HTTP call. So yes that it a much simpler way to call just ColdFusion to return the XML string to the application. No reason to use Flash Remoting or CFCS etc... and certainly not a web server. This made the turn that I called a HTTPService now what charges by coldfusion page that returns XML and bam, works well with e4x result etc... Thanks tracy!

  • The OPM with Flex Integratio

    How can I integrate my policy of oracle modeling project or rules with Flex Application.We r, trying to make the same type of project which was given under the example of the OPM (social services), but in Adobe Flex.
    Until now I have written rules in the modelling of policies of oracle, and then through the policy modellinhg that only I generated web services and try to call flex.
    But I'm still not clear with how this can be achieved, which can be useful for me for flex response to oracle rule engine.
    Can you explain the process step by step nd guide me for this project.

    My approach is correct?

    It would be very useful if you clear my doubts about the integration of the OPM with Flex.

    There are two ways to access the engine.

    The first way accesses the engine through the Java or .NET API. To make the Flex will be able to make direct calls to Java or .NET.

    The second way is through the determinations Server Web Service. Determinations server is specifically designed to provide a large grain end access to the engine rules, through XML/SOAP over HTTP. Assessment service is a way without decision-making status (namely:-data in--> answer to). Maintenance service provides a way to create a more dynamic experience (IE, create a session, add/modify the data, get the screens to answer questions)

    Flex can call Java or .NET API directly then, you can use the API to the engine if you need to run the server of determinations as a remote web application and access, the engine using the service to assess or maintenance.

    Looks like Flex certainly has support for calling web services, which suggests that the approach of Determiantions server would work. A quick google for Flex, Java and .NET looks like access to Java and .NET is always done through web services.

  • Display an icon on the ToggleButton in Flex 4.5SDK.

    In trouble, displaying an icon on the ToggleButton in Flex 4.5SDK beside the text, or simply as an icon. Icon assume to be shipped, here is the code:


    <? XML version = "1.0" encoding = "utf-8"? >
    " < = xmlns:fx s:WindowedApplication ' http://ns.Adobe.com/MXML/2009 "
    xmlns:s = "library://ns.adobe.com/flex/spark".
    xmlns:MX = "library://ns.adobe.com/flex/mx" >
    < fx:Declarations >
    <! - Place non-visual elements (e.g., services, items of value) here - >
    < / fx:Declarations >
    "< s:ToggleButton label = 'test' icon="@Embed (source = 'available.png') "width ="100"height ="100"/ >
    < / s:WindowedApplication >

    It works for me in Flex Hero (build 18623) of http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+Hero

    Peter

  • table behavior difference between php and flex?

    I think that this problem is probably caused by a difference in behavior of the table between php and flex I am not quite striking.  It's the flex code that I wrote and the php code is shown below.  I'm new to flex and this really left me speechless.    Thanks a lot for your help.

    The entries are father = [SB1, kit] dam [kit, kit] = sireLinkedP = E (P) and [e F]

    Output should be (and is with PHP) random = [E, P, SB1], [E, P, kit], [e, P, SB1], [e kit, P],

    What I get is random = [E, P, SB1, kit], [E, P, SB1, kit], [e, P, SB1, kit], [e, P, SB1, kit]

    function randomlinks(sire:Array,dam:Array,sireLinkedP:Array):Array {}

    var str:String [0] sire = .toUpperCase ();

    var str1:String sire [1] = .toUpperCase ();

    var str2:String dam [0] = .toUpperCase ();

    var str3:String dam [1] = .toUpperCase ();

    var x: uint = sireLinkedP.length;

    var k: uint = 0;

    var random: Array = new Array();

    x--;

    trace ("randomlinks sirelinked:" + sireLinkedP);

    for (var i: uint = 0; i < = x; i ++) {}

    for (var j: uint = 0; j < = 1; j ++) {}

    random [k] = sireLinkedP [i];

    trace ("random" + k + ":" + random [k]);

    If (str == [0] sire | str1 == sire [1] | str2 == dam [0] | str3 == dam [1]) {}

    random [k] .push (sire [j]);

         }//end if

    trace ("random" + k + ":" + random [k]);

         k++;

    } //end for loop

    } //end for loop

    trace ("randomlinks:" + random);

    return (random);

    { } //end randomlinks function

    function randomlinks ($sire, $dam, $sirelinked) {}

    $x = count ($sirelinked);

    $x--;

    $k = 0;

    for ($i = 0; $i < = $x; $i ++) {}

    for ($j = 0; $j < = 1; $j ++) {}

    $random [$k] = $sirelinked [$i];

    if (ctype_upper($sire[0]) | ctype_upper($sire[1]) | ctype_upper($dam[0]) | ctype_upper($dam[1])) {}

    array_push($random[$k],$sire[$j]) ;}

    $k++;

    }

    }

    Return ($Random);

    }

    You are right to make a copy. In Flex, the tables are references, if this assignment: random [k] = sireLinkedP [i] affects [k] random real behind sireLinkedP [i] matrix instead of a copy. Who is?

    -Kevin

  • How to Append and update XML in flex

    I need help... I am developing a desktop using Flex and Air application.

    I would like to add and update the xml code by using this application. How can I add and update XML data?

    If the user gives input is recorded in an XML file. can someone tell me how to do this?


    Thanks in advance,

    Verhasselt

    You may need to set some variables outside the functions so that they are "global".

    If this post answers your question or assistance, please mark it as such.

  • XML in Flex data

    I'm passing in XML from a CFC data, works fine... Sure, I can see the data in debug mode, but the data do not work like it if data is built in Flex itself. I'm pulling in the XML data to use control "CheckBox State 3 tree" which can be downloaded from the exchange for Flex developers.

    If the XML is created in Flex itself code control works very well. Here's how the XML data are created in Flex:

    [Bindable]
    public var folderList:XMLList =
    <>
    < State folder = "Schrödinger" label = "Documents Marketing" isBranch = "true" >
    < State folder = "Schrödinger" isBranch = "true" label = 'Media, PR and Communications' >
    < Status folder = "unchecked" isBranch = "false" label = "Article Reprint warnings" / >
    < Status folder = "unchecked" isBranch = "false" label = "Reprints of Articles" / >
    < Status folder = "unchecked" isBranch = "false" label = "Interviews and transcripts" / >
    < Status folder = "unchecked" isBranch = "false" label = "Press kits" / >
    < Status folder = "unchecked" isBranch = "false" label = "Press Releases" / >
    < Status folder = "unchecked" isBranch = "false" label = "Quick Hits" / >
    < Status folder = "unchecked" isBranch = "false" label = "Rep Talking Points" / > "
    < Status folder = "unchecked" isBranch = "false" label = "Special updates" / >
    < Status folder = "checked" isBranch = "false" label = "White papers" / >
    < / case >
    < State folder = "Schrödinger" isBranch = "true" label = "Forms and Applications" >
    < Status folder = "unchecked" isBranch = "false" label = "Applications" / >
    < Status folder = "checked" isBranch = "false" label = "Forms" / >
    < / case >
    < / case >
    <>/.

    [Bindable]
    public var folderCollection:XMLListCollection;

    private void init (): void {}
    folderCollection = new XMLListCollection (folderList);
    checkTree.dataProvider = folderCollection;
    }


    If I demand a break and look at the data in debug mode, I see that the content of the XMLListCollectionList folderCollection looks like this image: CLICK HERE TO SEE the XML data XML built in Flex

    When I pass the data in Flex using a CFC, it comes as an XMLList object. I have therefore converted to an XMLListCollection and pass it to the component. Here is the code I use to do this, under the call to the CFC...

    <? XML version = "1.0" encoding = "iso-8859-1? >
    "" < mx:Canvas xmlns:mx = ' http://www.adobe.com/2006/mxml " height ="100% "width ="100% "creationComplete =" init () ">"

    < mx:Script >
    <! [CDATA]

    Import mx.collections. *;
    Import datamodels.allowedTablesModel;
    import util. CheckTreeRenderer;
    Import events.allowedTableEvent;

    [Bindable]
    public var allTablesList_1:XMLList;

    [Bindable]
    public var folderCollection:XMLListCollection;

    private void init (): void {}
    folderCollection = new XMLListCollection (allTablesList_1);
    checkTree.dataProvider = folderCollection;
    }


    private function modTables (): void
    {
    modButton.visible = true;
    Used to pause the applet so I can look at the data
    }

    []] >
    < / mx:Script >
    < mx:Tree id = "checkTree" itemRenderer = util. "' LabelField CheckTreeRenderer ' = 'label' width ="100% "height ="100% "/ >

    < mx:Button id = "modButton" fontFamily = "Arial" fontSize = "10" fontWeight = "bold" click = "modTables ()" "
    label = "Edit table" visible = "true" x = "553,5" y = "428" width = "125" / >

    < / mx:Canvas >


    If I pass the data in a CFC data looks like the folowwing image when I stop it in Flex.
    CLICK HERE TO SEE THE DATA PASSED IN TO A CFC

    I don't see why the work of the component if I build data in applet verses passing via an XML stream. Any ideas?

    Have an ordinary day...
    KomputerMan ~ |  :-)

    Adobe support...

    "When you use a provider with a tree-based XML data you specify the label field, even if it is"label". The XML object includes the root, so you must define showRoot = "false". Remember that the tree does not, by default, the dynamic changes to the XML object. »

    So all I had to do was change the label of the component of this:

    to do this:

    Just as an info... Adobe support is worth the cost if you are fairly new to Flex. I've been bending for about 9 months now and find their invaluable service!

    Have an ordinary day...
    KomputerMan ~ |  :-)

  • Using XML with Flex - better Question practice

    Hello

    I use an XML file as a dataProvider for my Flex application.
    My request is quite large and we do move a lot of data - so the XML file I use is also big enough.

    I have read a few tutorials and had air in-depth examples online and I'm just after a little advice. My application works, but I don't know if I went about setting up and using my data provider of the best (most effective) way.

    I'm basically after a few tips as to time, I go on (access) using my XML and by filling my Flex application is the best and most effective way?

    My request is made up of the main application (MXML) and also additional file in the form of files / components.

    I'll set up my connection to my XML in my application file master file using HTTPService:

    < mx:HTTPService
    ID = 'myResults '.
    ' URL =' http://localhost/myFlexDataProvider.xml '
    resultFormat = "e4x".
    result = "myResultHandler (Event)" / > "

    and the manipulation of my results with the following function:

    public void myResultHandler(event:ResultEvent):void
    {
    myDataFeed = event.result as XML;
    }

    in my application, I'll put my values of variables by first delacring them:

    public var fName:String;
    public var lName:String;
    public var zipcode: string;
    public var telNum:int;

    And then, giving them a value to "break" into the XML, E; g:

    fName = myDataFeed.employeeDetails.contactDetails.firstName;
    lName = myDataFeed.employeeDetails.contactDetails.lastName;
    Postal code = myDataFeed.employeeDetails.contactDetails.address.postcode;
    telNum = myDataFeed.employeeDetails.contactDetails.postcode;

    etc...

    So, for any of my external components (components in another FILE), I'm so referencing the values it with Application:

    Import mx.core.Application;

    And by setting the values / variables in components AS as follows:

    public var fName:String;
    public var lName:String;


    fName = Application.application.myDataFeed.employeeDetails.contactDetails.firstName;
    lName = Application.application.myDataFeed.employeeDetails.contactDetails.lastName;


    As mentioned this method seems to work, however, is the best way to do it? :
    -Connect to my XML file
    -Set up my application variables
    -Give my values of variables of the XML file...

    Keeping in mind that there are many variable must be defined and there for a lot of lines of code just setting and allocation of variable values of my XML file in this particular application.

    Could someone advise me please on this one there?

    Thank you very much
    Jon.

    I see no problem with it.

    Your alternatives are to ignore instance variables and to query the XML directly. If you use values in many places, the Variables will be easier to use and maintain.

    Also, instead of instance variables, colld place you in the values in an "associative array" (object/hashtable), or in a dictionary.

    Tracy

  • Problem with the upgrade to Flex 3

    I've recently updated for Flex 3 and an app I wrote with the beta 3 version, which worked very well does not work with the release candidate version. Most of the stuff has been cosmetic which I expected but a major problem is that the TileList info is not displayed.

    Code

    < mx:HTTPService id = "tempXML" resultFormat = "e4x" result = "onResult (event)" url =" http://rbdev.mysite.net/info_wrapper.php?url=https: / / {customer.text}.mysite.net/interface. php? action = showopen & amp; operation = showassets & amp; format = xml & amp; opstatus = crit & amp; name of user = {username.text} & amp; password = {password.text} ' / >}"

    < mx:TileList dataProvider = labelField "{_xlcMyListData}" = "fleet" left = "35" right = "15".
    width = "350" backgroundColor = "#000000" color = "#ff0000" fontSize = "27" borderColor = "#000000" columnWidth = rowHeight "315" = "50" themeColor = "#808080" fontWeight = "bold" allowMultipleSelection = "true" id = "TileList1" height = "0" y = "202" x = "178" / >

    < mx:Script >
    <! [CDATA]
    Setting the display of the TileList component
    Import mx.collections.XMLListCollection;

    [Bindable]
    private var _xlcMyListData:XMLListCollection;

    private void onResult(Event:ResultEvent):void {}
    var xmlResult:XML = XML (Event.result);
    _xlcMyListData = new XMLListCollection (xmlResult.. asset);
    }

    []] >
    < / mx:Script >


    As stated before the app displayed data before with flex2 and the beta of flex 3. Is there something I'm missing now?

    My call to the server was wrong. It wasn't a problem with flex.

  • What are the blue lines in the edition of flex?

    What are the blue lines in the edition of flex?

    They are markers of flex tempo... Info of tempo based inserted automatically embedded in the file. If you want to remove

    Edition->-> remove tempo tempo. -then reset flex markers

Maybe you are looking for

  • Satellite C660-108 does not start with 8 GB of RAM

    I bought 2 x 4 GB memory modules to upgrade memory up to 8 GB.With 8 GB installed, the laptop does not start, but he will start with 6 GB installed.Modules 4 GB 6 GB configuration and wood East of 1.8. Any ideas?

  • Problems with spyder solitare

    Use Vista for 2 years playing solitare spyder throughout. Tried today and a box comes up and says "the system has run out of memory." Try closing some applications and try again. "All other games work. I have no other applications open. What is the p

  • Delete records hotmail - need to remove complete files folders

    Had to remove records of complete files Tried everything that was suggested. Nothing works

  • Don't go past the start screen in windows xp

    I get the home screen of windows and for a few seconds and a black screen, I can't get into safe mode and try when do a last screen repair no disc r is incrypted with by pgp

  • How to connect the mobile device for windows 7

    I am new to Windows 7. I have a mobile device that runs Windows CE and connects via a serial cable. In earlier versions of windows, I could just install activesync on my desktop PC, click on connect on my mobile device and it could connect and visibl