Populating listitem from xml

I am new to Forms but I am having to learn quickly. I need to populate a listitem from XML.
The XML already exists (is response from calling REST web service) and is in a variable.
Is there a simple way of scrolling through this xml file and extracting just the element values e.g. postcode and using these to populate a listitem?
in .net it is very easy, it seems very hard in Oracle :(
the xml is
<?xml version="1.0" encoding="UTF-8"?>
<al_qb_api_response>
<addresses>
<address>
<id>normal:BOGBBDAzYBwMDAQAAmheiAAAAAAAzNABkAA--</id>
<type>normal</type>
<line>34 Collin Avenue, Erith, Kent</line>
<postcode>DA8 1EE</postcode>
</address>
<address>
<id>normal:COGBBDAzYBwMDAQAAn3ZYAAAAAAAzNABkAA--</id>
<type>normal</type>
<line>34 Collin Avenue, Sidcup, Kent</line>
<postcode>DA15 9DW</postcode>
</address>
</addresses>
</al_qb_api_response>
thank you.

in .net it is very easy, it seems very hard in Oracle :(I don't think its so hard in oracle, you simply need some additional steps.
First, build your code to extract the desired information from the xml-file using Java and the JDeveloper. This should be quite similar to the way you do it in .net . Then, build one method on top of that extraction code which returns a string-array (exactly the values you want to assign to your listitem). Then you can use the forms-java-importer to create a PL/SQL-wrapper around this java-class and simply use the resulting code in PL/SQL in forms.

Similar Messages

  • Popup datagrid not populating data from xml

    hey guys,
    im having trouble creating a datagrid within a popup. i
    created the datagrid on a normal panel and everything worked fine.
    then i tried to recreate it within a popup and now im having
    trouble getting the xml data onto the datagrid. i think the problem
    is that the xml is not a variable within the function but ive tried
    multiple methods and i have not gotten it to work.
    whenever it runs it just says TypeError: Error #1009: Cannot
    access a property or method of a null object reference. yet when i
    remove the dg.dataProvider = list.michigan.venue; line the datagrid
    works but there is no data obviously... how do i define the xml
    dataprovider within the function??? also, i need the name of the
    state to be dynamic... how could i make it so that the datagrid
    uses the selected state within the xml file? i imagine i would be
    passing a variable through the function that would be called when i
    select the path within the xml. THX GUYS!
    <venuelist>
    <michigan>
    <venue>
    <name>Location Name</name>
    <address>This is the address</address>
    <city>Detroit</city>
    <state>MI</state>
    <zip>48209</zip>
    <phone>(313)555-5555</phone>
    </venue>
    </michigan>
    <illinois>
    <venue>
    <name>Location Name</name>
    <address>This is the address</address>
    <city>Detroit</city>
    <state>MI</state>
    <zip>48209</zip>
    <phone>(313)555-5555</phone>
    </venue>
    </illinois>
    </venuelist>
    here is the code im using to get the xml file...
    <mx:XML id="list"/>
    <mx:HTTPService id="getXML" url="VenueList/list.xml"
    resultFormat="e4x" result="list = XML(event.result);"/>
    here is the code for the popup
    <mx:Script>
    <![CDATA[
    import mx.controls.dataGridClasses.DataGridColumn;
    import mx.collections.ArrayCollection;
    import mx.containers.Panel;
    import mx.controls.Button;
    import mx.controls.DataGrid;
    import mx.controls.dataGridClasses.DataGridColumn
    import mx.managers.PopUpManager;
    private var panel:Panel;
    private function init():void {
    var dg:DataGrid = new DataGrid();
    var dgc:Array = dg.columns;
    var d1:DataGridColumn = new DataGridColumn;
    var d2:DataGridColumn = new DataGridColumn;
    var d3:DataGridColumn = new DataGridColumn;
    var d4:DataGridColumn = new DataGridColumn;
    var d5:DataGridColumn = new DataGridColumn;
    var d6:DataGridColumn = new DataGridColumn;
    dg.width = 638
    dg.height = 163
    dg.dataProvider = list.michigan.venue;
    d1.width = 150;
    d1.headerText = "Venue Name";
    d1.dataField = "list.michigan.venue.name";
    d2.width = 150;
    d2.headerText = "Address";
    d2.dataField = "address";
    d3.width = 100;
    d3.headerText = "City";
    d3.dataField = "city";
    d4.width = 50;
    d4.headerText = "State";
    d4.dataField = "state";
    d5.width = 50;
    d5.headerText = "Zip";
    d5.dataField = "zip";
    d6.width = 100;
    d6.headerText = "Phone";
    d6.dataField = "phone";
    dgc.push(d1);
    dgc.push(d2);
    dgc.push(d3);
    dgc.push(d4);
    dgc.push(d5);
    dgc.push(d6);
    dg.columns = dgc;
    panel = new Panel();
    panel.title = "Here are our venues:";
    panel.width = 658;
    panel.height = 203;
    panel.addChild(dg);
    private function closePopUp(evt:MouseEvent):void {
    PopUpManager.removePopUp(panel);
    private function createPopUp():void {
    PopUpManager.addPopUp(panel, this, true);
    PopUpManager.centerPopUp(panel);

    hey guys,
    im having trouble creating a datagrid within a popup. i
    created the datagrid on a normal panel and everything worked fine.
    then i tried to recreate it within a popup and now im having
    trouble getting the xml data onto the datagrid. i think the problem
    is that the xml is not a variable within the function but ive tried
    multiple methods and i have not gotten it to work.
    whenever it runs it just says TypeError: Error #1009: Cannot
    access a property or method of a null object reference. yet when i
    remove the dg.dataProvider = list.michigan.venue; line the datagrid
    works but there is no data obviously... how do i define the xml
    dataprovider within the function??? also, i need the name of the
    state to be dynamic... how could i make it so that the datagrid
    uses the selected state within the xml file? i imagine i would be
    passing a variable through the function that would be called when i
    select the path within the xml. THX GUYS!
    <venuelist>
    <michigan>
    <venue>
    <name>Location Name</name>
    <address>This is the address</address>
    <city>Detroit</city>
    <state>MI</state>
    <zip>48209</zip>
    <phone>(313)555-5555</phone>
    </venue>
    </michigan>
    <illinois>
    <venue>
    <name>Location Name</name>
    <address>This is the address</address>
    <city>Detroit</city>
    <state>MI</state>
    <zip>48209</zip>
    <phone>(313)555-5555</phone>
    </venue>
    </illinois>
    </venuelist>
    here is the code im using to get the xml file...
    <mx:XML id="list"/>
    <mx:HTTPService id="getXML" url="VenueList/list.xml"
    resultFormat="e4x" result="list = XML(event.result);"/>
    here is the code for the popup
    <mx:Script>
    <![CDATA[
    import mx.controls.dataGridClasses.DataGridColumn;
    import mx.collections.ArrayCollection;
    import mx.containers.Panel;
    import mx.controls.Button;
    import mx.controls.DataGrid;
    import mx.controls.dataGridClasses.DataGridColumn
    import mx.managers.PopUpManager;
    private var panel:Panel;
    private function init():void {
    var dg:DataGrid = new DataGrid();
    var dgc:Array = dg.columns;
    var d1:DataGridColumn = new DataGridColumn;
    var d2:DataGridColumn = new DataGridColumn;
    var d3:DataGridColumn = new DataGridColumn;
    var d4:DataGridColumn = new DataGridColumn;
    var d5:DataGridColumn = new DataGridColumn;
    var d6:DataGridColumn = new DataGridColumn;
    dg.width = 638
    dg.height = 163
    dg.dataProvider = list.michigan.venue;
    d1.width = 150;
    d1.headerText = "Venue Name";
    d1.dataField = "list.michigan.venue.name";
    d2.width = 150;
    d2.headerText = "Address";
    d2.dataField = "address";
    d3.width = 100;
    d3.headerText = "City";
    d3.dataField = "city";
    d4.width = 50;
    d4.headerText = "State";
    d4.dataField = "state";
    d5.width = 50;
    d5.headerText = "Zip";
    d5.dataField = "zip";
    d6.width = 100;
    d6.headerText = "Phone";
    d6.dataField = "phone";
    dgc.push(d1);
    dgc.push(d2);
    dgc.push(d3);
    dgc.push(d4);
    dgc.push(d5);
    dgc.push(d6);
    dg.columns = dgc;
    panel = new Panel();
    panel.title = "Here are our venues:";
    panel.width = 658;
    panel.height = 203;
    panel.addChild(dg);
    private function closePopUp(evt:MouseEvent):void {
    PopUpManager.removePopUp(panel);
    private function createPopUp():void {
    PopUpManager.addPopUp(panel, this, true);
    PopUpManager.centerPopUp(panel);

  • Reading data From XML file and setting into ViewObject to Pouplate ADF UI

    Hi,
    I have following requirement.
    I would like to read data from XML file and populate the data in ViewObject so that the data can be displayed in the ADF UI.
    Also when user modifies the data in the ADF UI, it should be modified back into to ViewObject.
    Here is an example - XML file contains Book Title and Author. I would like to read Book Title and Author from XML file and set it into ViewObject Attribute and then display Book title and Author in ADF UI page. Also when user modifies Book title and Author, I would like to store it back in View Object.
    Please help me with this requirement and let me know if any solution exist in ADF, for populating the ADF UI screen fields with external XML file data.
    Thanks

    Read chapter 42 http://download.oracle.com/docs/cd/E16162_01/web.1112/e16182/bcadvvo.htm of the fusion developer guide
    Section 42.7, "Reading and Writing XML"
    Section 42.8, "Using Programmatic View Objects for Alternative Data Sources"
    Timo

  • Converting from xml to pdf

    Hi All
    This is Nitin, I have the requirement like this..
    I have xml and want to get pdf report on base of xml file.
    To do this i want to use .NET environment using c# from where i can call the template and supply the xml file and get my report. I am using windows plateform.
    From different sources i got a clue that Adobe Output designer and Certral pro server can solve the problem, but dont know how to proceed, becoz dont have evalution copy of the software.
    In the pdf report i have following requirement:
    - toc (table of content)
    - different types of graph (pie, bar etc)
    - populated from xml
    - different format report has to be generated using a master template depending on xml file and data.
    nitin

    We have started using Adobe Output designer and Central pro server recently to get PDF from XML .So far so good. This software was bought by our company. I have no idea abt the trial version.Contact Adobe/Four Point Solutions
    Silpa

  • Pre-populate PDF from XML data

    I am looking into the feasibility of pre-populating a PDF form using an XML data file. The basic workflow I am investigating is this:
    1. both the PDF form (built in LiveCycle Designer) and XML file would be stored together on a web server.
    2. User would navigate to a web page containing a link to the PDF form, and click to open. The PDF form would open in their browser (using their installed PDF viewer plug in)
    3. the PDF form would be (partially) populated by the data in the XML file automatically
    4. User would fill out the unpopulated portion of the form, and save the resulting PDF to their computer.
    Is this workflow feasible? What are the problem areas? I realize that the the PDF would have to be Reader Extended to allow the user to save it.
    Many thanks for any and all help and direction.
    Matt LL.

    Hi Matt,
    yes, this workflow is perfectly feasible, not really with solely a standard HTTP server though.
    There are a variety of options. The issue is that the process of populating the form can usually not be done without any server-side application of logic.
    - You could use LiveCycle Forms to achieve that. That'd also allow you to use other LC components later on easily , such as Reader Extensions, Process Management or DRM for your documents.
    - You could use Adobe ColdFusion for pre-populating the form from XML, it's super easy (much more straightforward than LC imho). The downside is that CF doesn't have an option to Reader Extend the form for you. That being said, you could get Reader Extensions as a stand-alone module and use it's SOA APIs to hook into your CF code (ColdFusion is basically just an abstraction layer on top of Java).
    Hope that helps to get an idea.
    Cheers
    Kai

  • Want JTree e.g. of populating data from database.

    I want ur JTree example of populating data from database, can u plz give me that eg.?
    Awaiting 4 ur reply.

    Hi,
    AFAIK, there is no direct approach to populate a JTree directly from a resultset. However, JTree can use a DOM tree as its model by using the adapter pattern. The procedure to do this is well-documented in the SUN website and the link is provided below. The code to convert a resultset to XML is provided below:
    protected void resultSetToXML(OutputStream out,
    ResultSet rs,
    String stylesheet)
    throws IOException, ServletException {
    // Create reader and source objects
    SqlXMLReader sxreader = new SqlXMLReader();
    SqlInputSource sis = new SqlInputSource(rs);
    // Create SAX source and StreamResult for transform
    SAXSource source = new SAXSource(sxreader, sis);
    StreamResult result = new StreamResult(out);
    // Perform XSLT transform to get results. If "stylesheet"
    // is NULL, then use identity transform. Otherwise, parse
    // stylesheet and build transformer for it.
    try {
    // Create XSLT transformer
    TransformerFactory tf = TransformerFactory.newInstance();
    Transformer t;
    if (stylesheet == null) {
    t = tf.newTransformer();
    } else {
    // Read XSL stylesheet from app archive and wrap it as
    // a StreamSource. Then use it to construct a transformer.
    InputStream xslstream = _config.getServletContext().
    getResourceAsStream(stylesheet);
    StreamSource xslsource = new StreamSource(xslstream);
    t = tf.newTransformer(xslsource);
    // Do transform
    t.transform(source, result);
    } catch (TransformerException tx) {
    throw new ServletException(tx);
    The classes SQLXMLReader and other classes used in this example are available in the following java packages.
    import java.sql.*;
    import javax.sql.DataSource;
    import javax.xml.parsers.*;
    import javax.xml.transform.*;
    import javax.xml.transform.sax.*;
    import javax.xml.transform.stream.*;
    import org.w3c.dom.*;
    import org.xml.sax.*;
    import org.xml.sax.helpers.AttributesImpl;
    The following is the link that explains how to load a JTree from DOM.
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JAXPDOM6.html
    Cheers,
    vidyut

  • How to generate .java file from xml?

    Does anyone have an idea of how i can generate .java file from xml file? Tools like jakrata digester, JOX are there but both of them are useful in populating java beans from xml. My requirement is to generate .java file from .xml with getters and setters methods for xml elements/attributes. I also tried JAXB. But JAXB generates bunch of files and most of them are interfaces, which is not going to work for me.
    For e.g. i have following xml file and i want to generate Address.java file with getters/setters. Any ideas?
    <?xml version='1.0' encoding='UTF-8' ?>
    <Address>
    <FirstName type="String"/>
    <PoBox type="int"/>
    </Address>
    Thanks,
    Vicky

    Crosspost.
    http://forum.java.sun.com/thread.jsp?thread=475564&forum=4&message=2205846

  • Load Sales Order from Xml file

    Hi,
    I want to load a sales order from xml file. How can I do so? Where I'll get the xml schema for Sales Order or other documents (delivery,invoice etc)?
    Plz reply with code and xml file.

    When I'm going to load SO from xml file, it's showing an error:
    "The connected value 0 was not found in table Uasge of Nota Fiscal".
    What is this table for? Which attribute is related with this table?
    How can I find out that?

  • I want to load a sales order from xml file. How can I do.

    Hi,
    I want to load a sales order from XML  file. How can I do ? how can i create the sales order?
    what are the necessary  setting for  create the sales orders.
    with Regards,
    Prakesh.

    Three options come to my mind.
    Option 1: Use SAP transaction SXDA_TOOLS (Object Type BUS2032), Program Type (BAPI) and Program (CREATEFROMDAT2).
    Option 2: Use SAP transaction SXDA_TOOLS (Object Type BUS2032), Program Type (DINP) and Program (RVINVB10).
    Option 3: Translate the xml to IDoc so that ORDER04 / ORDER05 Idoc can be used to create Sales order (WEDI transaction).

  • Pls Help me with steps to add data from xml file to SAP B1 through B1iSN.

    Pls Help me with steps to add data from xml file to SAP B1 through B1iSN. I  am getting stuck in xsl transformation. not able to understand where the mapping code needs to be added.
    Pls explain me the steps for adding data from xml to B1 quotation step by step.
    thanks and regards
    Priya

    Hi,
    Have you checked this: https://sap.na.pgiconnect.com/p45508295/?launcher=false&fcsContent=true&pbMode=normal ?
    Thanks,
    Gordon

  • How to get string value from xml in JSF??

    In JSF How to get string value from xml, .ini and properties file. I want to get string value from xml or text to JSF

    Just use the appropriate API's for that. There are enough API's out which can read/parse/write XML, ini and properties files. E.g. JAXP or DOM4J for xml files, INI4J for ini files and Sun's own java.util.Properties for propertiesfiles.
    JSF supports properties files as message bundle and resource bundle so that you can use them for error messages and/or localization.

  • Update or delete table from XML

    Is it possible to update or delete table's row from XML file?
    Thanks
    Prasanta De

    Hi Steve,
    Thanks for your reply but I could not find any example from the documentation for update-request or delete-request. I need your help in this regards.
    1. I have emp table with many rows and the simple structure like this
    DEPTNO NUMBER(2)
    EMPNO NUMBER(2)
    EMPNAME VARCHAR2(20)
    EMPSAL NUMBER(8,2)
    Key is defined on deptno and empno
    2. I have a xml file like this
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="1">
    <DEPTNO>1</DEPTNO>
    <EMPNO>11</EMPNO>
    <EMPSAL>1111.11</EMPSAL>
    </ROW>
    <ROW num="2">
    <DEPTNO>1</DEPTNO>
    <EMPNO>12</EMPNO>
    <EMPSAL>2222.22</EMPSAL>
    </ROW>
    <ROW num="3">
    <DEPTNO>1</DEPTNO>
    <EMPNO>13</EMPNO>
    <EMPSAL>3333.33</EMPSAL>
    </ROW>
    </ROWSET>
    3. I want that xsql servlet will read this xml file and update EMPSAL column depending upon the value of DEPTNO and EMPNO from xml file.
    Please let me know how I should use update-request in xsql page.
    Thanks
    Prasanta De
    null

  • Printing on Pre-printed stationary from XML Publisher

    Hi,
    I have a requirement where a report is to be printed on pre-printed stationary from XML Publisher. The stationary would be NCR paper and has to be printed from a dot matrix printer.
    My first question is whether report generated from XMLP can be printed thro'
    dot matrix printer, coz as far as i know it takes only character format .If yes, do we need any special handling?
    If anybody has any experience related to this problem, please let me know the approach.
    Can mail me at [email protected]
    Regards,
    Satrajit

    Hi Milind
    I see what you've got.
    It is not uncommon to use character mode output for pre-printed stationery.
    This would appear as draft output from a Dot Matrix printer. I hope you understand what I mean here. It is somthing like printing using fixed width font.
    Design and run the report with MODE=CHARACTER from the command line.
    You need to figure out and design the layout in such a way that you are printing in the empty spaces provided in the pre-printed stationery. This is usually by trial and error method. You may probably blow several pre-printed stationery sheets before you get it right.
    Regards
    Sripathy

  • How to retrieve data from XML

    I have a scenario where I need to read data from database of xmltype (data type)
    Table Structure :
    Create table Ex_Tb (id number(30),emp_data XMLType );
    I can save xml content in database,
    Sample
    insert into Ex_Tb values( 1, xmltype ('<?xml version="1.0" encoding="UTF-8" ?><userdata><uniqueid>54321</uniqueid><name>moorthi</name><age>25</age><city>Chennai</city></userdata>'));
    Data inserted .
    When retrieved from DB I see the data in the generated BO as given below:
    <?xml version="1.0" encoding="UTF-8" ?>
    <ExteOutputCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/pcbpel/adapter/db/Exte file:/C:/JDeveloper/mywork/Application1/Project1/xsd/Exte.xsd" xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/Exte">
    <ExteOutput>
    <SDD_XML_REQ_DATA_GETCLOBVAL__><?xml version="1.0" encoding="UTF-8" ?><userdata><uniqueid>54321</uniqueid><name>moorthi</name><age>25</age><city>Chennai</city></userdata></SDD_XML_REQ_DATA_GETCLOBVAL__>
    </ExteOutput>
    </ExteOutputCollection>
    My Question :
    1. How to retrive values of individual tags contained within the embedded XML so that it can be mapped to a BO?
    Basically I would like to map uniqueId, name,age,city from xml to a BO.
    Rgds,
    Krishna

    Hi Krishna,
    I'm not sure but are you selecting the data from the XMLType column as given in the section Using XMLType in an SQL Statement in the below doc?
    http://docs.oracle.com/cd/B10500_01/appdev.920/a96620/xdb04cre.htm#1030582
    Regards,
    Neeraj Sehgal

  • How to retrieve image from XML  file

    Hi All,
    I am new to XML. So any best guidance is appreciated.
    The application requirement is to display image retrived from uploaded xml file in file upload section of our application. And store that image in database.
    In my XML file , images & strings & numbers & booleans are there . I am able to save everything in database except images .
    I am using JSF, Seam & Hibernate combination. In my Hibernate entity class i took BLOB datatype for image.
    I am using following tags in my Xhtml file to display image
    <s:graphicImage value="#{hibernateentitybean.picBlobtype}" height="200" width="200">
    <s:transformImageSize width="200" height="200" />
    <s:transformImageType contentType="image/jpeg"/>
    But image is not displayed in Xhtml file
    I am using org.w3c.dom.Document for retrieving node name & corresponding value in that node in XML file.
    I am getting code like below for Image when i am logging all values from XML files in my bean class .
    x0lGQRQAAAABAAAAAAAAAFJHAQARAAAAVwBhAHQAZQByACAAbABpAGwAaQBlAHMALgBqAHAAZwAAAP/Y/+AAEEpGSUYAAQIBAGAAYAAA/+0YLl
    I want to convert this value to image. So i can convert image to bytes and store in BLOB.
    Can anyone guide me ? or any other approach .
    Thanks in advance for any reply.
    Regards,
    Naresh

    Dan_Koldyr wrote:
    agree, it's really odd. Just reread OP and it says:
    NareshDharmiVatsal  wrote:
    want to convert this value to image. In any case it doesn't get worth then another single code line:
    final String cdata = "x0lGQRQAAAABAAAAAAAAAFJHAQARAAAAVwBhAHQAZQByACAAbABpAGwAaQBlAHMALgBqAHAAZwAAAP/Y/+AAEEpGSUYAAQIBAGAAYAAA/+0YLl";
    final sun.misc.BASE64Decoder decoder = new sun.misc.BASE64Decoder();
    final byte[] data = decoder.decodeBuffer(cdata);
    Blob blob = new SerialBlob(data);//or what ever other DB-specific blob implementaiton Did i answered original question? Any more comments to my first replay?I can comment on this latest code. The package sun.misc is private to Sun (Oracle now of course). It is undocumented and may change or be removed altogether in a future release. There is a good free open source Base64 decoder in the Jakarta Commons Codec library.

Maybe you are looking for