Getting node names

Is there a way to get the node names of a row?
The xml I will be getting has variable node names and I need
to list them when a row is chosen.
I do not have the flexibility to change the structure of the
xml data.

Dianna,
Thank you for your reply.
Please forgive my ignorance, I am new at this.
I can not get the alert(j) to come up.
Here is what I have:
conditions.xml:
<conditions>
<condition>
<name>condition name 1</name>
<right_column>right column 1</right_column>
<intro>intro content1</intro>
<section title="section title 1_1">section content
1_1</section>
<section title="section title 2_1">section content
2_1</section>
<section title="section title 3_1">section content
3_1</section>
<section title="section title 4_1">section content
4_1</section>
<section title="section title 5_1">section content
5_1</section>
<link url="link url 1_1">link title 1_1</link>
<link url="link url 2_1">link title 2_1</link>
<link url="link url 3_1">link title 3_1</link>
</condition>
<condition>
<name>condition name 2</name>
<intro>intro content2</intro>
<symptoms>symptoms 2</symptoms>
<treatment>treatment 1</treatment>>
<section title="section title 1_2">section content
1_2</section>
<section title="section title 2_2">section content
2_2</section>
<section title="section title 3_2">section content
3_2</section>
<section title="section title 4_2">section content
4_2</section>
<link url="link url 1_2">link title 1_2</link>
<link url="link url 2_2">link title 2_2</link>
<link url="link url 3_2">link title 3_2</link>
<link url="link url 4_2">link title 4_2</link>
</condition>
</conditions>
I would like to be able to get
"name","right_column","intro","treatment"..... based on what row is
selected.
I tried:
var dsAll = new Spry.Data.XMLDataSet("conditions.xml",
"conditions/condition",{sortOnLoad:"name",sortOrderOnLoad:"ascending",distinctOnLoad:true ,useCache:false});
dsAll.loadData();
function getnames(){
var datas = dsAll.data;
for (var i=0; i < datas.length; i++){
alert(datas.length);
for (var j in datas)
alert(j);
getnames();
I don't get an alert with this. If I put alert("test"); as
the first thing in the function, I get a bunch of alerts:
Alers
"test"
"2"
"0"
"1"
"2"
"0"
"1"
Very Strange!
It is probably something simple that I am missing.
Thank you again for you help.

Similar Messages

  • Xml: how to get node value when pasing node name as a parameter

    Hi,
    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>
    Then I want to read specific node value 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'm don't know how to get the value when node name is dynamically changed.

    use:
    getNodeValue(buttonID); //the value here is set dynamically
    private function getNodeValue (nodeName:String):void {
    trace (xmlData[nodeName])                    

  • How to get the name and value of an attribute on a node/element that is not a child

    Hello,
    Can someone shed some wisdom on how I can compare 2 xml nodes for differences.
    My main challenge is I need to use the attributes/values of 'ProductDescription' and 'Features' as 'key' to identify the same node in
    another doc with the same layout, but different content.
    I am having trouble getting the name of the attribute on the node, 'ProductDescription' and 'Features'.  I can only seem to get the node names, but not the attributes on the node.  I need the name, because it can be different from doc to doc, so
    I can't hardcode this.
    Can someone please help with how to retrieve an attribute name/value on a node that is not a child.  Here's an example of what
    my xml looks like:
    DECLARE
    @myDoc1 xml
    ,@mydoc2 xml
    DECLARE
    @ProdID int
    SET @myDoc1 ='<ProductDescription ProductID="1" ProductName="Road Bike">
    <Features  featureID  = "1" featureName = "body">
      <Warranty>1 year parts and labor</Warranty>
      <Maintenance>3 year parts and labor extended maintenance is available</Maintenance>
    </Features>
    <features featureID = "2" featureName = "seat">
      <Warranty>1 year parts and labor</Warranty>
      <Maintenance>2 year parts and labor extended maintenance is available</Maintenance>
    </Features>
    </ProductDescription>
    SET @myDoc2 ='<ProductDescription ProductID="1" ProductName="Road Bike">
    <Features  featureID  = "1" featureName = "body">
      <Warranty>2 year parts and labor</Warranty>
      <Maintenance>3 year parts and labor extended maintenance is available</Maintenance>
    </Features>
    <features featureID = "2" featureName = "wheel">
      <Warranty>1 year parts and labor</Warranty>
      <Maintenance>2 year parts and labor extended maintenance is available</Maintenance>
    </Features>
    </ProductDescription>
    I need to compare the attributes of 'ProductDescription' and 'Features' from @mydoc1 against @mydoc2 to see if they are the same based on those 2 nodes first.  If they are, then i want to show the difference in the child elements. 
    This will eventually be an outer join to give me the differences betw the 2 docs based on those key values (node attributes).
    I used node('//*') for the path, and value('local-name(../.)', 'varchar(50)') as element
    ,value('.[not(@xsi:nil = "true")]','VARCHAR(255)') AS new_value
    ...etc...
    but that only gives me the node names, and the child elements.  It does not give me back the attribute names and values from the node itself.
    Thanks in advance for your help.
    cee

    Are you looking for something like this:
    DECLARE @myDoc1 xml
    SET @myDoc1 ='<ProductDescription ProductID="1" ProductName="Road Bike">
    <Features  featureID  = "1" featureName = "body">
      <Warranty>1 year parts and labor</Warranty>
      <Maintenance>3 year parts and labor extended maintenance is available</Maintenance>
    </Features>
    <Features featureID = "2" featureName = "seat">
      <Warranty>1 year parts and labor</Warranty>
      <Maintenance>2 year parts and labor extended maintenance is available</Maintenance>
    </Features>
    </ProductDescription>'
    SELECT T.c.value('local-name(.)', 'nvarchar(50)') AS name,
           T.c.value('.', 'nvarchar(50)')  AS value
    FROM   @myDoc1.nodes('ProductDescription/@*') AS T(c)
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Getting the name of the node in Xpath

    Hey Guys,
    I have a huge XML file that am parsing using XPath. I was able to get most of what i wanted. But i have been having problems when there is a tag with an attribute.
    How can i get the value of the attribute given the nodes name?.
    Would appreciate your help guys.
    kay

    The XPath expression for attribute is tag-name/@attribute-name

  • E4X : How to get elements that contain a string pattern in the node name?

    Is there a way to extract children from an XMLList where the node name of a child contains a string pattern?
    For example :
    <record>
         <XblahX/>
         <cow/>
         <YblahY/>
    </record>
    How to get the elements of record that have a node name that contains the string "blah"?

    var rec:XML = <record>
         <XblahX/>
         <cow/>
         <YblahY/>
    </record>;
    var r:RegExp = /blah/;
    var elems:XMLList = rec.children().(localName().search(r)>-1);
    trace(elems.toXMLString())

  • GET XML NODE NAME FOR LOOPING

    Hi,
    i hv a procedure to get the xml data's(values of the xml) from a clob. in a table.it works fine the parent tags but if the same tag is there for two times then i am not able to loop it because i dont know the tag name for which the loop should be run.
    to be clear.
    <root>
    <tag1>value1
    </tag1>
    <tag1>value2
    </tag1>
    </root>
    i need to run some fns for each node value so i need to loop for each node having same value pls help me to get the node name.

    You can simply alter get xml node name in loop to return a count on just the node you are looking for. Not sure why you need to know the count when you can have the logic iterate through the nodes for you, either as an XMLType or a DOMDocument (see nodelist).

  • Get xml node name in loop

    Hi,
    i hv a procedure to get the xml data's(values of the xml) from a clob. in a table.it works fine the parent tags but if the same tag is there for two times then i am not able to loop it because i dont know the tag name for which the loop should be run.
    to be clear.
    <root>
    <tag1>value1
    </tag1>
    <tag1>value2
    </tag1>
    </root>
    i need to run some fns for each node value so i need to loop for each node having same value pls help me to get the node name.

    pls help me to get the node name.Still not sure what you are actually trying to accomplish, but maybe this helps:
    SQL> set echo on
    SQL> col node form a30
    SQL> with xml as (
    select xmltype('<root>
    <tag1>value1
    </tag1>
    <tag1>value2
    </tag1>
    </root>') xml from dual)
    select t.column_value.getrootelement() node
      from xml xml,
    table (xmlsequence(xml.xml.extract('//*'))) t
    NODE                         
    root                         
    tag1                         
    tag1                         
    3 rows selected.

  • How to get the node name?

    Hi Guys,
    I have a path that look like this root/1stLevel/dynamicLevel
    how can i get the dynamic level node name when it come with different node name so that i can catch it into one of the variable?
    it may change according to the requester
    root/1stLevel/dynamicLevel1
    root/1stLevel/dynamicLevel2
    root/1stLevel/dynamicLevel3
    root/1stLevel/dynamicLevel4

    What software? In OSB try Assign with this expression:
    fn:name($body/root/firstLevel/*[1])By the way, you can't use element named "1stLevel" because it starts with number.

  • HOw to get parent node name value through its child node?

    Hi,
    Experts,
    I am able to get child node name values but according to attribute name value i want to  get its parent name value how to achieve that. For that i have used If_Ixml_element->Get_parent. Please pass some idea on it.
    Thanks in advance,
    Shabeer ahmed.

    Hello Shabeer
    I think the coding should be straightforward:
    DATA: lo_element   TYPE REF TO if_ixml_element,
              lo_child        TYPE REF TO if_ixml_node,
              lo_parent      TYPE REF TO if_ixml_node.
    " NOTE: LO_ELEMENT holds your child node
      lo_child ?= lo_element.
      lo_parent = lo_child->get_parent( ).
    Regards
      Uwe

  • Getting file node name from SQL query

    Hello everyone,
    I have a concurrent request that requires the file node name as input. For example, when I login to oracle on our test instance , I use http://moon1.oando-plc.com:8000. For this concurrent program, the file node name is shown as moon1.oando-plc.com.
    I need to use this argument in a PL/SQL procedure I am writing and I don't want to use any hardcoding.
    Is there any way to get this data from an SQL statement.
    Thanks

    Hi,
    You can get it from ICX_PARAMETERS table (HOME_URL column). Orsearch the profile options values for "http" to get the login page URL (and/or server name) -- See (Note: 201945.1 - How to list E-Business Suite Profile Option values for all levels using SQLPlus).
    Regards,
    Hussein

  • Get xml node name from clob in loop

    Hi,
    i hv a procedure to get the xml data's(values of the xml) from a clob. in a table.it works fine the parent tags but if the same tag is there for two times then i am not able to loop it because i dont know the tag name for which the loop should be run.
    to be clear.
    <root>
    <tag1>value1
    </tag1>
    <tag1>value2
    </tag1>
    </root>
    i need to run some fns for each node value so i need to loop for each node having same value pls help me to get the node name.

    You can simply alter get xml node name in loop to return a count on just the node you are looking for. Not sure why you need to know the count when you can have the logic iterate through the nodes for you, either as an XMLType or a DOMDocument (see nodelist).

  • Poweshell script to parse a XML document to get all Leaf level nodes with Node names in CSV

    Hi Experts,
    I want to write a Powershell script to parse a XML document to get all Leaf level nodes with Node names in CSV
    <?xml version="1.0" encoding="UTF-8"?>
    <CATALOG>
       <CD>
          <TITLE>Empire Burlesque</TITLE>
          <ARTIST>Bob Dylan</ARTIST>
          <COUNTRY>USA</COUNTRY>
          <COMPANY>Columbia</COMPANY>
          <PRICE>10.90</PRICE>
          <YEAR>1985</YEAR>
       </CD>
    </CATALOG>
    Need to display this as
    CD_Tiltle, CD_ARTIST, CD_COUNTRY, CD_COMPANY, CD_PRICE, CD_YEAR
    Empire Burlesque, Bob Dylan,USA,Columbia,10.90,1985
    and so on..
    I do not want to hard code the tag names in the script.
    current example is 2 level hierarchy XML can be many level till 10 max I assume
    in that case the csv file field name will be like P1_P2_P3_NodeName as so on..
    Thanks in advance
    Prajesh

    Thankfully, I have writtenscript for ths same $node_name="";
    $node_value="";
    $reader = [system.Xml.XmlReader]::Create($xmlfile)
    while ($reader.Read())
    while ($reader.Read())
    if ($reader.IsStartElement())
    $node_name += "," + $reader.Name.ToString();
    if ($reader.Read())
    $node_value += "," + $reader.Value.Trim();
    Thanks and Regards, Prajesh Please use Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful.

  • Getting the name of selected Node in Adobe 3D PDF

    Hello,
    I'm trying to use the following code to get the name of the selected node for a 3D object in my PDF.
    var c3d = this.getAnnots3D(this.pageNum)[0].context3D;
    c3d.activated = true;
    var select = c3d.scene.selectedNode.name;
    I get the error
    TypeError: c3d.scene.selectedNode is undefined
    19:Console:Exec
    undefined
    I have placed my code at the folder level.
    Can someone help please?

    The XPath expression for attribute is tag-name/@attribute-name

  • Function Module to get the node name in particular level name in Hierarchy

    Hi All,
    We have 0Material hierarchy which consists of 14 levels and materials are in the 14th level.
    We have a requirement to update the 4th level node name to all materials.
    So we have created the attribute to this 0Material and thought of updating in the transformation.
    Could you please suggest us to which function module i can in this scenario.
    Thanks in advance,..
    Prasanna

    Can you explain in more detail what exactly you want to do?
    do you want to limit hierarchy to level4?
    Regards
    Sudeep

  • Getting system names of all the nodes that compose a cluster

    I need a way to get the names (weblogic.system.name) of all the servers that compose a cluster from a JSP or a servlet. Can anyone help ?
              System: Weblogic 5.10sp10 on Solaris with SDK 1.3.0
              [att1.html]
              

              Using WLS 5.1 internal APIs, you can do this by the following:
              weblogic.cluster.ClusterManager clusterManager = weblogic.cluster.ClusterManager.theOne();
              com.sun.java.util.collections.Collection c = clusterManager.getClusterMembers();
              weblogic.cluster.ClusterMemberInfo[] infos =(weblogic.cluster.ClusterMemberInfo[])
              c.toArray(new weblogic.cluster.ClusterMemberInfo[0]);
              if (infos != null) {
              for (int i=0; i < infos.length; i++) {
              ClusterMemberInfo info = infos;
              String clusterName = info.name();
              System.out.println("Cluster Name is: " + clusterName);
              "Laurent PAILLARD" <[email protected]> wrote:
              >C'est un message de format MIME en plusieurs parties.
              >
              >
              >I need a way to get the names (weblogic.system.name) of all the servers
              >=
              >that compose a cluster from a JSP or a servlet. Can anyone help ?
              >
              >System: Weblogic 5.10sp10 on Solaris with SDK 1.3.0
              >
              >
              ><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
              ><HTML><HEAD>
              ><META http-equiv=3DContent-Type content=3D"text/html; =
              >charset=3Diso-8859-1">
              ><META content=3D"MSHTML 5.50.4522.1800" name=3DGENERATOR>
              ><STYLE></STYLE>
              ></HEAD>
              ><BODY bgColor=3D#ffffff>
              ><DIV><FONT face=3DArial size=3D2>I need a way to get the=20
              >names (weblogic.system.name) of all the servers that compose a =
              >cluster from=20
              >a JSP or a servlet. Can anyone help ?</FONT></DIV>
              ><DIV><FONT face=3DArial size=3D2></FONT> </DIV>
              ><DIV><FONT face=3DArial size=3D2>System: Weblogic 5.10sp10 on Solaris
              >=
              >with SDK=20
              >1.3.0</FONT></DIV></BODY></HTML>
              >
              >

Maybe you are looking for

  • How to install Mac OS 10.4.8 on 4 new WD Raptors?

    Hello, just got my Mac Pro delivered with 1 x 250 GB drive. Now I want to replace this drive with 4 WD 74GB Raptor's in a RAID 0 configuration. How can I do this? For the moment I have only the Install CD's and the 4 Raptor's. They are not yet format

  • Export to PDF from Book file is freezing

    I'm trying to export books to PDF from the ID CS6 book panel. Shorter books are exporting with no problem, but some of the longer ones are hanging up around page 380 or so. The Generating PDF dialog appears and shows that the export process is stalli

  • Chinese & English Text imported from Word

    Hi, I have been having many issues of late importing Chinese/Korean/Japanese/Arabic text in to InDesign. I have created Paragraph Styles, and they match the Word Document, but when I import the word document it ignores the font/style and directly imp

  • Symbols show up in Internet Explorer but not Firefox, how do I fix this?

    Symbols like ♡ or ★ (both of which I copy and pasted and can't see at all, they are just empty spaces without hex codes). I've installed the dejavu and symbola fonts but most symbols still do not show up. I tried checking on Internet Explorer and the

  • How to Deploy crystal reports in BOE

    Hi,     I have two questions.     1.How to deploy crystal reports in BOE server.     2.How many ways is there to deploy crystal reports in BOE server and name of the method is needed.    Anyone knows about these details could you please reply me Rega