How to get XML node in a number

In my XML file, I have a question like:

< myxml >
< amount > 5 < / amount >
< / myxml >

In my Flex code, I have a variable:

public var stockOnHand:Number;

and

private void dataHandler(event:ResultEvent):void {}
stockOnHand = event.result.myxml.amountt;
}

But if I try to access this variable I find its value to be "NaN". So it is not registering as a number, must be a string. Why?

If you have not found an answer, but I think I might have. Try this:

private void dataHandler(event:ResultEvent):void {}
stockOnHand = new Number (event.result.amount);
}

Tags: Flex

Similar Questions

  • How to get XML of a node name data?

    I'm new to Flash and XML, so I hope I'm not asking a stupid question. I understood how to retrieve data from and by the position of the node XML file, but now I would like to know how to pull a specific node name. Here is what I currently have:

    about (overview)
    {
    myLot = 1;
    _root.myInfo = _root.myXML.childNodes [0] Sublst.ChildNodes(1).ChildNodes(0) [this.myLot] Sublst.ChildNodes(1).ChildNodes(0) [0] Sublst.ChildNodes(1).ChildNodes(0) [0] .nodeValue;
    }

    With the file XML as follows:
    < SectionOne >
    < Lot1 >
    < Batch > 1 < / batch >
    < price >$ 450 000 < / price >
    Assets of < status > < / status >
    < / Lot1 >
    < Lot4 >
    < Batch > 4 < / batch >
    < price >$ 389 000 < / price >
    Sold < status > < / status >
    < / Batch2 >
    < / SectionOne >

    What I would like is to shoot instead of childNodes [this.myLot] to get the node named Lot1. The problem I have is I have always not consecutive lots and I don't want to have to build a placeholder empty xml online. I hope that makes sense.

    Sorry for the delay. I posted this on the discussion group, but I guess that it does not spread here.

    What you would do, is to use a loop statement and compare the nodeNames.
    To see a name of nodes as Lot1, you use:
    childNodes [x] .nodeName

    ******************************************
    Load the lotNodes object
    lotNodes = _root.myXML.childNodes [0];
    LotNodes contains now all Lot0, Lot1, batch2 nodes...
    Browse all childNodes lotNodes and compare the
    nodeName until you find the one you want then go down
    He has to get the information you want.
    for (var counter01 = 0; counter01<>
    If (lotNodes.childNodes [counter01] .nodeName == "Batch1") {}
    myInfo = lotNodes.childNodes [counter01] Sublst.ChildNodes(1).ChildNodes(0) [0] Sublst.ChildNodes(1).ChildNodes(0) [0] .nodeValue;
    }
    }
    ******************************************
    I don't have time to test it but it should work, I'll check double after work.
    I hope that this help you move forward.
    If you have any other problems or can't make it work, I would like to know here or send me an email. Preference here, so that others can learn and help.

    Scotty
    [email protected]

  • How to get the phone for example number zero. 0612345678

    Dear Adobe Flex Builder Professional,

    I have a problem with getting the phone for example number zero. 0612345678

    If I get the phone number following as input:

    0612345678

    I'll get the phone number in output:

    612345678

    The application was written in Adobe Flex Builder 3.

    The code in the MXML file is:

    <? XML version = "1.0" encoding = "utf-8"? >
    "" < mx:Canvas xmlns:mx = "http://www.adobe.com/2006/mxml"
    creationComplete = "init ()" "
    horizontalScrollPolicy = "off" verticalScrollPolicy = "off" >

    < mx:Metadata >
    [Event (name = "customerSaveEvent", type = "events. CustomerEvent")]
    [Event (name = "customerCancelEvent" type = "flash.events.Event")]
    < / mx:Metadata >

    < mx:Script >
    <! [CDATA]
    Import util.ComboBoxUtil;
    Import mx.controls.Alert;
    How to import events. CustomerEvent;
    Import mx.collections.ArrayCollection;
    Import mx.core.Application;
    Import valueObject.Customer;
    Import mx.validators.Validator;
    Import mx.validators.PhoneNumberValidator;

    private var phoneCheck:PhoneNumberValidator;

    [Bindable]
    public var selectedCustomer:Customer;

    private function init (): void {}
    this.cretePhoneValidator ();
    if(this.selectedCustomer == null) {}
    this.clearForm (null);
    }
    }

    private function cretePhoneValidator (): void {}
    phoneCheck = new PhoneNumberValidator();
    phoneCheck.source = phone number;
    phoneCheck.property = 'text ';
    }

    private function validateForm (): void {}
    var validatorList:Array = new Array (emailCheck, phoneCheck);
    Validator.validateAll (validatorList);
    }

    private function cancelClickHandler (): void {}
    var cancelManageCustomerObj:Event = new Event ("customerCancelEvent");
    dispatchEvent (cancelManageCustomerObj);
    }

    private function saveCustomer (): void {}
    validateForm();

    var c:Customer = null;
    var selCust:Customer = Application.application.selectedCustomer;

    If (selCust! = null) {}
    c = selCust;
    } else {}
    c = new Customer();
    }
    c.setLastName (lastName.text);
    c.setFirstName (firstName.text);
    c.setStreet (street.text);
    c.setPostal (postal.text);
    c.setCity (city.text);
    c.setEmail (email.text);
    c.setPhoneNumber (new Number (phoneNumber.text));
    c.setMailing (mailing.selectedItem.data);
    c.setComment (comment.text);
    var changed: client = Application.application.customerService.createOrUpdate (c);

    var customerEventObj:CustomerEvent = new CustomerEvent ("customerSaveEvent", modified);
    dispatchEvent (customerEventObj);

    this.clearForm (selCust);
    }

    private void clearForm(selCust:Customer):void {}
    if(selCust == null) {}
    this.lastName.text = "";
    this.firstName.text = "";
    This.Street.Text = "";
    This.postal.Text = "";
    This.City.Text = "";
    this.phoneNumber.text = "";
    This.email.Text = "";
    this.mailing.selectedIndex = 0;
    This.Comment.Text = "";
    }
    focusManager.setFocus (lastName);
    }
    []] >
    < / mx:Script >

    <!-mx:EmailValidator id = "emailCheck" source = "{email}" = "text" property
    trigger = '{save}' triggerEvent = ' click on ' /-->

    < mx:Form id = "manageCustomerForm" >
    < mx:FormItem label = "Achternaam:" >
    < mx:TextInput id = text = "{selectedCustomer.getLastName ("lastName")}" / >
    < / mx:FormItem >
    < mx:FormItem label = "Voorletters:" >
    < mx:TextInput id = text = "{selectedCustomer.getFirstName ("firstName")}" / >
    < / mx:FormItem >
    < mx:FormItem label = "Straat:" >
    < mx:TextInput id = text = "{selectedCustomer.getStreet () ' street'}" / >
    < / mx:FormItem >
    < mx:FormItem label = "zip code:" >
    < mx:TextInput id = text = "{selectedCustomer.getPostal ('post')}" / >
    < / mx:FormItem >
    < mx:FormItem label = "Stad:" >
    < mx:TextInput id = "City" text = "{selectedCustomer.getCity ()}" / >
    < / mx:FormItem >
    < mx:FormItem label = "number:" >
    < mx:TextInput id = text = "{selectedCustomer.getPhoneNumber ('Phone number')}" / >
    < / mx:FormItem >
    < mx:FormItem label = "e-mail:" >
    < mx:TextInput id = "email" text = "{selectedCustomer.getEmail ()}" / >
    < / mx:FormItem >
    < mx:FormItem label = "" unstable: ">"
    < mx:TextArea id = "comment" text = "{selectedCustomer.getComment ()}" "
    width = "447" height = "144" / >
    < / mx:FormItem >
    < mx:FormItem label = "send:" >
    < mx:ComboBox id = dataProvider = "{Application.application.comboBoxUtil.yesNo"mailing"} '"
    selectedIndex = "{ComboBoxUtil.getIndex (selectedCustomer.getMailing ())}" / >
    < / mx:FormItem >
    < mx:HBox id = "manageButtonBox" >
    < mx:Button id = "Save" label = "Opslaan" click = "saveCustomer ()" / > "
    < mx:Button id = "resetButton" label = "Wis" click = "clearForm (null)" / > "
    < mx:Button id = "cancelButton" label = "Annuleer" click = "cancelClickHandler ()" / > "

    < / mx:HBox >
    < / mx:Form >
    < / mx:Canvas >

    The code in the SQL file is:

    create the customer table)
    ID integer not null primary key autoincrement,.
    lastName varchar (50),
    firstName varchar (50),
    Street varchar (50),
    City varchar (50),
    postal varchar (10),
    Telephone INT number (10),
    Email varchar (50),
    sending Boolean default false,
    Comment by varchar (255)
    );

    create table (treatment)
    ID integer not null primary key autoincrement,.
    Date Date,.
    treatment varchar (255),
    whole customerId not null,
    constraint fk_customer foreign key (customerId) references customer (id)
    );

    create table (user)
    ID integer not null primary key autoincrement,.
    loginName varchar (50) not null,
    lastName varchar (50) not null,
    firstName varchar (50) not null,
    password varchar (50) not null,
    Active Boolean true not null default,
    accessright varchar (10) not null
    );

    create table (of the order of the day
    ID integer not null primary key autoincrement,.
    whole userId not null,
    Date Date,.
    time integer,
    full minute,
    Description varchar (50),
    constraint fk_user foreign key (userId) references user (id)
    );

    create table (license)
    ID integer not null primary key autoincrement,.
    key varchar (50),
    Val varchar (50)
    );

    I hope someone can help me with this problem.

    Hi Buxsnl,

    I think that I already gave the answer in my previous post. But think that you have not implemented it.

    The threshold of the code is not necessary...

    m:System.NET.SocketAddress.ToString (), c.setPhoneNumber (new Number (phoneNumber.text));

    Instead you can replace it with the below a...

    c.setPhoneNumber (phoneNumber.text);

    and the function setPhoneNumber() in your client class must be less to:

    public void setPhoneNumber(phoneNumber:String):void

    {

    //

    }

    Can send you the code to your client class... ??

    Thank you

    Jean Claude

  • How to get a Skype to go number

    I want to get a Skype to go number. Supported by Skype is very poor and difficult to get information

    http://www.Skype.com/en/features/Skype-to-go-number/

    TIME ZONE - US EAST. LOCATION - PHILADELPHIA, PA, USA.

    I recommend that you always run the latest version of Skype: Windows & Mac

    If my advice helped to solve your problem, please mark it as a solution to help others.
    Please note that I usually do not respond to unsolicited private Messages. Thank you.

  • How to get the nodes size in the presenter content model

    Hi all

    I created a content model of presenter to display a list of content carousel with x of y (current number of total size).

    also I do not use af:carousel component used instead af:iterator.

    is it possible I can get number total i.e. nodes size outside a java bean.

    something like #{nodes.size} or nodes.length.

    Please suggest something which can fly running (i.e. performing edition of the model should be enough)

    Thank you

    -Yves

    Hi Yves,

    You should be able to use #{nodes.rowCount} to EL.

  • How to get the comma in the number format?

    Hi all

    I have a requirement to obtain a number with commas.

    I achieved this goal using the converter. (< groupingUsed = "true" integerOnly = "true" minFractionDigits af:convertNumber = '2' maxFractionDigits = "2" / >)
    My textbox is limited to 5, if I give the number like 12345 then it appears in the form 12,345.00 (which is expected)

    I want to change the same number from 5 to 6. so if I remove the number 5, the comma is also taking as a character and not allowing me do not enter 6 in the end.

    If I remove the comma, then only it is allowed me to type 12346.

    I tried to delete the comma using javascript using the function that is called from clientListener below.

    < af:clientListener method = "removeComma" type = 'focus' / >
    function removeComma (evt) {}
    var currentValue = document.getElementById('r2:1:it8::content').value;
    var currentValue.replace = newValue (/ a, / g, ");
    document.getElementById('r2:1:it8::content').value = newValue;
    }

    Using this script comma was deleted at the time of change, but after changing the number and press ENTER key so I get no comma.

    I wrote this code in pagefragment and my version of jdev is 11.1.2.4.0.

    Help, please.

    Kind regards

    Shakur.

    Try to remove maximumLength = "5" inputText and use af:validateLength as:

    
         
         
    
    
  • How to get xml all the attributes count?

    Hi Indesigners,

    I tried a lot of time to get all of the xml attributes count in indesign xml and according to the style applied to the xmlAttribute value, I have to do some tasks... Can someone help me...

    Thank you and best regards,

    Vel.

    Finally, I wrote the script to get the xml attributes...

    var doc = app.activeDocument;

    var parastyle = doc.allParagraphStyles;

    var charstyle = doc.allCharacterStyles;

    var currentpara;

    var att, att2, val = 'ParagraphStyles\r', val2 = "CharacterStyles\r";

    [var attNodes = doc.xmlElements[0].evaluateXPathExpression("//*['@']"); "

    var i, t;

    ~ alert (attNodes.length);

    for (i = 0;  I have< attnodes.length;="">

    {

    Try

    {

    att = attNodes [i].xmlAttributes.itemByName ("aid: pstyle") .value;

    Val = val + att + "\r";

    checkpara (ATT);

    }

    catch (e)

    {

    }

    Try

    {

    att2 = attNodes [i].xmlAttributes.itemByName ("aid: cstyle") .value;

    val2 = val2 + att2 + "\r";

    checkchar (att2);

    }

    catch (e)

    {

    }

    }

    Alert (Val);

    Alert (val2);

    function checkpara (currentpara)

    {

    If (IsInArray (ParaStyle, currentpara))

    {

    Alert (currentpara + "Available");

    }

    on the other

    {

    Alert (currentpara + "Missing!");

    }

    }

    function checkchar (currentchar)

    {

    If (IsInArray2 (CharStyle, currentchar))

    {

    Alert (currentchar + "Available");

    }

    on the other

    {

    Alert (currentchar + "Missing!");

    }

    }

    function IsInArray(array,item)

    {

    var retval = false;

    for (var i = 0; i)<>

    {

    If (array [i] .name is point)

    {

    retval = true;

    }

    }

    Return retval;

    }

    function IsInArray2 (array2, item2)

    {

    var retval2 = false;

    for (var i = 0; i)<>

    {

    If (array2 [i] .name is item2)

    {

    retval2 = true;

    }

    }

    Return retval2;

    }

    The above codes will be found the missing character style or paragraph style in the document, which is defined as the value of the xml attribute.

    Thank you and best regards,

    Vel.

  • How to get the node root for all nodes using oracle SQL?

    Suppose I have an employee table, which has the following features:

    ID name MgrID
    ----------------------------------------
    1 Tom
    Jason 2 1
    3 Kelly 2
    4 Chris 2
    Russ 5 3
    --------------------------------------

    I want to get the following result.

    ID name RootMgrID
    ------------------------------------------------
    1 Tom
    Jason 2 1
    3 Kelly 1
    4 Chris 1
    Russ 5 1
    -----------------------------------------------

    How can I get it?

    Thank you very much

    Like this?

    SQL> with t as
      2  (select 1 id, 'Tom ' name, null mgr_id from dual
      3  union all
      4  select 2 id, 'Jason' name, 1 mgr_id from dual
      5  union all
      6  select 3 , 'Kelly ', 2 from dual
      7  union all
      8  select 4 , 'Chris ', 2 from dual
      9  union all
     10  select 5 , 'Russ ', 3 from dual
     11  )
     12  select id, name, connect_by_root(id)
     13  from t
     14  where name = 'Russ '
     15  connect by mgr_id = prior id
     16  start with id = 1
     17  /
    
            ID NAME   CONNECT_BY_ROOT(ID)
    ---------- ------ -------------------
             5 Russ                     1
    
    SQL>
    
  • How to get the interrupt vector (the number that is used to index the IDT) upper filter driver

    Hello world
    I have a very urgent question to get the vector of interruption of a upper filter driver:
    In my project, I need to know the vector interrupt assigned to a specific device (not for standard devices that have fixed the interrupt vector value). I know that normally, the interrupt vector value can be obtained in the pilot of the underlying function (usually for the parameters to IoConnectInterrupt()) with the following code:
    pIrpStack-> Parameters.StartDevice.AllocatedResourcesTranslated. > List [0]. PartialResourceList.PartialDescriptors [0].u.Interrupt.Vector

    But I don't have the source code for the driver of the underlying function, so I wrote a upper filter driver to do the same thing to get the value. I don't know if it is feasible or not. But when the above code has been run in the upper filter driver, I got blue screen or restart. I have viewd the minidump file and got the error code C0000005 NTSTATUS, which is probably an access violation. I wonder if the upper filter driver has the privilege of access to descriptors of material resources. If not, can anyone suggest a way to get the vector of interruption of a specific device?

    BTW, I use the Intel processor and running Windows XP.

    Thank you much in advance!

    Hello qqMichelle,

    Thanks for visiting the site of the community of Microsoft Windows XP. The question you posted would be better suited to the MSDN Community. Please click HERE to find a community that will provide the support you want.
    See you soon

    Engineer Jason Microsoft Support answers visit our Microsoft answers feedback Forum and let us know what you think.

  • How to get the node root for a child to help connect by front

    Hello

    I searched in many places to do that, but not able to get the exact o/p sp poster my question here.

    I have a table with columns parent_id, child_id and. This parent_child levels can be a lot, but my goal is to find the ultimate parent (do not know the right term)
    as if I have a = xyz child_node and its parent company = pqr and her parents = lmn, that might be the ultimate parent is not any other parent.

    So if I start with child_code = "xyz" then I should get the parent as "lmn" and not the immediate parent "pqr".

    Help, please.

    Thank you
    Aashish

    1. When you want to find all parents position = 100:

    SELECT position_id,parent_position_id
    FROM position
    where position_id = 100
    CONNECT BY prior position_id = parent_position_id
    

    2. When you want to find all childs position = 100:

    SELECT position_id,parent_position_id
    FROM position
    where position_id = 100
    CONNECT BY prior parent_position_id = position_id
    

    Kind regards
    Sayan M.

  • 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

  • How to get the Total number of nodes XML?

    Hi all

    I have a Flash program that I do in Actionscript 3, using CS6.

    I use the XMLSocket class to read XML data. I'll write some examples of XML that is sent to the Flash

    program below...

    I know with this line here (below) I can access the 4th 'element or node' of XML data.

    To access the XML nodes/elements:

    * I created a Variable XML, called xml, and "e.data" contains ALL the XML data
    var XML = XML (e.data);

    Access to the 4th item of the data:

    . xml MESSAGE[3].@VAR;          -> 'loggedOutUsers '.

    . xml MESSAGE[3].@TEXT;         --->     "15"

    EXAMPLE OF XML DATA:


    < FRAME >

    0 < VAR MESSAGE = "screen2Display" TEXT = "FRAME_1" / >

    1 < VAR MESSAGE = "numUsers" TEXT = "27" / >

    2 < VAR MESSAGE = "loggedInUsers" TEXT = "12" / >

    3 < VAR MESSAGE = "loggedOutUsers" TEXT = "15" / >

    4 < VAR MESSAGE = "admins" TEXT = "2" / >

    < / FRAMEWORK >

    I'm new to Flash and Actionscript but I am very familiar with other languages and how paintings and other work, and I know for

    example, in a Shell Script to get the total number of items in an array called 'myArray' I wanted to write something like

    This-> ${#myArray [@]}. And since the data processing XML looks a lot like a table I thought that there was perhaps

    a way to access the total number of "nodes or elements" in the XML data...?

    Any thoughts would be much appreciated!

    Thanks in advance,

    Matt

    even if you don't need to run to the loop to know the length

    var levelList: XMLList = xml.children ();

    levelList.length (); This will give you the length of all children in your case of length MESSAGE of nodes;

    Pls click useful if my answer is helpful.

    Thank you

    Bala

  • How to get the value of the node xml strings

    Hello world

    I have the table with a varchar2 column that contains the XML nodes like this
    create table test (REC_ID Number(8), xml_value varchar2(4000));
    insert into test values (1000, '<id=''10'' data=''some data'' ref=''qq1''/> <id=''12'' data=''some other data'' ref=''qw2'' />');
    insert into test values (1111, '<id=''99'' data=''some X data'' ref=''rty''/> <id=''88'' data=''final data'' />  <id=''77'' data=''final data2'' />');
    for a line, there are several basic xml nodes. I want to get a result like this:
    Rec_ID  xml_value_ID  xml_value_DATA
    1000     10               some data
    1000     12               some other data
    1111     99               some X data
    1111     88               final data
    1111     77               final data2
    What would be the best way of performance to achieve that?

    Thank you very much

    I just thought that this could be done by tech oracle xml.

    It would be possible if it was XML data, but it is not.

    A valid XML element have a tag name, for example:

    
    

    That being said, we can cheat and generate a valid XML fragment out of your data by inserting the name of tag in front of 'id ':

    SQL> select t.rec_id
      2       , x.xml_value_id
      3       , x.xml_value_data
      4  from test t
      5     , xmltable(
      6         '/item'
      7         passing xmlparse(content replace(t.xml_value, '
    

    Second option, the analysis with regexp:

    SQL> select rec_id
      2       , regexp_substr(x.column_value, 'id=''([^'']+)''', 1, 1, null, 1) as value_id
      3       , regexp_substr(x.column_value, 'data=''([^'']+)''', 1, 1, null, 1) as value_data
      4  from test t,
      5       table(
      6         cast(
      7           multiset(
      8             select regexp_substr(t.xml_value, '<[^>]+>', 1, level)
      9             from dual
     10             connect by level <= regexp_count(t.xml_value, '<[^>]+>')
     11           )
     12           as sys.odcivarchar2list
     13         )
     14       ) x
     15  ;
    
       REC_ID VALUE_ID           VALUE_DATA
    --------- ------------------ -----------------------
         1000 10                 some data
         1000 12                 some other data
         1111 99                 some X data
         1111 88                 final data
         1111 77                 final data2
     
    

    (needs 11 Oracle for the function REGEXP_COUNT)

  • XML: How to get the value of the node when the node of pasing as a parameter name

    Hello

    I've got some xml:

    var xmlData:XML = 
    <1stNode>
        <buttonID>first child node value</buttonID>
        <imageID>second child node value</imageID>
        <labelID>third child node value</labelID>
    </1stNode>
    

    So, I want to read the value of specific node based on a value passed to a function. .

    var buttonID = new Button;
    
    var imageID = new Image;
    
    var labelID = new Label;
    
    
    getNodeValue(buttonID); //the value here is set dynamically
    
    private function getNodeValue (nodeName:String):void {
    
    trace (xmlData.nodeName)                      //doesn't work
    
    var str:String = "xmlData." + nodeName;
    var xml:XMLList = str as XMLList             //doesn't work
    
    }
    

    I don't know how to get the value when the name of the node is changed dynamically.

    use:

    getNodeValue(buttonID); //the value here is set dynamically
    
    private function getNodeValue (nodeName:String):void {
    trace (xmlData[nodeName])
    }
    
    
  • How to get the number of page i NTHE xml output

    Hi all

    Greetings!

    Need help to display the page number in this format 1/1 and 1/2.

    How to get this by setting a variable and do it randomly.

    Help, please...

    Thank you
    Rajesh

    Published by: David on March 26, 2010 12:20 AM

    If you want to reset your page based on your provider number and then use for-each@section:your_supplier_grp
    The page above format itself dial can be used to achieve the desired result.

Maybe you are looking for

  • How to activate the wireless adapter

    I currently have a HP Pavilion 17 computer laptop with Windows 7 Professional.  A few times in the past in the unit's wireless adapter stopped working.  I don't remember what I did to get it working again, then however at this time I can not activate

  • where can I find my contacts in the mail of Cloud?

    is there an icon for the toolbar that gets me to the list of contacts?

  • Another computor uses the same IP that myself, what do I do?

    Compuyor another uses the same IP address as me, what can I do to solve the problem?

  • What is 80040154 means?

    Remember - this is a public forum so never post private information such as numbers of mail or telephone! Ideas: what is error 80040154 means and how can I solve this problem? You have problems with programs Error messages Recent changes to your comp

  • Scan on HP Photosmart 6510, all-in-one

    The analysis on the computer menu disappeared during the click on the printer icon.  I saw a post on this for HP Officejet 8600, which was solved by reloading the software.  There was something about an update of the software.  So must the software d