How to use XMLTable on XML encoded

I have the case of the external web service providing the response is XML, which contains the XML encoded at the breast.

I would use XMLTable to retrieve the results. I'm familiar with XMLTable, but cannot get to work with mixed coded/non-encoded XML. This returns no data.  If all non-coded, then returns required data. I guess I need to convert somehow, but don't know how to achieve this.

Code snippet below


declare
vResponse XMLType;
begin
vResponse:= XMLTYPE(
'<ValAddrResult>
<Addresses>
<item><Address>&lt;AddressLine1&gt;3 Smith Ct&lt;/AddressLine1&gt;</Address></item>
<item><Address>&lt;AddressLine1&gt;4 Smith Ct&lt;/AddressLine1&gt;</Address></item>
</Addresses>
</ValAddrResult>');

  for c1 in
  (SELECT x.*
    FROM XMLTABLE ('/ValAddrResult/Addresses/item/Address'
                  passing vResponse
                  COLUMNS AddressLine1 VARCHAR2(500) PATH 'AddressLine1') x)
  loop
    dbms_output.put_line(c1.AddressLine1);
  end loop;
end;

Thank you

I guess I need to convert somehow, but don't know how to achieve this.

Exactly.

You first need to extract the XML string encoded in a VARCHAR2/CLOB column (depending on the expected size).

Example below uses a CLOB, but you must be at least on 11.2.0.2 full support.

Then, in a second XMLTABLE, parse the XML string into an XMLType and extract the necessary information:

SQL> set serveroutput on
SQL>
SQL> declare
  2    vResponse XMLType;
  3  begin
  4    vResponse:= XMLTYPE(
  5  '
  6  
  7  
<AddressLine1>3 Smith Ct</AddressLine1>
8
<AddressLine1>4 Smith Ct</AddressLine1>
9
10
'); 11 12 for c1 in ( 13 SELECT x2.* 14 FROM XMLTABLE( 15 '/ValAddrResult/Addresses/item' 16 passing vResponse 17 COLUMNS Address clob PATH 'Address' 18 ) x1 19 , xmltable( 20 '/AddressLine1' 21 passing xmlparse(content x1.address) 22 columns addressline1 varchar2(30) path '.' 23 ) x2 24 ) 25 loop 26 dbms_output.put_line(c1.AddressLine1); 27 end loop; 28 29 end; 30 / 3 Smith Ct 4 Smith Ct PL/SQL procedure successfully completed.

Tags: Database

Similar Questions

  • How to use the query xml in as3

    What follows is the result of the motion preset xml export.

    < motion duration = "1" xmlns="fl.motion. * ' xmlns:geom=" flash.geom. * ' xmlns:filters="flash.filters. * '>

    < source >

      < source frameRate = "24" x="449.5" y="138.55" scaleX="1" scaleY="1" rotation="0" elementType="movie clip" instanceName="ball" symbolName="ball">

    < size >

      < geom: Rectangle left="-51.5" top="-51.5" width="103" height="103"/>

    < / size >

    < transformationPoint >

      < geom: Point x="0.5" y="0.9956310679611651"/>

    < / transformationPoint >

    < / source >

    < / source >

    <Keyframe index="0"/>

    < / movement >


    can someone show me how the as3 in flash script should be to put the motion to my mc "ball" in the fla?

    You cannot use a string.  Use the movieclip, evt.target not evt.target.name.

    (p.s when you use the adobe forums, check useful/correct, if there is.)

  • How to use resource element in the xml file in the workflow?

    Good afternoon

    In my workflow, I put a parameter of the attribute with the element of resource type and the value of the attribute is an xml file.

    And I had a problem with xml files in my workflow, I would like to use the information in the xml file to store in the variable...

    Example: in the xml file, I put some information about the number of VLAN ID, and in my script task, I would like to know how is used with myvariable.portgroup [0].spec.vlanId?

    Best regards.

    Like this:

    var myXml = new XML(resource.getContentAsMimeAttachment().content);
    

    You can then access your nodes like this:

    myXml.node.subnode

    Google for e4X to get the syntax complete.

  • How to use FM OmegaT processed XML files?

    How to convert files in XML (or any other file format that supports the file format that can be used in T Omega) FM so that it can be imported into the translation software open source OmegaT?

    I have a use [Save as] create an XML file, an error message appears when I try to import in Omega T and but I'm unable to translate the file.

    I am trying to use XML files for translation into Omega T, is because in the past, the person who is in charge of editing the file FM would create a text file with sentences to be translated. I would then import the text file in OmegaT to translate and send the text file with the phrases translated to the editor. This could then be edited in a file of FM.

    It would not be a problem if the content to be translated was small. But in some cases there is a large amount of content that must be translated which would take more time to change the FM files.

    What I want to know is if I could use a file format that can be used in Omega T and then be able to convert this file to FM without the Publisher re - edit the file.

    Concerning

    Denjiba-manual

    With regard to the function "Save as XML" in FrameMaker:

    You may know that in FrameMaker, you can work with 'structured' and regular documents.

    When you use "Save as XML" with a document ordinary FM, the resulting XML is simply an output format and are not suitable for reopening in FM. You can translate the XML resulting, but once you return to the FM file, you need to reapply the formatting and the initial numbers back into place. (At least this is what I know of FM8.)

    Otherwise, when you work with an application of structure in FM, you can save documents structured FM in XML format for editing. This means, you can change (translate) the XML document outside FM and open the (translated) XML file published in FM.

    OmegaT regarding:

    I see two ways of translating a document of FM with OmegaT. For both, you will need the Okapi Framework to convert your files into an intermediate format.

    One way requires that your document is a document structured in FM, you can save in XML format for editing. The XML document has probably none of the types of documents that can be translated immediately OmegaT. You can, however, use a utility of the framework of the Okapi to extract translatable text in the XML document in a XLIFF file. Later, you can merge the translated text in the original XML file, which you can bring in FM.

    The other way is similar, but starts with an of FrameMaker MIF file. In this case, regardless of whether or not the document of FM is structured. Of course, there is a MIF Filter for the frame of the Okapi, which allows you to extract the translatable text of MIF in an XLIFF file. Just like above, you can later merge the translated text in the original MIF file. However, the MIF Filter is in beta state, so don't expect it to work perfectly.

    More on the Okapi Framework can be found at http://okapi.opentag.com.

    All that being said, I only played a bit with OmegaT and Okapi. At work, I use an old version of Trados.

    Johannes

  • How can I use FNDLOAD for XML reports and data defnitions

    I program simultaneous registerd bound reports xml and data defnitions in instance of staging and managed to switch to DEV... After updating of this stage and when I download the details of DEV and transferred to the program only simultaneous scene I can download... Can we use the command FNDLOAD for definitions of data or the data model for the XML report, FNDLOAD used for the simultaneous program, he transferred only the details of the program at the same time.

    Hello

    Use XDOLoader.

    Note: 469585.1 - how to use XDOLoader?
    https://metalink2.Oracle.com/MetaLink/PLSQL/ml2_documents.showDocument?p_database_id=not&P_ID=469585.1

    Kind regards
    Hussein

  • How can I obtain the XML

    Hello

    I have not followed the example of XML file and I want to get items from this XML file. How can I get the XML elements?

    Databases
    SQL*Plus: Release 10.2.0.3.0 - Production on Tue Jul 24 17:17:55 2012
     
    Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.
     
     
    Connected to:
    Oracle Database 10g Release 10.2.0.3.0 - 64bit Production
     
    BANNER
    ----------------------------------------------------------------
    Oracle Database 10g Release 10.2.0.3.0 - 64bit Production
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for Linux: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    XML
    <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:skos="http://www.w3.org/2004/02/skos/core#">
      <skos:Concept rdf:about="http://my.site.com/#Acoustics">
        <skos:ID>12033</skos:ID>
        <skos:NO>150</skos:NO>
        <skos:ANO>232</skos:ANO>
        <skos:prefLabel>Acoustics</skos:prefLabel>
        <skos:historyNote>http://www.theiet.org/resources/inspec/</skos:historyNote>
        <skos:altLabel rdf:resource="http://my.site.com/#Sound"/>
        <skos:broader rdf:resource="http://my.site.com/#Physics"/>
        <skos:narrower rdf:resource="http://my.site.com/#Aeroacoustics"/>
        <skos:narrower rdf:resource="http://my.site.com/#Vibrations (Acoustics)"/>
        <skos:narrower rdf:resource="http://my.site.com/#Acoustic materials"/>
        <skos:THES>PHYS</skos:THES>
        <skos:STA>Candidate</skos:STA>
      </skos:Concept>
      <skos:Concept rdf:about="http://my.site.com/#Sound">
        <skos:NO>450</skos:NO>
        <skos:ID>1483636</skos:ID>
        <skos:USE>Acoustics</skos:USE>
      </skos:Concept>
    </rdf:RDF>
    Thanks in advance.

    Published by: 876991 on July 26, 2012 12:02

    However, if I need to include "skos: narrower" elements then what I have to do? I have to write PL/SQL code to this and this information separately? or I can get the items in the recurring SQL query?

    I knew you would ask this, which is why I predicted in my previous answer:

    However, if you want to retrieve recurring nodes such as , you must decide how you want the output to look like (collections nested etc..).

    So, how do you store repetitive items?

    For example, you can use a collection type:

    create type narrower_t is object ( res varchar2(2000) );
    /
    
    create type narrower_coll is table of narrower_t;
    /
    
    select x.ID
         , x.NO
         , cast(
             multiset(
               select res
               from xmltable(
                      xmlnamespaces(
                        'http://www.w3.org/1999/02/22-rdf-syntax-ns#' as "rdf"
                      , 'http://www.w3.org/2004/02/skos/core#' as "skos"
                      )
                    , '/skos:narrower'
                      passing x.narrowers
                      columns res varchar2(2000) path '@rdf:resource'
                    )
             )
             as narrower_coll
           ) as narrowers
    from th_xml t
       , xmltable(
           xmlnamespaces(
             'http://www.w3.org/1999/02/22-rdf-syntax-ns#' as "rdf"
           , 'http://www.w3.org/2004/02/skos/core#' as "skos"
           )
         , '/rdf:RDF/skos:Concept'
           passing t.in_file_1
           columns
             ID         number       path 'skos:ID'
           , NO         number       path 'skos:NO'
           , narrowers  xmltype      path 'skos:narrower'
         ) x
    ;
    
  • How to use the same services-config for servers the and remote.

    My flex project works very well using the bottom but when I download my flash on the server I do not work, all the files and related paths are the same execpt remote is a linux server.

    <? XML version = "1.0" encoding = "UTF-8"? >
    <>services-config
    < services >
    < id = 'amfphp-flashremoting-service' service
    Class = "Flex.Messaging.services.RemotingService"
    messageTypes = "flex.messaging.messages.RemotingMessage' >"

    < destination id = "amfphp" >
    <>channels
    < Ref channel = "my-amfphp" / >
    < / channels >
    Properties of <>
    < source > * < / source >
    < / properties >
    < / destination >
    < / service >
    < / services >
    <>channels
    < channel-definition id = "my-amfphp" class = "mx.messaging.channels.AMFChannel" >
    " < endpoint uri = ' http://localhost/domainn.org/AMFPHP/gateway.php "class="flex.messaging.endpoints.AMFEndpoint"/ > "
    < / channel-definition >
    < / channels >
    < / services-config >

    I think the problem is the line


    " < endpoint uri = ' http://localhost/domainn.org/AMFPHP/gateway.php "class="flex.messaging.endpoints.AMFEndpoint"/ > "

    but I don't know how to use the same services-config for servers the and remote.

    I'll back up a bit.

    Breakpoint URLS are defined as follows in the services - config.xml:

    https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure

    The meaning of each of the tokens is clearer when we see them as part of a complete url. If your context root is set to http://localhost , then I have no idea how your application runs in any environment.

    If you leave the server.name and server.port chips in your configuration file, then they will be replaced when executing according to the location from which your application is served. However, the context.root token is replaced at the time of the compilation based on the value that you specify in Flex Builder or when calling mxmlc.

    In order to reuse your file services - config.xml, you must use the same context-root on your development environment and to your deployment environment.

  • How to use bidirectional I/O in the CLIP of LabVIEW FPGA?

    How to use or define two-way i/o for CLIP with LabVIEW FPGA? I want to use 1-wire communication inside the kernel CLIP, the function will be implemented to read and write as I/O inside the CLAMP.

    The XML Generator (CXG) 1.1.0 ELEMENT does not support.

    Thank you

    Supawat

    Work after separate IB pin (bidirectional) at the entrance and exit. Thank you.

  • How to use the Smart zero 4.4.0 customer service and HP Profile Editor to activate chip cards

    I have a T610 HP Smart Thin Client from scratch and I get zero Smart software to recognize the card chip when connecting. How to use the Smart zero 4.4.0 customer service and HP Profile Editor to activate chip cards. You can configure without the profile HP of the XML editor.

    Mike Sieradzki

    Hello ski_mike.

    Welcome to the HP Forums. I understand that you want to support with your Smart Client zero. However, it is a commercial product. To get assistance, thank you for posting your question on the business Forums HP: HP Enterprise Business Community

    Thank you

    Mario

  • What is microsoft xps document writer and xps Viewer and how to use it?

    What is microsoft xps document writer and xps Viewer and how to use it?

    Original title: xps document writer and Viewer

    Hi arunin,.

    An XPS document is a file that is saved in the XML Paper Specification, or .xps, file format. You can create documents XPS (.xps files) by using any program that you can print from Windows; However, you can only view XPS documents by using an XPS Viewer, such as the one included in this version of Windows.

    See: http://windows.microsoft.com/en-in/windows/what-is-xps-viewer#what-is-xps-viewer=windows-7

    http://Windows.Microsoft.com/en-in/Windows-Vista/print-to-the-Microsoft-XPS-document-writer

  • How to use ListView in ScrollView?

    Hi all:

    I am Novice on BB, recently I met a problem when I want to use several ListView in ScrollView.the code is as follows:

    {Page}

    ScrollView {}

    ID: cscrollView

    scrollViewProperties.scrollMode: ScrollMode.Vertical

    {Of container

    layout: {StackLayout}

    direction: LayoutOrientation.TopToBottom

    }

    background: Color.Black

    {Of container

    {Label

    text: 'NEWS '.

    textStyle.fontSize: FontSize.XLarge

    }

    }

    {Of container

    {Label

    text: 'PlayList '.

    textStyle.fontSize: FontSize.XLarge

    }

    {To ListView

    ID: movieList

    dataModel: {XmlDataModel}

    Source: "models / moviemodel.xml".

    }

    layout: {StackListLayout}

    direction: LayoutOrientation.LeftToRight

    }

    listItemComponents:]

    {ListItemComponent}

    type: "movieitem".

    {MovieItem}

    }

    ]

    }

    }

    {Of container

    {Label

    text: 'Tests '.

    textStyle.fontSize: FontSize.XLarge

    }

    {To ListView

    ID: movieList2

    dataModel: {XmlDataModel}

    Source: "models / moviemodel.xml".

    }

    layout: {StackListLayout}

    direction: LayoutOrientation.LeftToRight

    }

    listItemComponents:]

    {ListItemComponent}

    type: "movieitem".

    {MovieItem}

    }

    ]

    }

    Lable {...}

    }     } }

    But when I run my project, it results that: second ListView and the label below cannot be demonstrated.

    Is that what someone else has had the same problems? I need your help to know how to use the ListView in ScrollView correctly and why this happens? Thank you very much!

    I had this problem myself and not found a solution really good.  If you search the forum, you will find that other people have reported issues similar too.

    According to me, there was some talk of ListView setting its height to match the number of lines it holds.  Until this happens, the best you can do is set the preferredHeight based on the size you want to take up.  I do this in C++, specifying the height depends on the number of lines.

  • How to use log4j in an EJB Module?

    I've included the log4j.jar in libraries;

    log4j.XML added in the sources folder.

    but I m getting an error:

    < 22 April 2014 11:07:50 PKT > < WARNING > < EJB > < BEA-010065 > < MessageDrivenBean threw an Exception in onMessage(). The exception is:

    java.lang.NoClassDefFoundError: org/apache/log4j/recorder.

    java.lang.NoClassDefFoundError: org/apache/log4j/Logger

    during the tests. MyMessageBean.onMessage (MyMessageBean.java:39)

    at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:575)

    at weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:477)

    at weblogic.ejb.container.internal.MDListener.onMessage(MDListener.java:375)

    at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:4855)

    Truncated. check the log file full stacktrace

    Kindly guide me how to solve this problem?
    Thank you!

    Here is the Solution:
    NetBeans - how to use log4j in an EJB Module with WebLogic? -Stack overflow

  • How can I get adobe media encoder?

    How can I get adobe media encoder?

    I want to buy it and use it to make for television equipment mxf files, my 30 day trial period has expired.

    Please help urgently.

    Thank you

    Hello thanks for the answers

    I'll have to install after fx or first or buy the cheaper of the 2... I initially installed encoder just like a standalone.

    Thank you

  • How to use the date with the report parameter format

    Hi all

    How to use the date format with this tag function,

    <? param@begin:P_FROM_DATE? > <? $P_FROM_DATE? >

    This date of form source of report and setting is coming as this 2012/11/01 00:00:00.

    So now I need this in MY-DD-YYYY marker. I tried like this..? param@begin:P_FROM_DATE? > <? $format - date: P_FROM_DATE; ' DD-MON-YYYY '? >

    but its giving error. Can someone pls how to convert to the format of date custom.

    Thanks and greetings
    Srikkanth.M

    Problem solved.

    REF this link

    Date Format of XML

  • How to use the functions of SetValue executeScript activity.

    Hello

    Could someone let me know how to use the function activity setValue (serialize concate, count etc) in activity executeScript. What all liberaries I need to import to executeScript. I want to perform the same task in executeScript performed in the setValue activity.

    Concerning

    Sunil Gupta

    Forgive me if I seem obtuse, but why would you use XPath functions (is that serialize, concat, and count) when there are perfectly good Java alternatives that will be much easier to use.  Java is, after all, the language used in the executeScript.  Serialize is just toString(), CONCATENATE is just + or. concat() (I assume that you are running on Java 6 web application server).  The count function is just the length() or size() methods or to the tables, the length property.  If you really need to reorganize in a variable of the XML data using a XSL stylesheet - you have access to all the functions in XPath 1.0 and XPath 1.0 power and you do not need to tinker with the headache of trying to debug Java in an environment (Workbench), which does not give you the tools that you would normally , as a contextual Editor.

Maybe you are looking for