Retrieve the value of the XML node in XMLTable

Hello, hope that it is something simple and I went beside her, but consider this example:
 with et as(
     SELECT 
           xmlType('<Invoice>
    <InvoiceInformation>
        <Number>123456</Number>
    </InvoiceInformation>
    <InvoiceLines>
        <InvoiceLine>
            <Detail>
                <Amount>100</Amount>
                <Line>1</Line>
            </Detail>
            <Type>
                <CheesyPotato>
                    <Instructions>
                        <CookTime>120</CookTime>
                        <CookTimeUnits>Minutes</CookTimeUnits>
                        <CookTemperature>450</CookTemperature>
                    </Instructions>
                </CheesyPotato>
            </Type>
        </InvoiceLine>
        <InvoiceLine>
            <Detail>
                <Amount>10000</Amount>
                <Line>2</Line>
            </Detail>
            <Type>
                <DeathStar>
                    <Instructions>
                        <CookTime>4</CookTime>
                        <CookTimeUnits>5 "parsecs"</CookTimeUnits>
                        <CookTemperature>1000000</CookTemperature>
                    </Instructions>
                </DeathStar>
            </Type>
        </InvoiceLine>  
        <InvoiceLine>
            <Detail>
                <Amount>250</Amount>
                <Line>3</Line>
            </Detail>
            <Type>
                <Quiche>
                    <Instructions>
                        <CookTime>75</CookTime>
                        <CookTimeUnits>Minutes</CookTimeUnits>
                        <CookTemperature>350</CookTemperature>
                    </Instructions>
                </Quiche>
            </Type>      
        </InvoiceLine>    
    </InvoiceLines>  
</Invoice>  
 ') xt
      from dual
       ) 
        SELECT     
            ext.*
           FROM
           et,
           XMLTABLE(
           'for $Invoice in $INV/Invoice
                for $InvoiceItem in $Invoice/InvoiceLines/InvoiceLine
                  return <row> 
                  {
                    $Invoice
                    ,$InvoiceItem
                  } 
                  </row>'           
              PASSING et.xt as INV
                    COLUMNS
               INVOICENUMBER                   VARCHAR2  (6)       PATH 'Invoice/InvoiceInformation/Number'                    
              ,InvoiceLineNumber               VARCHAR2  (5)       PATH 'InvoiceLine/Detail/Line'
              ,Amount                          VARCHAR2  (5)       PATH 'InvoiceLine/Detail/Amount'
              ,CookTime                        VARCHAR2  (5)       PATH 'InvoiceLine/Type//Instructions/CookTime'
              ,CookTimeUnits                   VARCHAR2  (15)       PATH 'InvoiceLine/Type//Instructions/CookTimeUnits'
              ,CookTemperature                 VARCHAR2  (10)       PATH 'InvoiceLine/Type//Instructions/CookTemperature'
            ) ext
/            
              
              
    INVOICENUMBER INVOICELINENUMBER AMOUNT COOKTIME COOKTIMEUNITS   COOKTEMPERATURE 
------------- ----------------- ------ -------- --------------- --------------- 
123456        1                 100    120      Minutes         450             
123456        2                 10000  4        5 "parsecs"     1000000         
123456        3                 250    75       Minutes         350   
How the child node of the 'name' Type?
TypeChild       INVOICENUMBER INVOICELINENUMBER AMOUNT COOKTIME COOKTIMEUNITS   COOKTEMPERATURE 
------------------- ------------- ----------------- ------ -------- --------------- --------------- 
CheesyPotato 123456        1                 100    120      Minutes         450             
DeathStar      123456        2                 10000  4        5 "parsecs"     1000000         
Quiche          123456        3                 250    75       Minutes         350 
I have tried different methods; along the lines of ', $InvoiceItem, Type, child, name ' does not, any help would be appreciated, thanks

Hello

You can use the name() function in the COLUMNS clause:

SQL> WITH et AS(
  2    SELECT XMLType('
  3      
  4          123456
  5      
  6      
  7          
  8              
  9                  100
 10                  1
 11              
 12              
 13                  
 14                      
 15                          120
 16                          Minutes
 17                          450
 18                      
 19                  
 20              
 21          
 22          
 23              
 24                  10000
 25                  2
 26              
 27              
 28                  
 29                      
 30                          4
 31                          5 "parsecs"
 32                          1000000
 33                      
 34                  
 35              
 36          
 37          
 38              
 39                  250
 40                  3
 41              
 42              
 43                  
 44                      
 45                          75
 46                          Minutes
 47                          350
 48                      
 49                  
 50              
 51          
 52      
 53  ') xt
 54    FROM dual
 55  )
 56  SELECT ext.*
 57  FROM et
 58     , XMLTable(
 59         'for $Invoice in $INV/Invoice
 60            for $InvoiceItem in $Invoice/InvoiceLines/InvoiceLine
 61            return 
 62            {
 63              $Invoice/InvoiceInformation
 64            , $InvoiceItem
 65            }
 66            '
 67         PASSING et.xt as INV
 68         COLUMNS
 69           typechild          VARCHAR2(30)  PATH 'name(InvoiceLine/Type/*)'
 70         , INVOICENUMBER      VARCHAR2(6)   PATH 'InvoiceInformation/Number'
 71         , InvoiceLineNumber  VARCHAR2(5)   PATH 'InvoiceLine/Detail/Line'
 72         , Amount             VARCHAR2(5)   PATH 'InvoiceLine/Detail/Amount'
 73         , CookTime           VARCHAR2(5)   PATH 'InvoiceLine/Type/*/Instructions/CookTime'
 74         , CookTimeUnits      VARCHAR2(15)  PATH 'InvoiceLine/Type/*/Instructions/CookTimeUnits'
 75         , CookTemperature    VARCHAR2(10)  PATH 'InvoiceLine/Type/*/Instructions/CookTemperature'
 76       ) ext
 77  ;

TYPECHILD                      INVOICENUMBER INVOICELINENUMBER AMOUNT COOKTIME COOKTIMEUNITS   COOKTEMPERATURE
------------------------------ ------------- ----------------- ------ -------- --------------- ---------------
CheesyPotato                   123456        1                 100    120      Minutes         450
DeathStar                      123456        2                 10000  4        5 "parsecs"     1000000
Quiche                         123456        3                 250    75       Minutes         350
 

If this does not work for your version (pre 11g), you will need to push the expression in the main XQuery expression:

...
   , XMLTable(
       'for $Invoice in $INV/Invoice
          for $InvoiceItem in $Invoice/InvoiceLines/InvoiceLine
          return 
          {
            element TypeChild {name($InvoiceItem/Type/*)}
          , $Invoice/InvoiceInformation
          , $InvoiceItem
          }
          '
       PASSING et.xt as INV
       COLUMNS
         typechild          VARCHAR2(30)  PATH 'TypeChild'
       , INVOICENUMBER      VARCHAR2(6)   PATH 'InvoiceInformation/Number'
...

Tags: Database

Similar Questions

  • 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.

  • How to set the value of the xml node.

    Hello

    I have the PDF application can be entered by the user using the key. When sending

    I use following code to set the value of the xml node.

    XFA. Data.assignnode ("Employee.ID", "123", 0):

    If its generators of xml as below.

    < employee >.

    < id > 123 / < ID >.

    < / name >

    < / employee >

    Now, I need to generate xml as below.

    < employee id = '123' >

    < / name >

    < / employee >

    So, how together create the id of node as above?

    Thanks in advance.

    Kind regards

    Dhiyane

    Hi Dhiyane,

    You must set contains the property if the node id to "metadata", i.e.;

    xfa.data.assignNode ("employee.id", "123", 0);
    XFA. Data.Employee.ID.Contains = 'metadata ';

    Very awkward, if you have a number of them, in which case you might want to look at using E4X.

    Good luck

    Bruce

  • 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

  • How to retrieve the XML values in a plsql table type

    Hello

    I have an XML doc as below which is a Web Service response message.

    <? XML version = "1.0" encoding = "UTF-8"? >
    < SOAP - ENV:Envelope
    xmlns:SOAP - ENV = "http://schemas.xmlsoap.org/soap/envelope/".
    container = "http://www.w3.org/2001/XMLSchema".
    xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" >
    < SOAP - ENV:Body >
    < GetOrgInput xmlns = "http://www.example.org/ComplianceServices" >
    < ProgramName > PgmA-Srsf < / ProgramName >
    < > 800 ADSL ItemName < / ItemName >
    < org > 923 < / org >
    < org > 1163 < / org >
    < org > 1103 < / org >
    < / GetOrgInput >
    < / SOAP - ENV:Body >
    < / SOAP - ENV:Envelope >

    The doc above, you could see that I have several occurrences of the element "Ent". I usually use the .extract and. getSTringVal() to retrieve the values as below.

    l_string_variable: = p_response.doc.extract ('/ /'| p_name |) ' /Child::Text()',p_namespace).getStringVal();

    But in this case if I do that, I get value as 92311631103. I need to get them in a table of the number type. Pls advice me on how to do this.

    Thank you
    PKV

    I'm guessing it's a bug fixed when Oracle 10.2 is released. I can reproduce your lack of results on 10.1.0.4 and as shown in my post above, it works correctly on 10.2.0.4.

    Here is a modification of the script that shows what is happening that I have that debugging. (It took me a bit to realize the difference that it wasn't what I was expecting)

    declare
       p_response_doc XMLTYPE;
       l_new_doc      XMLTYPE;
    begin
       p_response_doc := XMLTYPE('
    
    
    
    1163
    1103
    
    
    ');
       SELECT p_response_doc.extract('/*/*/*/CompliantOrgs','xmlns="http://www.example.org/ComplianceServices"')
         INTO l_new_doc
          FROM dual;
       dbms_output.put_line(l_new_doc.getStringVal());
       dbms_output.put_line('before loop');
       FOR r_rec IN (SELECT value(t) val
    --   FOR r_rec IN (SELECT extractvalue(value(t)
    --      , '/CompliantOrgs'
    --      , 'xmlns="http://www.example.org/ComplianceServices"' ) val
          -- BULK COLLECT INTO l_nm_array
          FROM TABLE(
            XMLSequence(
              p_response_doc.extract('/*/*/*/CompliantOrgs','xmlns="http://www.example.org/ComplianceServices"')
              )
            ) t
       ) LOOP
          dbms_output.put_line(r_rec.val.getStringVal());
    --      dbms_output.put_line(r_rec.val);
       END LOOP;
       dbms_output.put_line('After output');
    end;
    

    10.2.0.4 on this product

    1163
    1103
    
    before loop
    1163
    1103
    After output
    

    It produces on 10.1.0.4

    1163
    1103
    
    before loop
    1163
    
    1103
    
    After output
    

    As you can see, Oracle is to detach (well technically not add) the space of default names to the nodes retrieved. To compensate, you need to change your loop to look like

       FOR r_rec IN (SELECT extractvalue(value(t)
          , '/CompliantOrgs') val
    --      , 'xmlns="http://www.example.org/ComplianceServices"' ) val
          -- BULK COLLECT INTO l_nm_array
          FROM TABLE(
            XMLSequence(
              p_response_doc.extract('//CompliantOrgs','xmlns="http://www.example.org/ComplianceServices"')
              )
            ) t
       ) LOOP
    

    so extractValue does not expect the namespaces associated with the nodes.

    I would suggest you document it so that you know why things break if you upgrade to 10.2 or later at some point in the future.

  • Get all the text values in a XML node

    Suppose I have a XMLList that I'm working my way through and I want to quickly and easily get all the 'text' from the node. In other work strip the < xmtag > all possible markup and attributes and just leave the content.

    There is a simple/fast way to do it?

    < myNode >

    < title > title an event here < /title >

    < host > name and title of the presenter here < / presenter >

    < date startTime = "Somedate" / >

    < desc > <! [CDATA [text here. [[It < b > would < /b > have html or links or something like.]] > < / desc >

    < resources >

    list of < resources > has some resources, downloads, etc. < / res >

    < resources > another site or something like < / res >

    < / resource >

    < / myNode >

    If the xml is your XML instance, after loading is finished:

    trace (XML.descedants("*"). Text());

  • Need help to retrieve the XML file

    Hello

    I'm new to xml query and I need help badly. I have a file xml with the following content. I need help to extract data as:

    beginTimelocalDnmeasObjLdnhdlcRxErrAborthdlcRxErrCRChdlcRxErrLackOfBufs
    2015 07-28 T 14: 45:00 + 03:00ERSGSN01MagId.SlotId.E1/T1Trunk.FractionId=2.8.6.1240010200
    2015 07-28 T 14: 45:00 + 03:00ERSGSN01MagId.SlotId.E1/T1Trunk.FractionId=2.9.3.1000
    2015 07-28 T 14: 45:00 + 03:00ERSGSN01MagId.SlotId.E1/T1Trunk.FractionId=2.9.4.1000

    and the XML data I have are:

    <? XML version = "1.0" encoding = "UTF-8"? >

    <? XML-stylesheet type = "text/xsl" href = "MeasDataCollection.xsl"? >

    " < measCollecFile xmlns =" http://www.3GPP.org/FTP/specs/archive/32_series/32.435#measCollec ">

    < fileFormatVersion = "32.435 V9.0" fileHeader vendorName = "Ericsson" >

    < fileSender / >

    < measCollec beginTime = "2015-07 - 28 T 14: 45:00 + 03:00" / >

    < / fileHeader >

    < measData >

    < managedElement localDn = "ERSGSN01" / >

    < measInfo measInfoId = ' E1/T1, hdlc' >

    < job jobId = "Meas_E1T1_all" / >

    < duration granPeriod = "PT900S" endTime = "2015-07 - 28 T 15: 00:01 + 03:00" / >

    < duration repPeriod = "PT900S" / >

    < p measType = "1" > hdlcRxErrAbort < / measType >

    < p measType = "2" > hdlcRxErrCRC < / measType >

    < p measType = "3" > hdlcRxErrLackOfBufs < / measType >

    < p measType = "4" > hdlcRxErrMaxFrameLen < / measType >

    < p measType = "5" > hdlcRxErrNonOctetAlign < / measType >

    < p measType = "6" > hdlcRxErrQueue < / measType >

    < p measType = "7" > hdlcRxOK < / measType >

    < p measType = "8" > hdlcRxOctets < / measType >

    < p measType '9' = > hdlcTxOK < / measType >

    < p measType = "10" > hdlcTxOctets < / measType >

    < measValue measObjLdn="MagId.SlotId.E1/T1Trunk.FractionId=2.8.6.1" >

    < p r = "1" > 2400 / < r >

    < p r '2' = > 1020 / < r >

    < p r = "3" >/< r > 0

    < p r = "4" >/< r > 0

    < p r = "5" > </r > 0

    < p r = "6" >/< r > 0

    < p r = "7" >/< r > 0

    < p r = "8" > 0 </r >

    < p r '9' = > 295 / < r >

    < p r = "10" > 4130 / < r >

    < / measValue >

    < measValue measObjLdn="MagId.SlotId.E1/T1Trunk.FractionId=2.9.3.1" >

    < p r = '1' >/< r > 0

    < p r = "2" >/< r > 0

    < p r = "3" >/< r > 0

    < p r = "4" >/< r > 0

    < p r = "5" > </r > 0

    < p r = "6" >/< r > 0

    < p r = "7" >/< r > 0

    < p r = "8" > 0 </r >

    < p r '9' = > 295 / < r >

    < p r = "10" > 4130 / < r >

    < / measValue >

    < measValue measObjLdn="MagId.SlotId.E1/T1Trunk.FractionId=2.9.4.1" >

    < p r = '1' >/< r > 0

    < p r = "2" >/< r > 0

    < p r = "3" >/< r > 0

    < p r = "4" >/< r > 0

    < p r = "5" > </r > 0

    < p r = "6" >/< r > 0

    < p r = "7" >/< r > 0

    < p r = "8" > 0 </r >

    < p r '9' = > 295 / < r >

    < p r = "10" > 4130 / < r >

    < / measValue >

    < / measInfo >

    < / measData >

    < fileFooter >

    < measCollec = endTime "2015-07 - 28 T 15: 00:01 + 03:00" / >

    < / fileFooter >

    < / measCollecFile >

    Help, please. I tried to select a value using the following xml query which does not lead to any output:

    WITH t AS (SELECT xmltype (bfilename('SGSN_STAT_ERICSSON', 'A20150728.1445+0300-20150728.1500+0300_Meas_E1T1_all.52'), nls_charset_id('UTF-8')) FROM dual xmlcol)

    SELECT beginTime, localDn, measObjLdn, hdlcRxErrAbort, hdlcRxErrCRC, hdlcRxErrLackOfBufs

    T, XMLTABLE

    (XMLNAMESPACES ('http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec' as 'ns1'), )

    ' / measCollecFile'

    passage xmlcol

    columns

    beginTime PATH VARCHAR2 (32) ' / measCollec/@beginTime',

    localDn PATH VARCHAR2 (32) ' / measData/managedElement@localDn',

    measObjLdn PATH VARCHAR2 (32) ' / measData/measInfo/measValue@measObjLdn',

    ["hdlcRxErrAbort PATH VARCHAR2 (32) ' / measData/measInfo/measValue/r[@p="1 ']',

    ["hdlcRxErrCRC PATH VARCHAR2 (32) ' / measData/measInfo/measValue/r[@p="2 ']',

    "[" hdlcRxErrLackOfBufs PATH VARCHAR2 (32) ' / measData/measInfo/measValue/r[@p="3 ']"

    )

    Sincere greetings

    Either way, using an XQuery FLWOR expression:

    select x.*
    from xmltable(
           xmlnamespaces(default 'http://www.3gpp.org/ftp/specs/archive/32_series/32.435#measCollec')
         , 'for $h in /measCollecFile
              , $v in $h/measData/measInfo/measValue
            return element row {
              $h/fileHeader/measCollec/@beginTime
            , $h/measData/managedElement/@localDn
            , $v/@measObjLdn
            , element r1 {$v/r[@p="1"]}
            , element r2 {$v/r[@p="2"]}
            , element r3 {$v/r[@p="3"]}
            }'
           passing xmltype(bfilename('TEST_DIR', 'test.xml'), nls_charset_id('AL32UTF8'))
           columns beginTime           timestamp with time zone path '@beginTime'
                 , localDn             varchar2(32)             path '@localDn'
                 , measObjLdn          varchar2(80)             path '@measObjLdn'
                 , hdlcRxErrAbort      number                   path 'r1'
                 , hdlcRxErrCRC        number                   path 'r2'
                 , hdlcRxErrLackOfBufs number                   path 'r3'
         ) x ;
    
  • Remove the XML node

    Dear adobe experts,

    I have a requirement to remove a node in the XML interface of a form of adobe (not only by removing a subform in the form). It must be a deletion, an empty node does not work (I read this in another post).

    The XML structure looks like this:

    < ITEM >

    < DATA >

    < ROW_IID > 0 < / ROW_IID >

    < PARENT > 0 < / PARENT >

    < CHILD > 0 < / CHILD >

    < / DATA >

    < DATA >

    < ROW_IID > 1 < / ROW_IID >

    < PARENT > 0 < / PARENT >

    < CHILD > 0 < / CHILD >

    < / DATA >

    < / ITEM >

    I want to, for example, to remove the second node of data including the underlying elements: row_iid, parent & child. Already tried: xfa.record.nodes.remove (oRemoveNode); I got it from http://partners.adobe.com/public/developer/en/xml/Adobe_XML_Form_Object_Model_Reference.pd f and several messages in this forum, but I get the following message appears in the error console: remove failed. I know that the somexpression is correct.

    Here's the code I used to try to remove the node.

    var node_loc;

    var del_node;

    [node_loc = ' xfa.record.ELEMENT.DATA [1 '];

    del_node = xfa.resolveNode (node_loc);

    xfa.record.Nodes.Remove (del_node);

    Anyone know what I am doing wrong?

    Kind regards

    Niels

    Hi Steve,.

    I fixed it myself. I adjusted my code a little, so the node, including the elements is successfully deleted.

    Here is the way that I fixed it:

    var node_loc;

    var del_node;

    [node_loc = ' xfa.record.ELEMENT.DATA [1 '];

    del_node = xfa.resolveNode (node_loc);

    xfa.record.ELEMENT.nodes.remove (del_node);

    Thanks for the help!

    Kind regards

    Niels

  • 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

  • AS2 change the XML node button

    Hello

    I'm a training designer ACE. I would be grateful if someone can help me solve this code.  I need my flash application in order to move nodes for certain text fields and a movieclip that load images, when I click on one of the 6 simple buttons. Everything works except the part. How to change nodes? Can not find anywhere in websearch buttons change nodes, maybe it's called something else and not "switching nodes? Here is a part of the code that I can't solve, he begins to / / part of the PROBLEM. Thank you!

    //-----------AS2

    function loadXML(loaded) {
        if (loaded) {
        
            _root.locationX = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
            _root.nameX = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
            _root.emailX = this.firstChild.childNodes[0].childNodes[2].firstChild.nodeValue;
            _root.image = this.firstChild.childNodes[0].childNodes[3].firstChild.nodeValue;
    
    //loads text
            location_txt.text = _root.locationX;
            name_txt.text = _root.nameX;
            email_txt.text = _root.emailX;
    //loads image   
            var url:String = _root.image;
            var movieClip:MovieClip = createEmptyMovieClip("movieClip", 0);
            movieClip.loadMovie(url);
            
        
    // PROBLEM:  this BUTTON has to switch values to next node
      
    menu1.onPress = function() {
    xmlData = new XML();
    xmlData.ignoreWhite = true;
    xmlData.onLoad = loadXML;
            _root.locationX = loadXML.firstChild.childNodes[1].childNodes[0].firstChild.nodeValue;
            _root.nameX = loadXML.firstChild.childNodes[1].childNodes[1].firstChild.nodeValue;
            _root.emailX = loadXML.firstChild.childNodes[1].childNodes[2].firstChild.nodeValue;
            _root.image = loadXML.firstChild.childNodes[1].childNodes[3].firstChild.nodeValue;
    }
    menu2.onPress = function() {
    xmlData = new XML();
    xmlData.ignoreWhite = true;
    xmlData.onLoad = loadXML;
            _root.locationX = loadXML.firstChild.childNodes[2].childNodes[0].firstChild.nodeValue;
            _root.nameX = loadXML.firstChild.childNodes[2].childNodes[1].firstChild.nodeValue;
            _root.emailX = loadXML.firstChild.childNodes[2].childNodes[2].firstChild.nodeValue;
            _root.image = loadXML.firstChild.childNodes[2].childNodes[3].firstChild.nodeValue;
    }
    /// ...etc. --- 6 simple buttons, so far it is not working
    
    
    } else {
    content = "file not loaded!";
    }
    }
    

    +++ XML file: CDA to CDA, PLM button for button PLM, etc..

    <?xml version="1.0" encoding="utf-8" ?>
    <dots>
        <DATA>
              <location>Empty location</location>
              <name>Empty Name</name>
              <email>Empty email address</email>
              <image>Contacts/img/empty.jpg</image>
    
        </DATA>
        <CDA>
              <location>Annemasse - CDA M&T Team</location>
              <name>John Doe CDA</name>
              <email>[email protected]</email>
              <image>Contacts/img/img1.jpg</image>
    
        </CDA>
        <PLM>
              <location>Annemasse - PLM key user</location>
              <name>John Doe PLM</name>
              <email>[email protected]</email>
                        <img>Contacts/img/img2.jpg</img>
    
        </PLM>
        <CAD>
              <location>Annemasse - CAD key user</location>
              <name>John Doe CAD</name>
              <email>[email protected]</email>
                        <img>Contacts/img/img3.jpg</img>
    
        </CAD>
        <CAE>
              <location>Annemasse - CAE key user</location>
              <name>John Doe CAE</name>
              <email>[email protected]</email>
                        <img>Contacts/img/aimg4.jpg</img>
    
        </CAE>
        <PMT>
              <location>Annemasse - PMT key user</location>
              <name>John Doe PMT</name>
              <email>[email protected]</email>
                        <img>Contacts/img/img5.jpg</img>
    
        </PMT>
        <engineering>
              <location>Annemasse - ENGINEERING IS CONTACTS</location>
              <name>John Doe ENG</name>
              <email>[email protected]</email>
                        <img>Contacts/img/img6.jpg</img>
    
        </engineering>
    </dots>
    

    Use the movieclip buttons and load your xml only once file:

    var movieClip:MovieClip = createEmptyMovieClip("movieClip", 0);

    var xmlData:XML;
    xmlData.ignoreWhite = true;
    xmlData.onLoad = loadXML;

    xmlData.load (whatever.xml);

    function loadXML() {
    xmlData=this;

    }

    for(var i:Number=0;i<6;i++){  // assuming you have menu0,menu1,...,menu5

    this["menu"+i].ivar=i;

    this["menu"+i].onRelease=changeF;


    function changeF(){


            _root.locationX = xmlData.firstChild.childNodes[this.ivar].childNodes[0].firstChild.nodeValue;
            _root.nameX = this.firstChild.childNodes[this.ivar].childNodes[1].firstChild.nodeValue;
            _root.emailX = this.firstChild.childNodes[this.ivar].childNodes[2].firstChild.nodeValue;
            _root.image = this.firstChild.childNodes[this.ivar].childNodes[3].firstChild.nodeValue;

    //loads text
            location_txt.text = _root.locationX;
            name_txt.text = _root.nameX;
            email_txt.text = _root.emailX;
    //loads image  
            var url:String = _root.image;
           
            movieClip.loadMovie(url);

    }    

  • Make the XML nodes

    I'm trying to get my XML document-specific information... Here is the info:

    < test >
    < UI > < /iu > 2000
    < amt > 125 < / amt >
    < dump > 0.2 < / dump >
    < > 3.2 hData < / hData >
    < hData > 16 < / hData >
    < > 8 hData < / hData >
    < UI > < /iu > 2000
    < amt > 125 < / amt >
    < dump > 0.3 < / dump >
    < > 4.8 hData < / hData >
    < hData > 16 < / hData >
    < > 8 hData < / hData >
    < / test >

    Here's the code in Flash:

    var myURLLoader:URLLoader = new URLLoader();
    var myURLRequest:URLRequest = new URLRequest ("dump.xml");
    myURLLoader.load (myURLRequest);
    myURLLoader.addEventListener (Event.COMPLETE, dataOK);
    function dataOK(myevent:Event):void {}
    var myXML:XML = new XML (myURLLoader.data);
    TF1. Text = myXML.hData [1];

    }

    He steps back a value of 16, that is correct.  But I want to be able to refer to a specific location, such as the second dump data and the 3rd entry here.  So I tried:

    TF1. Text = myXML.dump [1] .hData [2];

    He comes back with:

    TypeError: Error #1010: a term is undefined and has no properties.

    I gues I just need to know how to read the nodes that are above hData.

    Thank you.

    Dave

    hData nodes are not children of dump nodes.  use:

    myXML.hData [5]

  • My native BB app, how to connect to the remote URL and call a Web service method to retrieve the XML base result using Eclipse Version 3.7.2

    Hello

    I am new to the development of native applications from BB using JDE. I'm testing Simulator. From my native BB app, I connect a remote URL and call a Web service method to extract some basic result XML.

    I need to write a login code remote URL to achieve? If so, how?

    So, how can I use this connection object to call the Web service from this URL remotely.

    Please help me out of it...

    Many thanks in advance...

    What i am doing is, On clicking the "Login" button i want to call the webservice method like below mentioned code...
    Here WaveServices is a class and getAllCinemas() is a static method inside which a webservice method call is made..
    
    loginButtonField.setChangeListener(new FieldChangeListener() {
                public void fieldChanged(Field paramField, int paramInt) {
                    WaveServices.getAllCinemas();
                }
            });
    

    Indeed, the question was raised and answered here:

    http://supportforums.BlackBerry.com/T5/Java-development/from-my-native-BB-application-how-to-connect...

  • Retrieve the XML via an HTTP request

    Hello

    What would be the most effective way to recover the large XML from Oracle (gr 11, 2) via a HTTP request?
    XML is generated during execution in a stored procedure with either XML SQL statements as
    select xmlelement("text", 'Hello world') from dual;
    or other methods as
    select DBMS_XMLGEN.GETXML ('select ''Hello world'' text from dual') from dual;
    I'm sure I'll be using embedded PL/SQL gateway as an HTTP server, and I can easily manage small XMLs that fit into a VARCHAR2 with a following procedure:
      PROCEDURE HelloWorld AS
        xml xmltype;
      BEGIN
        select xmlelement("text", 'Hello world') into xml from dual;
        owa_util.mime_header('text/xml');
        htp.print(xml.getstringval);
      END;
    Then I she would recover via http:// < hostname >: < port > / < DAD > /HelloWorld

    But I do not know how to handle large (several MB) XMLs.
    I couldn't find anything useful within OWA * or HTP packages and splitting of the CLOB in chunks of 32 K seems inefficient and a little ugly to me.
    Any suggestions?

    With respect,
    Goran

    Hi Goran,

    See this post for a similar situation, it isn't that bad to see: {message identifier: = 10619251}

    Alternatively, you can use Native database Webservice to display the result of the query, and then pull it out via the HTTP protocol.

  • My event.result may or may not return a node in the xml file. How can I avoid that TypeError: Error #1009:

    My event.result may or may not return a node in the xml file. How can I avoid that TypeError: Error #1009: cannot access a property or method of a null object reference.

    I have a very simple question. I want to take the value of

    Event.Result.Item.nodeindex1.nodeindex2.Row.MyValue;

    and assign it to a text field

    mytextTi.text = event.result.item.nodeindex1.nodeindex2.row.myvalue;

    But if a part of the tree is missing, which is also valid, so I get TypeError: Error #1009: cannot access a property or method of a null object reference.

    I tried various solutions such as the following. Is there any simple way to do this?

    If (event.result.item.nodeindex1.nodeindex2.row.myvalue! = undefined)-does not work

    Unfortunately, one must test all levels to ensure that it is not null before the reference to it. You can take advantage of the short-circuit evaluation in tying together, for example

    if (event.result.item
        && event.result.item.nodeindex1
        && event.result.item.nodeindex1.nodeindex2
        && event.result.item.nodeindex1.nodeindex2.row
        && event.result.item.nodeindex1.nodeindex2.row.myvalue)
    {
        // access the variable
    }
    else
    {
        // one of the XML nodes in the path is null
    }
    

    Or you could stay away from her a little hacky and wrap the reference in a try/catch block.

    -Tom

    Flex SDK engineer

  • Access to the XML schemas from the connection manager?

    The connection manager for a connection opened in version 4 is no longer an 'XML Schémas' icon (Java and XML patterns seem to have been deleted between versions 3 and 4). Is there a definition that can return the XML schemas?

    Using lists yet... »

    XML schemas

    XML schemas are definitions of schema, written in XML, that describe the structure and various other semantics of XML instance documents. For conceptual and information on the use of XML schemas, see the Guide of Oracle XML DB Developer in the Oracle database documentation library.

    You can change an XML schema by right clicking in the connections Navigator XML schema name and selecting open from the menu. You can delete a selected schema by selecting the Drop Schema menu. » ...

    The XML node drawings missing in the connections Navigator is a known issue for the 4.0.1.  The 4.0.2 patch is a fix.

    Regarding the Java node, it seems to me in all versions 4.0.x.  Maybe your Preferences... > Database > Navigation filter turned it off?

    Kind regards
    Gary

    SQL development team

Maybe you are looking for

  • Re: Satellite A210 - cannot start and how can I backup my data?

    Hi, after installing some software of spyware on my vista A210 (spysweeper) I rebooted my laptop, restart it went straight to the Boot Manager and load insert me my recovery disc and follow the instructions in an effective way. The only options I hav

  • Satellite A200-PSAF6A-0US01N doesn't recognize CD

    My DVD-ROM won t recognize the CD but will read DVD; any suggestions? I've used a rmvfltrs.exe file to get the DVD to read, but it won t read the CD.ITunes also has a message error that says he won t CD rip or burn because there a lost file and I nee

  • Regression / channel function

    Hello! I want to estimate a value of table 3D attached. For example: if I = 600 X and Y = Z then 0.2 = 1492, this example works well, but if I = 900 X and Y = 0.14 I estimate the value of Z. Is it possible with tiara functions to estimate the point Z

  • Build ActiveX servers in LabVIEW

    Hello I'm trying to implement an ActiveX Server is the "out-of-process Server" type (which means that it is a program (.exe file) windows executable) in LabVIEW.  I have seen tons information that the way which use LabVIEW as a client ActiveX and eve

  • New router with same name let me not able to administer EA6500

    I have replace the EA6500 and therefore gave a new of the same name. Cisco Cloud Connect is really confused now and I can run no longer. It just hangs: http://www.ciscoconnectcloud.com/ So it also just hangs: www.linksyssmartwifi.com