get the attributes NAME / VALUE of a XML

I love this forum :)

I load a XML one fill a tree, where I started to drag items.
the XML looks like this:
< myTag attrName = "attrValue" otherAttrName = "otherAttrValue" / >

var ds:DragSource = event.dragSource;
var var1:String =(event.dragInitiator as Tree).value.@attrName;
-> the variable var1 is now: "attrValue".

My question is... How can I get the names of all attributes? in this example: attrName and otherAttrName (assume that I don't know the structure of this xml node)
What attribute values?
Thank you!

The snippet below takes a node xml (nodeCur), made a loop through the list of attributes and built a table that contains the attribute name and value of each attribute. It is a sample application that allows you to edit an xml file.
I'm sorry that the forum will remove formatting

var aDPAttributes:Array = new Array();
var xlAttributes:XMLList = nodeCur.@*;
var: attribute;
for (var i: int = 0; i< xlattributes.length();="" i++)="">
aDPAttributes.push ({name: xlAttributes [i] .name (), value: xlAttributes [i]});
}
dgAttributes.dataProvider = aDPAttributes; Set the sheet dataProvider property

Tracy

Tags: Flex

Similar Questions

  • Parsing XML and get the attributes of a tag

    Hello

    When parsing XML for application of Cascades in C++, I am able to get the value of a tag as follows:

    00000

    But I also want to get the attributes of a tag:

    But I don't know how to get the 'CA' and 'California' attributes with my current code.  Can anyone help?  Here is the code I use to parse the XML code:

    void CMController::requestFinished(QNetworkReply* reply) {
    
        if (reply->error() == QNetworkReply::NoError) {
    
            QXmlStreamReader xml;
    
            QByteArray data = reply->readAll();
            xml.addData(data);
    
            QString zip;
            QString id;
            QString location;
    
            while (!xml.atEnd() && !xml.hasError()) {
    
                /* Read next element.*/
                QXmlStreamReader::TokenType token = xml.readNext();
    
                /* If token is just StartDocument, we'll go to next.*/
                if (token == QXmlStreamReader::StartDocument) {
                    continue;
                }
    
                /* If token is StartElement, we'll see if we can read it.*/
                if (token == QXmlStreamReader::StartElement) {
    
                    if (xml.name() == "zip") {
                        zip = xml.readElementText();
                    }
    
                    if (xml.name() == "id") {
                        ???
                    }
    
                    if (xml.name() == "location") {
                        ???
                    }
    
                }
    
            }
    
            emit succeeded(result);
    
        } else {
            emit failed();
        }
    
        reply->deleteLater();
    
    }
    

    Thank you!

    I found a working example:

    if(xml.name() == "state"){
        QXmlStreamAttributes attrib = xml.attributes();
        QStringRef ref = attrib.value("location");
        qDebug() << "location: " << ref;
    }
    
  • To get the attributes of node of a node using a DOM parser

    Hi, is there an easier way to obtain the attributes of a node using a DOM parser. I do not understand the method getAttributes() because it returns NamedNodeMap where are all the getters return a node. I have just this simple xml structure:

    EditField
    First name

    For example, I am able to do "editfield" and "First name" but I want to be able to get the id attribute of matching nodes as well. The just getNodeValue() returns me null and getLocalName() and getNodeName() returns just me TYPE or a QUESTION.

    Any help please if anyone knows. Oh and I don't want to use the DOM, SAX parser. Thank you very much in advance

    I discovered how to get the attributes after some Google search and changes. It's here

    NamedNodeMap attributes = (NamedNodeMap) tempNode.getAttributes ();
    for (int = 0; g g< attributes.getlength();="" g++)="">
    Attribute attr = (Attr) attributes.item (g);
    System.out.println ("attribute:" + attribute.getName () +)
    ("with the value" + attribute.getValue ());
    }

    You do not have to use NamedNodeMap, I did not know how before. You go around casting too. Awesome, I didn't use SAX after all now

  • Impossible to analyze the xml.aspx contained in the main.js.Iam get the following error"could not obtain XML document, and the connection has failed: status 500

    Impossible to analyze the xml.aspx contained in the main.js.Iam get the following error"could not obtain XML document, and the connection has failed: status 500

    My main.js resembles

    xmlDataSource var = {}
     
    URL: 'dcds. - symbianxml.aspx", etc. (sample).
     
    init: function() {}
    URL, successful reminder, the reminder of failure
    This.Connect (this.) (URL, this.responseHandler, this.failureHandler);
    },
     
    /**
    * Analyzes the XML document in an array of JS objects
    @param xmlDoc XML Document
    * @returns {table} array of objects of the device
    */
    parseResponse: {function (xmlDoc)}
        
    var chElements = xmlDoc.getElementsByTagName ("channel");
       
    channels of var = [];
      
    Console.log (chElements.Length);
      
    for (var i = 0; i)< chelements.length;="">
        
    var channel = {};
       
    for (var j = 0; j)< chelements[i].childnodes.length;="">
        
    var node = Sublst.ChildNodes(1).ChildNodes(0) chElements [i] [j];
                
    If (node.nodeType! = 1) {//not an element node}
    continue;
    }
           
    Channel [node. TagName] = node.textContent;
    }
       
    Channels.push (Channel);
    }
    Console.log (Channels.Length);
    return the strings;
    },
     
    /**
    Manages the response and displays the data from device web app
    @param xmlDoc
    */
    responseHandler: {function (xmlDoc)}
      
    var channel = this.parseResponse (xmlDoc);
    var markup = "";
       
    for (i = 0; i< channels.length;="">
       
    markup += this.generateHTMLMarkup (i, channels [i]);
    }
    document.getElementById("accordian").innerHTML = mark-up;
    },
     
    /**
    Generates HTML tags to insert in to the DOM Web App.
    * @index i, index of the device
    @param device, device object
    */
    /*
    generateHTMLMarkup: function (i, channel) {}
      
    var str ="";
    "Str += '.


    ' onclick =-"mwl.setGroupTarget ('#accordian ',' #items_" + i + "', 'ui-show ',' ui - hide');" + ".
    "mwl.setGroupTarget ('#accordian ',' item_title_ #" + i + "', 'ui-open', 'ui-farm'); Returns false; \ » > » ;
    "" Str += "" + channel ['name'] + ' ";
    "Str += '.
    ";
    "Str += '.
    ";
    "Str += '.
    "+" id: "+ channel ['id'] +" ' "
    ";
    "Str += '.
    "+" type: "+ channel ['type'] +" ' "
    ";
    "Str += '.
    "+" language: "+ channel ['language'] +" ' "
    ";
    "Str += '.
    «+ "bandwidth:" + "fast" channel + "»»
    ";
    "Str += '.
    "+" cellnapid: "+ channel ["cellnapid"] +". "
    ";
    "Str += '.
    «+ ' link: '+'start the video »»
    ";
    "Str += '.
    ";
    return str;
    },*/
    generateHTMLMarkup: function (i, channel) {}
       
    var str ="";
    "Str += '.
    ";
    str +=  "" +
    "" + channel ['name'] + ""+""
    ";
    "Str += '.
    «+ ' link: '+'start the video »»
    ";
         
    return str;

    },
     
    failureHandler: {function (reason)}
    document.getElementById("accordian").innerHTML = "could not get XML document.
    '+ reason;
    },
     
    /**
    Retrieves a resource XML in the given URL using XMLHttpRequest.
    @param url URL of the XML resource to retrieve
    @param called successCb, in the XML resourece is recovered successfully. Retrieved XML document is passed as an argument.
    @param failCb called, if something goes wrong. Reasons, in text format, is passed as an argument.
    */

    Connect: {function (url, successCb, failCb)
      
    var XMLHTTP = new XMLHttpRequest();
      
    XMLHTTP. Open ("GET", url, true);

    xmlhttp.setRequestHeader("Accept","text/xml,application/xml");
    xmlhttp.setRequestHeader ("Cache-Control", "non-cache");
    xmlhttp.setRequestHeader ("Pragma", "non-cache" "");
      
    var that = this;
    XMLHTTP.onreadystatechange = function() {}
       
    If (xmlhttp.readyState == 4) {}
        
    If (XMLHTTP. Status == 200) {}
         
    {if (!) XMLHTTP.responseXML)}
    try {}
    If server has not responded with good an XML MIME type.
    var domParser = new DOMParser();
    var xmlDoc = domParser.parseFromString(xmlhttp.responseText,"text/xml");
           
    successCb.call (that, xmlDoc);
           
    } catch (e) {}
    failCb.call (, "answer was not in an XML format.");
    }
              
    } else {}
    successCb.call (that, xmlhttp.responseXML);
    }
    } else {}
    failCb.call (this, "connection failed: status"+ xmlhttp.status ");
    }
    }
    };
    XMLHTTP. Send();
    }
    };

    Please see the content in main.js is fully analyzed.

    Forward for the solution to my request all members of the community...

  • Error when retrieving the value of the pair name / value

    Hi gentlemen,

    I am facing a problem while retrieving the value of the pair name / value in the incoming XML file. I am using an Xpath query to retrieve the value but Jdeveloper gives me
    an invalid expression error.

    Please find below the new xml and xquery.

    < ebo:QueryItemListEBM xmlns:ebo = "http://xmlns.oracle.com/EnterpriseObjects/Core/EBO/Item/V2" >
    < ebo:DataArea xmlns:aia = "http://www.oracle.com/XSL/Transform/java/oracle.apps.aia.core.xpath.AIAFunctions" xmlns:coreitem = "http://xmlns.oracle.com/EnterpriseObjects/Core/EBO/Item/V2" >
    < ebo:Query >
    < ebo:QueryCode > QUERY_ITEMS < / ebo:QueryCode >
    < corecom:QueryCriteria xmlns:corecom = "http://xmlns.oracle.com/EnterpriseObjects/Core/Common/V2" >
    < corecom:QueryExpression >
    < corecom:ValueExpression >
    < corecom:ElementPath > ItemEBO/Item/InventoryLocation/BusinessComponentID < / corecom:ElementPath >
    < corecom: Value > 82 < / corecom: Value >
    < / corecom:ValueExpression >
    < corecom:ValueExpression >
    < corecom:ElementPath > ItemEBO/Item/ItemIdentification/ContextID@OPERATING_UNIT_ID < / corecom:ElementPath >
    < corecom: Value / >
    < / corecom:ValueExpression >
    < corecom:ValueExpression >
    < corecom:ElementPath > ItemEBO/Identification/BusinessComponentID < / corecom:ElementPath >
    < corecom: Value > ba55de86-d8b4-4db1-b599-5aef8424ac3b < / corecom: Value >
    < / corecom:ValueExpression >
    < corecom:ValueExpression >
    < corecom:ElementPath > ItemEBO/Item/ItemIdentification/ContextID@STRUCTURE_NAME < / corecom:ElementPath >
    < corecom: Value > PIM_PBOM_S < / corecom: Value >
    < / corecom:ValueExpression >
    < corecom:ValueExpression >
    < corecom:ElementPath > ItemEBO/Identification/review < / corecom:ElementPath >
    < corecom: Value > 208281 < / corecom: Value >
    < / corecom:ValueExpression >
    < / corecom:QueryExpression >
    < / corecom:QueryCriteria >
    < / ebo:Query >
    < / ebo:DataArea >
    < / ebo:QueryItemListEBM >

    I need to retrieve the value 'ba55de86-d8b4-4db1-b599-5aef8424ac3b' on top of xml and xpath expression that I used is:

    bpws:.

    Please help with your valuable contributions.

    Thank you and best regards,
    Vikas marzouk

    829347 wrote:
    Hi Vlad,

    It works quite well. A big thank you to you.

    see you soon,
    Vikas

    Hi Vikas, could you marking my answer as correct then?

    Thank you
    Vlad

  • Lets get the user name in the workspace of BPM ADF Managed Bean

    Hi all

    I used JSF, and ADF to build the user interface for the task. And I want to get the user name of the user who is handling on workspace of BPM. For example, an ADF form may display the username of the current user in the workspace of BPM. I also try this approach: use handle Bean and bind this bean to a text output in the form of the ADF. The code fragment that I use to get the current user name is:
    ADFContext.getCurrent () .getSecurityContext () .getUserPrincipal () .getName ();

    But it does not work. The value I get is anonymous.

    So, please help me solve this problem

    Hello, please try this feature as below:

    public String getUserLogin() get WorkflowException,
    BPMIdentityException,
    {BPMUnsupportedAttributeException}
    String userId = "";
    IWorkflowServiceClient wfSvcClient;
    ITaskQueryService queryService.
    IWorkflowContext wfContext;

    Get the username of the user login
    String contextStr = ADFWorklistBeanUtil.getWorklistContextId ();
    wfSvcClient = WorkflowService.getWorkflowServiceClient ();
    queryService = wfSvcClient.getTaskQueryService ();
    wfContext = queryService.getWorkflowContext (contextStr);
    userId = wfContext.getUser ();

    Returns the user name;
    }

    Kind regards.

  • get the project name to use in a procedure?

    How to get the project name to use in a procedure?
    example of < % = odiRef.getOption ("COMPATIBLE") % > - but the name of the project or your ID?
    the 11 ODI.
    Thank you

    Published by: ODI Dev user on 12/01/2010 16:42

    Hello

    Why you want to get the name of the project? When you place a repository of development to a repository of execution, where there is no concept of projects, what value do you offer you to get?

    BOS

  • Get the user name in the select LOV

    Hello!

    I wonder if its possible to get the user name of the currently logged in user and pass it as a variable in a select statement used in a dynamic LOV in Oracle AS Portal?

    What I'm trying to do is pull all values in a table that corresponds to the current name of user to user on a portal report

    (as an approximate example)

    Select the color from mytable where username = 'whatever is the user name would be here. "

    And then the current user would get a list of values to select based on the values entered in this table.

    The issue I'm having is determine how to complete part "regardless of the user name is would be here" with the actual recorded in user name (or even if its possible). I know that on the portal, we can do #USER. FULLNAME # to display their username, is there a similar "variable", can be used to get the user name for a call to sql LOV?

    I can make it work if I statically resolve the user name to a particular value (ex: where username = "Joe.Hacker"), but I'm not sure if theres value a variable or a bind (for lack of better term) to enter the name of the user on the fly... dynamically.

    Portal.wwctx_api.get_User can be used in your report of Portal SQL query to get the user_name of the currently connected user portal. For more information about wwctx_api, see 10.1.2 portal API documentation or 10.1.4 at http://www.oracle.com/technology/products/ias/portal/html/plsqldoc/pldoc1012/index.html or http://www.oracle.com/technology/products/ias/portal/html/plsqldoc/pldoc1014/index.html

  • How to get the ActiveX component value change event?

    Hi all

    LV 8.6.1

    I try to get the ActiveX component value change event. I covered forum and through examples, but I can't get an idea of how "Recalling vi. For example, in the example 'ActiveX event Callback for IE.vi' it is used "recall vi". I've added an example where the change event of value with the mouse to the bottom of the event are scheduled to the structure of the event. Mouse down event OK work but change the value no. Can anyone describe what I need to add to my example vi who value the change event works fine?

    BR, Jim

    Here is the solution! "Value changed event" is not performed in the structure of the event, but in "Reminder VI".

  • How can I get the user name (the user who has registered their own personalized interactive report) in the application

    Hello

    I want to get the user name. Who saved their own custom application of the Apex report.

    If someone could please help to get user names.

    Thanks in advance.

    Kind regards

    Cyril S

    A possible source: see in the following metadata table: apex_application_page_Ir_rpt

    You will need the id of the application, the page id and the id of the report to the information, which is located in the application_user column...

    Thank you

    Tony Miller
    Software LuvMuffin
    Ruckersville, WILL

  • [MAF] How to get the user name and password after login?

    Hi Experts,

    I have a call to REST where it requires identification information of the user (uname and password) to identify the data that belongs to who.

    Authentication has been made with OAuth.

    I believe that there is an API to get the user name and password in the CRG

    See you soon,.

    Hendry

    Hello.

    You don't need to manipulate the credentials yourself in code. MAF will propagate the logon cookie or inject the identification information in the HTTP header if cookies are not supported.

    To do this, you must select the purchase option of cookie from the server connection Include in REST in the dialog box create a connection Login MAF , such as discussed here:

    http://docs.Oracle.com/middleware/maf210/mobile/develop/MAF-securing.htm#ADFMF23732

    In addition, you must attach the policy of security appropriate to the connection, as explained here:

    http://docs.Oracle.com/middleware/maf210/mobile/develop/MAF-Web-services.htm#ADFMF23697

    Best regards

    Frédéric Desbiens

    Senior Product Manager

    Mobility and Cloud oracle

    Twitter: @BlueberryCoder

    blog: http://blogs.oracle.com/blueberry

  • Query to get the flex field values description.

    Hello

    Entering invoices-> all the Distributions screen 'Special Mentions for the India' is here. Here we enter the value for the field TDS - tax. I want to get the list of values for TDS - tax in a query.

    Can you please help me.

    Thank you

    Nanga.

    where 'jtc.tax_type =' TDS

    and jtc.section_type = 'TDS_SECTION. '

    and org_id =: inv_sum_folder.org_id

    and jtc.section_code in

    (

    Select section_code

    of jai_ap_tds_th_vsite_v

    where vendor_id =: inv_sum_folder.vendor_id

    and vendor_site_id =: inv_sum_folder.vendor_site_id

    )

    order of jtc.tax_id

  • How to get the full name of the user of the OPS?

    Hi Experts,

    I know we can get the login controller pageContext.getUserName () user name. Is there a simple way/API to get the full name of the user (name, first name) of the OPS?

    Thank you.

    Hello

    USER name and information of the PERSON are two different concepts. You can get the id of user with pageContext.getUserId () connection. In order to get the first name, last name, you must select it from table PER_ALL_PEOPLE_F.

    You can use the sql select and set pUserId of pageContext.getUserId ();

    SELECT FIRST_NAME, LAST_NAME TO PAP PER_ALL_PEOPLE_F, FND_USER FU

    WHEN TRUNC (SYSDATE) BETWEEN PAP. EFFECTIVE_START_DATE AND PAP. EFFECTIVE_END_DATE

    AND FU. EMPLOYEE_ID = PAP. PERSON_ID

    AND FU. User_id =: pUserId

    Anil

  • How can I get the file name of a report, I have just stored in the cache

    I would like to be able to get the file name of the report that is stored in the cache directory.

    When a report is created from forms to help

    SET_REPORT_OBJECT_PROPERTY (v_report_id, report_desname, 'fubar.pdf');

    In the cache directory a file is created something like fubarABC123DE.pdf. I guess that part of ABC123DE is the cache key.

    I want to be able to read this file from another process. This process cannot use http, so I can't pass the URL. However, I would still be able to access by using the URL.

    Is all the same to get at the file name?

    The answer is, according to management, you can get the name of the file in the cache, so if you want to access the file you need to store somewhere else.

  • How to get the user name during the execution of a workflow?

    Here's what I would do:

    Say that each user is allowed to have 4 instances QA, create a workflow when a user run from vCenter plugin, it must be able to get the user name of the SSO user jsmith, and then he questions if there is an existing virtual machine jsmith_qa1, jsmith_qa2,jsmith_qa4, etc., if there isn't one, then create one for him; If not, indicate to the user that there are already 4 cases.

    I found that I can use getCurrentLdapUser to get [email protected] , now I want to remove the domain.name (there are several areas):

    username = actionResult.userPrincipalName.replace ("@[a - z].") +","");

    This does not work. Anyone know where I can find the right document for the document script of vRealize Orchestrator?

    Thank you!

    Jack

    vRO uses javascript as its scripting engine.

    UPN var = actionResult.userPrincipalName;

    var username = upn.substring (0, upn.indexOf("@"));

    Something like this will give what you want. You could also do a replacement, but I think that you should remove the quotes around the regex and use "/" instead.

    username = actionResult.userPrincipalName.replace (/ @[a - z] "+ /," "");

    Paul

Maybe you are looking for