How to retrieve the value of base on the value on other nodes

Hi, I have a XML below
<? XML version = "1.0" encoding = "iso-8859-1"? > <? XML-stylesheet type = "text/xsl" href="C:\temp\horizontal.xsl"? " >
< Type report = "REPORT" >
< prop Type = 'Result' Flags = "0 x 0" > "
< prop Name = 'STEP' Type = "Obj" Flags = "0 x 0" > "
< prop Name = 'Sequence' >
< prop Name = 'RList' >
< ArrayElementPrototype Type = "TEResult" Flags = "0 x 0" > "
< / ArrayElementPrototype >
< value ID "[0]" = >
< prop Type = 'Result' Flags = "0 x 0" > "
< prop Name = "Status" Type = "String" Flags = "0x400000" > "
< value > < / value >
< / prop >
< prop Name = "ReportText" Type = "String" Flags = "0x400000" > "
< value > < / value >
< / prop >
< prop Name = "Common" Type = "Obj" TypeName = "CommonResults" Flags = "0 x 0" > "
< / prop >

< / prop >
< / value >
< value ID "[60]" = > = > ID is not set
< prop Type = 'Result' Flags = "0 x 0" > "
< prop Name = "Error" Type = "Obj" TypeName = "Error" Flags = "0x400000" > "
< prop Name = "Code" Type = "Number" Flags = "0x400000" > "
< value > 0 < / value >
< / prop >
< prop Name = "Msg" Type = "String" Flags = "0x400000" > "
< value > < / value >
< / prop >
< prop Name = "occurred" Type = "Boolean" Flags = "0x400000" > "
< value > false < / value >
< / prop >
< / prop >
< prop Name = "Status" Type = "String" Flags = "0x400000" > "
< value > spent < / value >
< / prop >
< prop Name = "Numeric" Type = "Number" NumFmt = "%i" Flags = "0 x 2400" > "
< Value > * 88 * < / value > = > value I want back
< / prop >
< prop Name = "ReportText" Type = "String" Flags = "0x400000" > "
< value > < / value >
< / prop >
< prop Name = "Common" Type = "Obj" TypeName = "CommonResults" Flags = "0 x 0" > "
< / prop >
< prop Name = "Units" Type = "String" Flags = "0x2000" > "
< Value >TESTDATA< / value > = > basic data
< / prop >

< / prop >
< / value >

< / prop >
< / prop >
< / prop >
< / prop >
< / report >

I want to retrieve the value 88 the TESTDATA found in this node, can someone show me how to recover?

Thank you

Vincent

Published by: pj * April 29, 2011 01:14

Yes, it is possible, but the query will be slightly less effective.

SELECT XMLQuery(
        'for $i in $d/descendant::Value/Prop
         where $i/Prop[@Name="Units"]/Value = $PropValue
         return $i/Prop[@Name="Numeric"]/Value/text()'
         passing t.object_value as "d"
               , sys_xmlgen('TESTDATA') as "PropValue"
         returning content
       ).getNumberVal()
       as result
FROM test_xml t
;

Tags: Database

Similar Questions

  • How to retrieve the values of character without using single quotes

    Hi all

    How to retrieve the values of character without the use of single quotes. Its Possible in Oracle SQL

    Please answer me...

    For example

    Is actual query-> Select * from employees where name like in("SCOTT", "JAMES", "ALBERT",...);

    I want to--> Select * from employees where name like(SCOTT, JAMES, ALBERT...); -without the use of single quotes.

    Why I need this application, I need to retrieve the records more than 200 employees in a select statement by using name in where clause.

    shagarmahabubjan wrote:

    Hi all

    How to retrieve the values of character without the use of single quotes. Its Possible in Oracle SQL

    Please answer me...

    For example

    Actual query is---> Select * from employees where name like in("SCOTT", "JAMES", "ALBERT",...);

    I want to---> Select * from employees where name like(SCOTT, JAMES, ALBERT...); -without the use of single quotes.

    Why I need this application, I need to retrieve the records more than 200 employees in a select statement by using name in where clause.

    In short... you can't.  The channels are channels, and SQL and PL languages dictate that the string literals are provided within single quotes.

    I don't see how trying to retrieve more than 200 records of employees in the select statement means that you must get rid of the quotes.

    Be clear in what you ask: Re: 2. How can I ask a question on the forums?

    and take note of the FAQ link davidp provided the solution "variable IN the list.

  • How to retrieve the selected values of the selectOrderShuttle using ADF 11 g

    Hello world

    Did anyone has idea how to retrieve the selected items by using the shuttle and the order of the elements by using the 'SelectOrderShuttle '?

    Thank you

    valuechangeevent of the shuttle would fire when you shuttle points back.

        public void selectOrderShuttle1_valueChangeListener(ValueChangeEvent valueChangeEvent) {
    
            ArrayList list = new ArrayList(Arrays.asList(valueChangeEvent.getNewValue()));
    
            if (list != null){
                for (int i=0; i
    
  • How to retrieve a value of page element in another page?

    Hello

    How to retrieve a value of page element in another page?

    say P55_COURSES_TO_EVALUATE is my name of the page element, and it is a selection list. Based on the value selected in the next page I see the details of the selected value shd and for that I need P55_COURSES_TO_EVALUATE value in the following page. How to do it? When I try to retrieve the values it simply returns nothing.
    Pointers would be really useful.

    Thanks in advance.

    Hello

    Could you please how you try to use it?

    If you set the value to the P55_COURSES_TO_EVALUATE element and submit the page, the value is stored in session state.
    Then you can use this element in any page as

    :P55_COURSES_TO_EVALUATE
    

    You cannot access page value in javascript/jQuery to other pages like

    $v('P55_COURSES_TO_EVALUATE')
    document.getElementbyID('P55_COURSES_TO_EVALUATE')
    $(#P55_COURSES_TO_EVALUATE)
    

    Because the item is not on the other pages. In javascript from other pages, you can use

    var a = '&P55_COURSES_TO_EVALUATE.';
    

    Kind regards
    Jari

  • LOBs and how to retrieve the record inserted with EMPTY_BLOb()

    Hi guys


    How to retrieve the records inserted with EMPTY_BLOb() instead of NULL value.


    Best greetings
    A.G.

    There must be a better way, but these work:

    SELECT... from tableX where length (lob_column) = 0;
    SELECT... from tableX where dbms_lob.getlength (lob_column) = 0;

    Concerning
    Jonathan Lewis
    http://jonathanlewis.WordPress.com
    http://www.jlcomp.demon.co.UK

    "All experts it is a equal and opposite expert."
    Clarke

  • I sent an email to someone by mistake, how to retrieve the email until the receiver reads?

    I sent an email to someone by mistake, how to retrieve the email until the receiver reads?

    I sent an email to someone by mistake, how to retrieve the email until the receiver reads?

    You can not. It's like putting a letter in a physical mailbox. There is no way to recover it.

  • How to retrieve the network icons and the taskbar sound? They disappeared

    original title: extraction and network icons

    How to retrieve the network icons and the taskbar sound?  They disappear from the notification area of the taskbar.

    Hello

    There are different ways to fix it

    read all the information on the link below

    Try Method 1 or 3

    Method 1. :

    1. right click on the taskbar and click Properties.

    2 tab Area of Notification .

    3 check the (on) or disable (off) the options you want or do not want to display on the Taskbar Notification area

    Method of reading 3 etc. in the link below

    How to enable or disable the Notification area system icons in Vista

    http://www.Vistax64.com/tutorials/106787-notification-area-system-icons.html

  • After the system recovery running following a power outage, my user profile is lost. Unfortunately, he is also the administrator account. How to retrieve the profile or create a new?

    After the system recovery running following a power outage, my user profile is lost.  Unfortunately, he is also the administrator account.  How to retrieve the profile or create a new?

    ·                        Restore point:

    Try typing F8 at startup and in the list of Boot selections, select Mode safe using ARROW top to go there > and then press ENTER.

    Try a restore of the system once, to choose a Restore Point prior to your problem...

    Click Start > programs > Accessories > system tools > system restore > choose another time > next > etc.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    If the above does not work:

    ·                        http://www.Vistax64.com/tutorials/130095-user-profile-service-failed-logon-user-profile-cannot-loaded.html

    See if the information in the above tutorial will help you.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    http://windowshelp.Microsoft.com/Windows/en-AU/help/769495bf-035C-4764-A538-c9b05c22001e1033.mspx

    Difficulty of a corrupted user profile

    After creating the profile, you can copy the files from the existing profile. You must have at least three user accounts on the computer to perform these operations, including the new account that you created.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    http://support.Microsoft.com/kb/947242

    A temporary profile is loaded after you connect to a Windows Vista-based system

    See you soon.

    Mick Murphy - Microsoft partner

  • Lost admin password, how to retrieve the current password to change it?

    I forgot my Admin password, I connect on my laptop using the scanner print finger all the time and when I try to change the password for Admin it ask the password which I do not remember. How to retrieve the current password and change it in Windows 7 Home premium?

    It's a laptop Acer 5738 G

    You can change your current password as follows:

    1. click on start.
    2. type the three letters cmd in the search box.
    3. press on Ctrl + Shift + Enter
    4. click on "run as Administrator".
    5. type the following command and press ENTER after each:
    NET user "user %%nom" 123456

    Now the password is 123456. While dealing with accounts and passwords: having a single admin account on a PC is about the same as having a unique key for your car. What happens if you lose? He lost? Break it? A robust Windows Setup requires at least the following:

    • Two admin accounts fully tested, with their passwords to record on paper.
    • A password key file. Click Start / Help, then search for help on "password". Follow the instructions to create a key on your USB flash drive file so that you'll never find yourself in this uncomfortable situation.
  • retrieve the scene of a node

    Hello
    I have two components that need to "iconize" of the host (such as stage.setIconified) window.
    These nodes are placed in 2 different windows, and the problem is that I can't recover the phase which contains a node.

    Right now, I use a static method in the main class (the one with the start method).

    public static {getStage() scene
    Return globalStage.
    }

    but I think this isn't the best solution.

    Do you know how to solve the problem by taking a scene from a node reference?

    Thank'you!

    Retrieve the scene of a node

    Button btn = new Button();
    Stage st =  (Stage)btn.getScene().getWindow();
    
  • How to get the mobile applications other than phonegap Build Service apk file in Dreamweaver CM³

    How to get the mobile applications other than phonegap Build Service apk file in Dreamweaver CM³

    Dreamweaver is a tool, not an install Android of web authoring tool.

  • search form Web apps: how to retrieve the value of the data-source type field

    Hello

    My question is:

    How can I retrieve the value of the source field of a web - app data-types when you insert the "form web search apps" on a web page.

    I have a web application that contains fields from the data source of the type. These fields to recover the (data) value of the 'web app' - 'elements of the field' field of another web application.

    When I insert the form

    Web apps

    Web apps-search form

    Name of the Web application

    It displays the fields with the field (ie. string, number) types other than type of field 'data source '.

    (Note: in the mode 'model of list' module of data tags, the fields of the data source are visible).

    What other (alternative) possibilities are there to create a search form?

    Thanks for your help.

    Kind regards

    Carla

    By chance, I came up with this workaround. Of course there are other methods to get your data from a web - app, but if you want to use the 'Web apps search form', it would be a workaround.

    I noticed that the "Web apps entry form" contains all the fields of web applications for your web application (including the fields of the data source).

    It is possible to add the fields to the form of the "Web apps entry form" in the «Web apps search form»

    If you insert the "Web apps entry form" on a blank page, you will see all the fields in your web App including the "data source fields. The names of form fields contain something like.

  • How to retrieve the value of a custom field

    Hello @all.

    In my vCenter, I created a custom field 'email '. The value of this field is set to the e-mail address of the operator of that belongs to a virtual machine.

    I would like to retrieve these values in a perl script. But I have found a method to set the values of the custom fields. For example:

    $CustomFieldsManager -> SetField(entity => $_, key=> $emailKey, value => "[email protected]");
    

    What should I do to retrieve the value of the $emailKey key? Could someone provide a quick and dirty-snippet, please?

    Best regards

    Trondesson

    of course, in this discussion https://communities.vmware.com/message/1512863#1512863 you can see how it's done

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

  • How to retrieve the value of the attribute-based

    Hello
    I save our file XML in a clob field.
    The contend of the XML file is as below
    < Reports >
    "< report Type = 'USE' Title = 'USE report' Link="-1-2010-11-2-0-39-48-750 ' UUTResult = 'Fail' StepCount '69' = >
    < prop Name = 'USE' Type = "Obj" TypeName = "USE" Flags = "0 x 0" >
    < prop Name = "Serial number" Type = "String" Flags = "0 x 0" >
    < value > 20302884 < / value >
    < / prop >
    < prop Name = "UUTLoopIndex" Type = "Number" Flags = "0 x 0" >
    < value > 2 < / value >
    < / prop >
    < prop Name = "CriticalFailureStack" Type = "Array" LBound = HBound "[0]" = "[1]" ElementType = "Obj" Flags = "0 x 0" >
    < ArrayElementPrototype Type = "Obj" TypeName = "NI_CriticalFailureStackEntry" Flags = "0 x 0" >
    < prop Name = "StepName" Type = "String" Flags = "0 x 0" >
    < value > < / value >
    < / prop >
    < prop Name = "SequenceName" Type = "String" Flags = "0 x 0" >
    < value > < / value >
    < / prop >
    < prop Name = "SequenceFileName" Type = "String" Flags = "0 x 0" >
    < value > < / value >
    < / prop >
    < prop Name = "Result identifier" Type = "Number" Flags = "0 x 0" >
    < value > 0 < / value >
    < / prop >
    < / ArrayElementPrototype >
    < value ID "[0]" = >
    < prop Type = "Obj" TypeName = "* NI_CriticalFailureStackEntry *" Flags = "0 x 0" > ""
    < prop Name = "StepName" Type = "String" Flags = "0 x 0" >
    < Value >pre-program test< / value >
    < / prop >
    < prop Name = "SequenceName" Type = "String" Flags = "0 x 0" >
    < value > MainSequence < / value >
    < / prop >
    < prop Name = "SequenceFileName" Type = "String" Flags = "0 x 0" >
    < value > Challenger_Phase1.seq < / value >
    < / prop >
    < prop Name = "Result identifier" Type = "Number" Flags = "0 x 0" >
    < value > 368 < / value >
    < / prop >
    < / prop >
    < / value >
    < value ID "[1]" = >
    < prop Type = "Obj" TypeName = "* NI_CriticalFailureStackEntry *" Flags = "0 x 0" > ""
    < prop Name = "StepName" Type = "String" Flags = "0 x 0" >
    < Value >regulator LogicReg< / value >
    < / prop >
    < prop Name = "SequenceName" Type = "String" Flags = "0 x 0" >
    < value > pre-program test < / value >
    < / prop >
    < prop Name = "SequenceFileName" Type = "String" Flags = "0 x 0" >
    < value > Challenger_Phase1.seq < / value >
    < / prop >
    < prop Name = "Result identifier" Type = "Number" Flags = "0 x 0" >
    < value > 371 < / value >
    < / prop >
    < / prop >
    < / value >
    < / prop >
    < / prop >
    < / report >
    < / Reports >



    Can someone guide me how can I retrieve the value of the Prop Name = "StepName", i.e. "Before the program tests" and "LogicReg regulator", which is 1 level under the TypeName = "NI_CriticalFailureStackEntry." I extracted the part of XML code below

    < prop Type = "Obj" TypeName = "NI_CriticalFailureStackEntry" Flags = "0 x 0" >
    < prop Name = "StepName" Type = "String" Flags = "0 x 0" >
    < value > pre-program test < / value >
    < / prop >
    and
    < prop Type = "Obj" TypeName = "NI_CriticalFailureStackEntry" Flags = "0 x 0" >
    < prop Name = "StepName" Type = "String" Flags = "0 x 0" >
    Regulator LogicReg < value > < / value >
    < / prop >


    Thank you

    Vincent

    PJ * wrote:
    I save our file XML in a clob field.

    If you still have the choice, you should consider storing XML data in XMLType column.

    For the moment, assume that the XML data resides in the CLOB SAMPLE_TABLE column. DOC:

    You can use XMLTable to break a sequence of XML elements in columns and relational rows:

    SQL> select x.*
      2  from sample_table t,
      3       xmltable(
      4        '//Prop[@TypeName="NI_CriticalFailureStackEntry"]/Prop[@Name="StepName"]'
      5        passing xmltype(t.doc)
      6        columns num for ordinality,
      7                val varchar2(100) path 'Value'
      8       ) x
      9  ;
    
           NUM VAL
    ---------- -----------------------------------
             1 Pre-program tests
             2 Regulator LogicReg
     
    

    XMLQuery or to extract it as a string:

    SQL> select xmlquery(
      2          'string-join(//Prop[@TypeName="NI_CriticalFailureStackEntry"]/Prop[@Name="StepName"], "|")'
      3          passing xmltype(t.doc)
      4          returning content
      5         ).getstringval() as "RESULT"
      6  from sample_table t
      7  ;
    
    RESULT
    ----------------------------------------------
    Pre-program tests|Regulator LogicReg
     
    

Maybe you are looking for

  • I would like to know how to prevent messages sent to be registered on the SMTP server

    Currently, my Thunderbird client saves a copy of all messages sent to the folder "sent", as expected. All sent messages are also stored on the Server SMTP (G-Mail in this case). To avoid having to delete them manually, I want to warn the outgoing mes

  • Download folder permissions seeds after Time Machine

    I recently restored my downloads folder full of time Machine to the top by car. I HAVE NOT USE TIME MACHINE for THIS... just slip and fall. A LOT of the files/folders have a permissions or problem of blocking or something. When I try to delete them,

  • What is the maximum RAM for each location dimm can support for desktop computers Compaq Presario CQ3541L?

    I have a 32-bit ubuntu 12.04 OS installed on Compaq Presario CQ3541L desktop PC. Now, I want to update higher along 64-bit ubuntu 12.04 OS memory RAM. I want to know what is the maximum size of the main memory that each DIMM DDR3 slot can support. I

  • certificate of graphic driver

    After that upgrade to 8.1 HDMI port has failed.  Followed the instructions to fix the BIOS and graphice driver; HDMI - works however Silverlight no longer works with DMS. Get the 6036 error in Silverlight which is the display device driver certificat

  • HELLP

    I downloaded free a Ppassword protect program [limited trial]. I cannot now get into my external hard drive. help please.