AS3 returns a string of XML nodes as null...

I am working on a project that calls and search in an XML spreadsheet that looks like this:

    <Searchtext Wordlookup="john smith">
        <location>$1</location>
        <Name>john smith</Name>
    </Searchtext>

and he keeps going for about 100 people.

Now, my flash takes these data and allows the user to click on a TextBox filled beforehand with a name (whose e.target.data.text is combined with the XML using @Wordlookup) or type the name of the person (new corresponding content of the text box to @Wordlookup) which translates the location of this person to light upward (MC is named the same as the location for each node). This effect works perfectly well by using this code:

  var result:String = xmldata.Searchtext.(@Wordlookup == inputTxt.text.toLowerCase()).location.toString();  

Now I want to do the opposite; Click on a location, and the code will be able to match the name of the movieclip to node my xm - light to the top of this location, location and name of the person in the output text box. Only problem with this Flash apparently thinks a knot in my xml is now a variable which is not set (it should return the name associated with the location in my xml). I looked up and down for a solution, but I can't seem to solve it (this is probably simple, and I go facepalm myself) inducing code error is the following:

  var resultz:String = xmldata.Searchtext.(location.text() == e.target.name).Name.toString();

And the error produced is as follows: ReferenceError: Error #1065: location Variable is not defined.

You don't know exactly why this is the case, thank you in advance for any help!

All your nodes have a node location? If this isn't the case, you might be better off using child ('location').

Tags: Adobe Animate

Similar Questions

  • converting string to XML using Xquery transformation in OSB node

    How to convert the string to XML node elementusing built in function by using Xquery transformation in OSB?

    Discover this - http://www.javamonamour.org/2011/06/fn-beainlinedxml.html

    If in SOA (BPEL & mediator), you can use oraext:parseXML.

    You must analyze in depth where to implement your requirement as some good practices advise to implement logic more complex in SOA and let OSB only connect to endpoints of services.

    Hope this helps,

    A.

  • conversion of XML node to a string using Xquery transformation in OSB

    How to convert XML node to a string using a built in function by using Xquery transformation in OSB? In BPEL, we the Xpath function ora extension: getContentAsString() to do the same.

    Do you mean fn - bea:serialize()?

    http://download.Oracle.com/docs/CD/E13159_01/OSB/docs10gr3/Userguide/XQuery.html#wp1104692

  • too many return values for a single node

    I have a table with two columns

    the table structure
    ----------------------
    string school_name type
    xmltype obj_xml

    Row1
    ----------
    abc_school,
    < student >
    < student >
    < id > 101 / < ID >
    < teacher > CBA < / teacher >
    < / student >
    < student >
    < id > 102 / < ID >
    XYZ < teacher > < / teacher >
    ONP < teacher > < / teacher >
    RSM < teacher > < / teacher >
    < / student >
    < / students >

    row2
    -----------
    def_school,
    < student >
    < student >
    < id > 301 / < ID >
    pqr < teacher > < / teacher >
    < / student >
    < student >
    < id > 302 / < ID >
    XYZ < teacher > < / teacher >
    < / student >
    < / students >


    is it possible to display data in the format using a query oracle below.
    ---------------------------------------------------------------------------------------------------
    teacher id school_name
    --------------------- ------- ------------
    abc_school 101 abc
    abc_school 102 xyz
    abc_school 102 onp
    RSM abc_school 102


    I used the slot request, throwing an error - too many return values for a single node

    SELECT school_name, teacher
    ExtractValue (value (x), ' / / key ') like student_id
    extractValue (value (x), ' / / value ') AS teacher
    SCHOOL t,.
    TABLE)
    XMLSequence (extract (obj_xml, ' / students/pupils '))
    ) x

    Please post How can I modify this query, the teacher tags may vary for each student

    Published by: user7955917 on May 8, 2012 04:00

    As mentioned in your other thread today, it would be helpful if you could post your exact version of db.
    Samples of work would be appreciated too, the XML data, you gave are not correct.

    I would do it with two XMLTables, like this:

    SQL> SELECT school_name
      2       , x1.id
      3       , x2.teacher
      4  FROM school t
      5     , XMLTable('/students/student'
      6         passing t.obj_xml
      7         columns id       number   path 'id'
      8               , teachers xmltype  path 'teacher'
      9       ) x1
     10     , XMLTable('/teacher'
     11         passing x1.teachers
     12         columns teacher  varchar2(30) path '.'
     13       ) x2
     14  ;
    
    SCHOOL_NAME                            ID TEACHER
    ------------------------------ ---------- ------------------------------
    abc_school                            101 abc
    abc_school                            102 xyz
    abc_school                            102 onp
    abc_school                            102 rsm
    def_school                            301 pqr
    def_school                            302 xyz
    
    6 rows selected
     
    
  • function string.search XML

    I am trying to create a simple xml search function that searches for a file xml to a string and if this string is found in the xml file, view the node that contains this string in a text box.

    I have the simple search feature works, but that I can't do, is to return the specific node. Right now, the function returns all of the xml data instead. If someone could take a look and possibly give some tips on how to return the specific daya, I would be much obliged. Hope that makes sense, if not, let me know and I will do my best to clarify.

    ~ chipleh

    The xml file:

    <?xml version="1.0"?>
    <root> 
    
     <sim>
    
      <bodyText>
    
       <moduleName></moduleName>
    
       <page number = "1">    
    
        <title></title>
    
        <navItem></navItem>
    
        <para><![CDATA[<p>Content Goes 
    here</p>]]> </para>
    
        <subpage number="1">
    
         <subtitle></subtitle>
    
         <subNavItem></subNavItem>
    
         <para><![CDATA[<p>SubContent1 Goes 
    here</p>]]> </para>
    
        </subpage>
    
        <subpage number="2">
    
         <subtitle></subtitle>
    
         <subNavItem></subNavItem>
    
         <para><![CDATA[<p>SubContent2 Goes 
    here</p>]]> </para>
    
        </subpage>
    
       </page>
    
       <page number = "2">    
    
        <title></title>
    
        <navItem></navItem>
    
        <para><![CDATA[<p>Content Goes 
    here</p>]]> </para>
    
        <subpage number="1">
    
         <subtitle></subtitle>
    
         <subNavItem></subNavItem>
    
         <para><![CDATA[<p>SubContent1 Goes 
    here</p>]]> </para>
    
        </subpage>
    
        <subpage number="2">
    
         <subtitle></subtitle>
    
         <subNavItem></subNavItem>
    
         <para><![CDATA[<p>SubContent2 Goes 
    here</p>]]> </para>
    
        </subpage>
    
       </page>
    
      </bodyText>
    
     </sim>
    
    </root>
    
    

    Code:

    searchInput.text = "";
    searchDisplay.text = "";
    searchButton.addEventListener(MouseEvent.MOUSE_DOWN, searchXMLFile);
    
    //xmlFileToSearch = xml.sim.bodyText (previously defined in the code, which is not posted here);
    var xmlFileToSearch:XMLList;
    
    function searchXMLFile(Event:MouseEvent):void{
     
     for (var i:Number = 0;i<xmlFileToSearch.page.para.length();i++){
      var paragraphText:String = xmlFileToSearch.page.para[i]; 
      trace("[" + i + ".] " + paragraphText);
      paragraphText.search(searchInput.text.toString());//:int
      var str:String = paragraphText;  
      trace(i + ". " + str.search(searchInput.text)); // output: 9 
      if (str.search(searchInput.text) > -1){
       //searchDisplay.text = "match";
       searchDisplay.text = paragraphText;
      }else{
       searchDisplay.text = "no match";
      }
     }  
    }
    

    Hello

    Here's a quick example, hope that will guide you towards something, but I don't see what you are after, perhaps you simply complicated this?

    Best regards

    package
    {
    import flash.display.Sprite;
    /**
    * Search xml example
    * @author "Severiaan" Grela Lukasz
    */
    SerializableAttribute public class Test extends Sprite
    {
    public void Test()
    {
    var XML: data =.


                                   
                                   
                                   
                                   
                                       
                                       
                                         Insert content here

    ]]>
                                           
                                            
                                            
                                             SubContent1 goes here

    ]]>
                                           
                                           
                                            
                                            
                                             SubContent2 goes here

    ]]>
                                           
                                          
                                          
                                           
                                           
                                            Insert content here

    ]]>
                                           
                                            
                                            
                                             SubContent1 goes here

    ]]>
                                           
                                           
                                            
                                            
                                             SubContent2 goes here

    ]]>
                                           
                                          
                                         
                                        
    ;
                                       
    var m_sSearchTerm:String = "go";
    var list: XMLList = data.descendants ();
    for (var i: int = 0; i< list.length();="">
    {
    var point: XML = list [i];
    var textList:XMLList = item.text ();
    for (var j: int = 0; j< textlist.length();="">
    {
    var t:XML = text [j];
    If (t.toString () .indexOf (m_sSearchTerm)! = - 1).
    {
    trace (Item.ToXmlString ()); / / c SubContent2 goes here

    ]]>
    trace ("\t" + t); / / that is

    SubContent2 goes here

    }
    }
    }
               
    }
    }
    }

  • Problem with to access the XML nodes whose namespace

    Hello
    I have a XML file with the following format;

    "" "" "< graphml version ="1.3"xmlns =" http://graphml.graphdrawing.org/xmlns/graphml ' xmlns:y = ' http://www.yworks.com/xml/graphml ' xmlns: xsi = " http://www.w3.org/2001/XMLSchema-instance" > "

    < graph id = 'G' edgedefault 'ordered' = >

    < key data 'd11' = >
    < y: SharedData >
    < name there: Brush = "SolidBrush" color = "Black" id = "1" / >
    < / y: SharedData >
    < / data >

    < node id = "G:n0" >
    < y: Labels >
    < y: Text > <! [CDATA [start]] > < / Text: y >
    < / y: Labels >
    < / node >

    < node id = "G:n1" >
    < y: Labels >
    < y: Text > <! [CDATA [end]] > < / Text: y >
    < / y: Labels >
    < / node >

    < / chart >

    < / graphml >


    I access this file as < mx:XML id = "layoutXml" source = "tmp.xml" / > "

    I have no application debugging and found that the layoutXml object contains the xml file as it is. Now when I try to access any child node of layoutXml, every time I found null. Same instruction layoutXml.graph.toXMLString () or layoutXml.graph.toString () returns null.

    I have tryied the following approach as well, but did not work,
    var nameSpace:Namespace = new Namespace (" http://www.yworks.com/xml/graphml");
    var str:String = layoutXml.graph.node. (@id == ' G:n0").nameSpace::Labels.nameSpace::Text.toXMLString();")
    also, this property returns null.

    If anyone has the solution, please answer.

    Thank you.

    Namespace var sets default namespace:
    lack of namespace xml = nameSpace;

    You should then be able to reference nodes normally.

    Tracy

  • The analysis of string to xml format

    Dear all,

    I have an OSB service that returns an xml string output form.
    I call this OSB service in BPEL but it fails because of the format of the string received by BPEL.

    How can I avoid it. I also try to convert string to xml but failing to do so.

    The pointers to that would be useful

    Thank you and best regards,
    MITS

    try to set the response from transport HTTP header
    http:content-type=text/XML
    application/xml or (even better)

    (and of course, you must make sure you have fn - bea: inlinedXml() function to convert the string in an XmlObject)

  • Alteration of the content of an XML node in java

    Hi all

    I change the contents of an XML node using java, using the method of setTextContent() a node.

    Sometimes I also add child nodes of a node. In this case, when I add the child nodes of a given node, when I print the xml data, I see the added nodes.

    for example:

    Initial XML:

    < a > < / a >
    < b > < / b >
    < c > < / c >


    For my project requirement, based on certain conditions, I do 'a' 'b', 'c' as children nodes nodes. I reached this output.


    The problem is

    FINAL XML:

    < a > < b > < / b > < c > < / c > < / a >


    I get the nodes children in the same line as above. But the power required should be as below.


    REQUIRED XML

    < a >
    < b > < / b >
    < c > < / c >
    < /a >

    I also used the Doc.normalize () function. But still, it helps strength.

    Kindly help me in this regard.

    Thank you
    Sabarisri. N

    Hello

    You can try to transform the result as below:

    Transformer transformer = TransformerFactory.newInstance () .newTransformer ();
    transformer.setOutputProperty (OutputKeys.INDENT, 'yes');

    initialize the StreamResult with the object of the file to save to file
    StreamResult result = new StreamResult (new StringWriter());

    DOMSource source = new DOMSource (doc); Here, the doc is you XML document.
    transform. Transform (source, result);

    String xmlString = result.getWriter (m:System.NET.SocketAddress.ToString ());
    System.out.println (xmlString);

    Thank you best regards &,.
    Nilesh Sahni (www.infocepts.com)

    Published by: Nilesh on August 30, 2011 12:31

  • Date in format XML nodes

    I work with XML in AS3. I'm loading in an xml with dates in a format such as:

    2011-1-12-10-00-a

    I am to convert those to the actual Date of Flash in order to compare them and use the methods of the class Date, etc. I prefer convert once and then store them in the XML node, they came.

    Is it possible to store complex values such as date or what you have in an XML?

    Yes, or more directly using:

    var ms:int=date.getTime();

    var newDate:Date = new Date (ms);

  • No idea how to loop and add the value to the attribute of the xml node?

    I work on a lot of flattening of project using a watched folder.

    I have a process parent to locate the directory and call a sub-process to flatten PDF files.

    I want to write the directory failed to XML.

    If there are several directory failed locations and if I want to add it to the node, he doesn't let me do.

    If I set the Xpath location like/process_data/outputXML/flattenDirectoryRequestMessage/failureFileLocation[x]/@path it gives me invalid character exception. I use 'x' for looping and incrementing.

    If I do not use the [x]. The directory is overwritten.

    No idea how loop and add all the directories failed to attribute of the xml node?

    I understand that you can not browse the xml code to assign the value at each node. Rather you can assign only one time to the node.

    I realized that it is not possible to do it this way. Then concatenate it as strings, and then attach to the xml once.

  • String to XML format

    Hello

    How can I convert a string in XML format if I use tags?

    sergei_developer wrote:

    You must use:

    var x: XML =blaaaaaaat;

    var s:String = x.info.@title;

    This code is incorrect and will not work. 'title' is not an attribute but a node if you need to access it this way and also, the node root (called 'info') is considered implicit, which means you acceding the node 'title' in this way: var s:String = x.titel;

    Good luck

    Barni

  • The value of the XML node

    I'm going after Yahoo Weather and try to get the value of an XML node

    So after I take the node

    item_buildNode.ToString () = < lastBuildDate > Tuesday, December 26, 2006 12:51 pm CST < / lastBuildDate >

    So I know that I have the appropriate node

    But I want just the value without the tags

    If I try to item_buildNode... nodeValue, which returns a null value

    Can I just the value? If so, how?


    Thank you
    Mathias

    Well, too bad. I have search the Forum better.

    It's item_buildNode.firstChild.nodeValue

  • WebService returning a string

    Maybe I should know this, but:

    I call a method of a Web service that returns a string. Works very well.

    The string is basically an XML document, but how do I use these data (the string returned by the call) or place these data in a properly formatted XML file? Because right now I'm back a long chain... It is an object, but I want it to be XML.

    See this FB 2.0.1 help topic:
    Manipulation of the results in XML format with the e4x result format

    http://livedocs.Adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=live Docs_Book_Parts & file = dataservices_099_17.html

    <>
    ID = "WS".
    destination = useProxy "stockservice' = 'true '.
    Fault = "Alert.Show (Event.Fault.FaultString), 'Error'" > "


    ADBE


  • Replace the current XML node with another node in XML fragments

    Hello

    Please help, trying to replace an XML node with other fragments XML using XML DB, updateXML/deleteXML functions don't receive the desired result, on the front of the image below, this is what I have, and the transom is the replacement with new values XML fragment, I expect to see, there is a list of records from the XML that I need to open and do the replacement of the < broker-retail > according to the number of records to be inserted.

    Before the photo:

    < Broker-benefits-link >

    < hpp-rule > 0 < / hpp-rule >

    LISP < in.-CVCA-benefits-type > < / po-CVCA-benefits-type >

    < commit / >

    <broker-retail >

    < broker-entity-not > 1000947836 < / broker-entity-not >

    < broker-pct > 100 < / broker-pct >

    Y < principal > < / main >

    < / broker-retail >

    < / Broker-benefits-link >


    After photo (expected result):

    < Broker-benefits-link >

    < hpp-rule > 0 < / hpp-rule >

    LISP < in.-CVCA-benefits-type > < / po-CVCA-benefits-type >

    < commit / >

    <broker-retail >

    < broker-entity-not > 65656524 < / broker-entity-not >

    < broker-pct > 25 < / broker-pct >

    N < principal > < / main >

    < / broker-retail >

    <broker-retail >

    < broker-entity-not > 122224444 < / broker-entity-not >

    < > 75 broker-pct < / broker-pct >

    Y < principal > < / main >

    < / broker-retail >

    < / Broker-benefits-link >

    Kind regards

    Qwestion

    You can use DELETEXML and INSERTCHILDXML

    SQL> set long 10000
    SQL> column xmldata_new format a100
    SQL> set linesize 150
    SQL>
    SQL> with t
      2  as
      3  (
      4  select
      5  xmltype('
      6    0
      7    LISP
      8    
      9    
     10      1000947836
     11      100
     12      Y
     13    
     14  ') xmldata from dual
     15  )
     16  select xmlserialize
     17         (
     18             document
     19             insertchildxml
     20             (
     21                deletexml
     22                (
     23                    xmldata
     24                  , '/broker-benefit-link/broker-detail'
     25                )
     26              , '/broker-benefit-link'
     27              , 'broker-detail'
     28              , xmltype
     29                (
     30                '
     31                    
     32                        65656524
     33                        25
     34                        N
     35                    
     36                    
     37                        122224444
     38                        75
     39                        Y
     40                    
     41                 ').extract('/broker-master/broker-detail')
     42             )
     43             as clob indent size = 2
     44         ) xmldata_new
     45    from t;
    
    XMLDATA_NEW
    ----------------------------------------------------------------------------------------
    
      0
      LISP
      
      
        65656524
        25
        N
      
      
        122224444
        75
        Y
      
    
    
    SQL>
    
  • can I return a string in a custom dialog box created with app.execDialog ()?

    Adobe LiveCycle Designer Cookbooks by BR001: using app.execDialog () in a form in Adobe Designer

    I am the above post and try to do the following:

    Capture.PNG

    I want to write the output of one of the selection of list to PDF dialog box, what I'm going to script?

    Something like document. Write() in Javascript (see: http://www.tutorialspoint.com/javascript/javascript_dialog_boxes.htm ). I tried to use document. Write() in the script dialog box, but it doesn't seem to work.

    Or can the dialog box return a string value?

    According to the PDF example in the first link, this dialogObject is what is returned when you see a dialog box:

    var dialogObject = {}

    DS1: ({}),

    execDialog: function() {}

    Return app.execDialog (dialogDescriptor);

    },

    selectedItem: {function (control)}

    If (typeof (control) = "string") {}

    control = this [control];

    }

    for (var control element) {}

    If (typeof (control [item]) = 'object') {}

    var r = this.selectedItem (control [item]);

    If (r! == undefined) {}

    Return r;

    }

    } else {}

    If (control [point] > 0) {}

    Returns [dot] control;

    }

    }

    }

    },

    };

    Return dialogObject;

    Hello

    Yes it is possible, by removing the execDialog() function and call the just before execDialog the dialogObject return, you call the dialog box to be executed directly in the service, so if you start a string on the top of the function and the validation value you set the string value of the item found in the list box then you will be able to return the value of the string instead of the dialogObject...

    Here is a short example:

    dialog() {} function

    var strValue = "";

    var dialogDescriptor =

    {

    Description:

    {

    align_children: "align_row."

    items:]

    {

    type: "display."

    align_children: 'align_left,

    items:]

    {

    type: 'edit_text. "

    item_id: "txt1"

    Width: 300

    },

    ]

    },

    {

    type: "ok_cancel."

    }

    ]

    },

    validate: function (dialog)

    {

    No validation required

    Returns true;

    },

    commit: function (dialog)

    {

    elements var = dialog.store ();

    strValue = items ["txt1"];

    },

    };

    var dialogObject =

    {

    execDialog: function() {return app.execDialog (dialogDescriptor);},

    //...

    };

    app.execDialog (dialogDescriptor);

    return strValue;

    }

    Hope this will help you

Maybe you are looking for