An example about how to load a XML file

Hi,
I've been working on Oracle for many years but fot the first time I was asked to load a XML file into a table.
As an example, I've found this on the web, but it doesn't work.
Can someone tell me why? I hoped this example could help me.
the file acct.xml is this:
<?xml version="1.0"?>
<ACCOUNT_HEADER_ACK>
<HEADER>
<STATUS_CODE>100</STATUS_CODE>
<STATUS_REMARKS>check</STATUS_REMARKS>
</HEADER>
<DETAILS>
<DETAIL>
<SEGMENT_NUMBER>2</SEGMENT_NUMBER>
<REMARKS>rp polytechnic</REMARKS>
</DETAIL>
<DETAIL>
<SEGMENT_NUMBER>3</SEGMENT_NUMBER>
<REMARKS>rp polytechnic administration</REMARKS>
</DETAIL>
<DETAIL>
<SEGMENT_NUMBER>4</SEGMENT_NUMBER>
<REMARKS>rp polytechnic finance</REMARKS>
</DETAIL>
<DETAIL>
<SEGMENT_NUMBER>5</SEGMENT_NUMBER>
<REMARKS>rp polytechnic logistics</REMARKS>
</DETAIL>
</DETAILS>
<HEADER>
<STATUS_CODE>500</STATUS_CODE>
<STATUS_REMARKS>process exception</STATUS_REMARKS>
</HEADER>
<DETAILS>
<DETAIL>
<SEGMENT_NUMBER>20</SEGMENT_NUMBER>
<REMARKS> base polytechnic</REMARKS>
</DETAIL>
<DETAIL>
<SEGMENT_NUMBER>30</SEGMENT_NUMBER>
</DETAIL>
<DETAIL>
<SEGMENT_NUMBER>40</SEGMENT_NUMBER>
<REMARKS> base polytechnic finance</REMARKS>
</DETAIL>
<DETAIL>
<SEGMENT_NUMBER>50</SEGMENT_NUMBER>
<REMARKS> base polytechnic logistics</REMARKS>
</DETAIL>
</DETAILS>
</ACCOUNT_HEADER_ACK>
For the two tags HEADER and DETAILS I have the table:
create table xxrp_acct_details(
status_code number,
status_remarks varchar2(100),
segment_number number,
remarks varchar2(100)
before I've created a
create directory test_dir as 'c:\esterno'; -- where I have my acct.xml
and after, can you give me a script for loading data by using XMLTABLE?
I've tried this but it doesn't work:
DECLARE
acct_doc xmltype := xmltype( bfilename('TEST_DIR','acct.xml'), nls_charset_id('AL32UTF8') );
BEGIN
insert into xxrp_acct_details (status_code, status_remarks, segment_number, remarks)
select x1.status_code,
        x1.status_remarks,
        x2.segment_number,
        x2.remarks
from xmltable(
  '/ACCOUNT_HEADER_ACK/HEADER'
  passing acct_doc
  columns header_no      for ordinality,
          status_code    number        path 'STATUS_CODE',
          status_remarks varchar2(100) path 'STATUS_REMARKS'
) x1,
xmltable(
  '$d/ACCOUNT_HEADER_ACK/DETAILS[$hn]/DETAIL'
  passing acct_doc as "d",
          x1.header_no as "hn"
  columns segment_number number        path 'SEGMENT_NUMBER',
          remarks        varchar2(100) path 'REMARKS'
) x2
END;
This should allow me to get something like this:
select * from xxrp_acct_details;
Statuscode status remarks segement remarks
100 check 2 rp polytechnic
100 check 3 rp polytechnic administration
100 check 4 rp polytechnic finance
100 check 5 rp polytechnic logistics
500 process exception 20 base polytechnic
500 process exception 30
500 process exception 40 base polytechnic finance
500 process exception 50 base polytechnic logistics
but I get:
Error report:
ORA-06550: line 19, column 11:
PL/SQL: ORA-00932: inconsistent datatypes: expected - got NUMBER
ORA-06550: line 4, column 2:
PL/SQL: SQL Statement ignored
06550. 00000 -  "line %s, column %s:\n%s"
*Cause:    Usually a PL/SQL compilation error.
and if I try to change the script without using the column HEADER_NO o keep track of the header rank inside the document:
DECLARE
acct_doc xmltype := xmltype( bfilename('TEST_DIR','acct.xml'), nls_charset_id('AL32UTF8') );
BEGIN
insert into xxrp_acct_details (status_code, status_remarks, segment_number, remarks)
select x1.status_code,
        x1.status_remarks,
        x2.segment_number,
        x2.remarks
from xmltable(
  '/ACCOUNT_HEADER_ACK/HEADER'
  passing acct_doc
  columns status_code    number        path 'STATUS_CODE',
          status_remarks varchar2(100) path 'STATUS_REMARKS'
) x1,
xmltable(
  '/ACCOUNT_HEADER_ACK/DETAILS'
  passing acct_doc
  columns segment_number number        path 'SEGMENT_NUMBER',
          remarks        varchar2(100) path 'REMARKS'
) x2
END;
I get this message:
Error report:
ORA-19114: error during parsing the XQuery expression: 
ORA-06550: line 1, column 13:
PLS-00201: identifier 'SYS.DBMS_XQUERYINT' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
ORA-06512: at line 4
19114. 00000 -  "error during parsing the XQuery expression: %s"
*Cause:    An error occurred during the parsing of the XQuery expression.
*Action:   Check the detailed error message for the possible causes.
My oracle version is 10gR2 Express Edition
I do need a script for loading xml files into a table as soon as possible
Thanks in advance!

Hello,
Your code is not readable (no code tags).
Anyway, you can use SQL*Loader to load a XML document into a table.
Here is the link of the documentation with both description and an example at the end of the
article.
http://docs.oracle.com/cd/B19306_01/appdev.102/b14259/xdb25loa.htm
Regards,
Dariyoosh

Similar Messages

  • How to load an XML file to oracle9i server?

    I want to use XSU DBMS_XMLsave package to load an XML file to a relational table using PL/SQL from a distant server. Now, I don't know how to load that XML file to the distant server.
    Somebody help me?

    I want to use XSU DBMS_XMLsave package to load an XML file to a relational table using PL/SQL from a distant server. Now, I don't know how to load that XML file to the distant server.
    Somebody help me?

  • How to load a XML file into a table

    Hi,
    I've been working on Oracle for many years but for the first time I was asked to load a XML file into a table.
    As an example, I've found this on the web, but it doesn't work
    Can someone tell me why? I hoped this example could help me.
    the file acct.xml is this:
    <?xml version="1.0"?>
    <ACCOUNT_HEADER_ACK>
    <HEADER>
    <STATUS_CODE>100</STATUS_CODE>
    <STATUS_REMARKS>check</STATUS_REMARKS>
    </HEADER>
    <DETAILS>
    <DETAIL>
    <SEGMENT_NUMBER>2</SEGMENT_NUMBER>
    <REMARKS>rp polytechnic</REMARKS>
    </DETAIL>
    <DETAIL>
    <SEGMENT_NUMBER>3</SEGMENT_NUMBER>
    <REMARKS>rp polytechnic administration</REMARKS>
    </DETAIL>
    <DETAIL>
    <SEGMENT_NUMBER>4</SEGMENT_NUMBER>
    <REMARKS>rp polytechnic finance</REMARKS>
    </DETAIL>
    <DETAIL>
    <SEGMENT_NUMBER>5</SEGMENT_NUMBER>
    <REMARKS>rp polytechnic logistics</REMARKS>
    </DETAIL>
    </DETAILS>
    <HEADER>
    <STATUS_CODE>500</STATUS_CODE>
    <STATUS_REMARKS>process exception</STATUS_REMARKS>
    </HEADER>
    <DETAILS>
    <DETAIL>
    <SEGMENT_NUMBER>20</SEGMENT_NUMBER>
    <REMARKS> base polytechnic</REMARKS>
    </DETAIL>
    <DETAIL>
    <SEGMENT_NUMBER>30</SEGMENT_NUMBER>
    </DETAIL>
    <DETAIL>
    <SEGMENT_NUMBER>40</SEGMENT_NUMBER>
    <REMARKS> base polytechnic finance</REMARKS>
    </DETAIL>
    <DETAIL>
    <SEGMENT_NUMBER>50</SEGMENT_NUMBER>
    <REMARKS> base polytechnic logistics</REMARKS>
    </DETAIL>
    </DETAILS>
    </ACCOUNT_HEADER_ACK>
    For the two tags HEADER and DETAILS I have the table:
    create table xxrp_acct_details(
    status_code number,
    status_remarks varchar2(100),
    segment_number number,
    remarks varchar2(100)
    before I've created a
    create directory test_dir as 'c:\esterno'; -- where I have my acct.xml
    and after, can you give me a script for loading data by using XMLTABLE?
    I've tried this but it doesn't work:
    DECLARE
    acct_doc xmltype := xmltype( bfilename('TEST_DIR','acct.xml'), nls_charset_id('AL32UTF8') );
    BEGIN
    insert into xxrp_acct_details (status_code, status_remarks, segment_number, remarks)
    select x1.status_code,
            x1.status_remarks,
            x2.segment_number,
            x2.remarks
    from xmltable(
      '/ACCOUNT_HEADER_ACK/HEADER'
      passing acct_doc
      columns header_no      for ordinality,
              status_code    number        path 'STATUS_CODE',
              status_remarks varchar2(100) path 'STATUS_REMARKS'
    ) x1,
    xmltable(
      '$d/ACCOUNT_HEADER_ACK/DETAILS[$hn]/DETAIL'
      passing acct_doc as "d",
              x1.header_no as "hn"
      columns segment_number number        path 'SEGMENT_NUMBER',
              remarks        varchar2(100) path 'REMARKS'
    ) x2
    END;
    This should allow me to get something like this:
    select * from xxrp_acct_details;
    Statuscode status remarks segement remarks
    100 check 2 rp polytechnic
    100 check 3 rp polytechnic administration
    100 check 4 rp polytechnic finance
    100 check 5 rp polytechnic logistics
    500 process exception 20 base polytechnic
    500 process exception 30
    500 process exception 40 base polytechnic finance
    500 process exception 50 base polytechnic logistics
    but I get:
    Error report:
    ORA-06550: line 19, column 11:
    PL/SQL: ORA-00932: inconsistent datatypes: expected - got NUMBER
    ORA-06550: line 4, column 2:
    PL/SQL: SQL Statement ignored
    06550. 00000 -  "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    and if I try to change the script without using the column HEADER_NO to keep track of the header rank inside the document:
    DECLARE
    acct_doc xmltype := xmltype( bfilename('TEST_DIR','acct.xml'), nls_charset_id('AL32UTF8') );
    BEGIN
    insert into xxrp_acct_details (status_code, status_remarks, segment_number, remarks)
    select x1.status_code,
            x1.status_remarks,
            x2.segment_number,
            x2.remarks
    from xmltable(
      '/ACCOUNT_HEADER_ACK/HEADER'
      passing acct_doc
      columns status_code    number        path 'STATUS_CODE',
              status_remarks varchar2(100) path 'STATUS_REMARKS'
    ) x1,
    xmltable(
      '/ACCOUNT_HEADER_ACK/DETAILS'
      passing acct_doc
      columns segment_number number        path 'SEGMENT_NUMBER',
              remarks        varchar2(100) path 'REMARKS'
    ) x2
    END;
    I get this message:
    Error report:
    ORA-19114: error during parsing the XQuery expression: 
    ORA-06550: line 1, column 13:
    PLS-00201: identifier 'SYS.DBMS_XQUERYINT' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    ORA-06512: at line 4
    19114. 00000 -  "error during parsing the XQuery expression: %s"
    *Cause:    An error occurred during the parsing of the XQuery expression.
    *Action:   Check the detailed error message for the possible causes.
    My oracle version is 10gR2 Express Edition
    I do need a script for loading xml files into a table as soon as possible, Give me please a simple example for understanding and that works on 10gR2 Express Edition
    Thanks in advance!

    The reason your first SQL statement
    select x1.status_code,
            x1.status_remarks,
            x2.segment_number,
            x2.remarks
    from xmltable(
      '/ACCOUNT_HEADER_ACK/HEADER'
      passing acct_doc
      columns header_no      for ordinality,
              status_code    number        path 'STATUS_CODE',
              status_remarks varchar2(100) path 'STATUS_REMARKS'
    ) x1,
    xmltable(
      '$d/ACCOUNT_HEADER_ACK/DETAILS[$hn]/DETAIL'
      passing acct_doc as "d",
              x1.header_no as "hn"
      columns segment_number number        path 'SEGMENT_NUMBER',
              remarks        varchar2(100) path 'REMARKS'
    ) x2
    returns the error you noticed
    PL/SQL: ORA-00932: inconsistent datatypes: expected - got NUMBER
    is because Oracle is expecting XML to be passed in.  At the moment I forget if it requires a certain format or not, but it is simply expecting the value to be wrapped in simple XML.
    Your query actually runs as is on 11.1 as Oracle changed how that functionality worked when 11.1 was released.  Your query runs slowly, but it does run.
    As you are dealing with groups, is there any way the input XML can be modified to be like
    <ACCOUNT_HEADER_ACK>
    <ACCOUNT_GROUP>
    <HEADER>....</HEADER>
    <DETAILS>....</DETAILS>
    </ACCOUNT_GROUP>
      <ACCOUNT_GROUP>
      <HEADER>....</HEADER>
      <DETAILS>....</DETAILS>
      </ACCOUNT_GROUP>
    </ACCOUNT_HEADER_ACK>
    so that it is easier to associate a HEADER/DETAILS combination?  If so, it would make parsing the XML much easier.
    Assuming the answer is no, here is one hack to accomplish your goal
    select x1.status_code,
            x1.status_remarks,
            x3.segment_number,
            x3.remarks
    from xmltable(
      '/ACCOUNT_HEADER_ACK/HEADER'
      passing acct_doc
      columns header_no      for ordinality,
              status_code    number        path 'STATUS_CODE',
              status_remarks varchar2(100) path 'STATUS_REMARKS'
    ) x1,
    xmltable(
      '$d/ACCOUNT_HEADER_ACK/DETAILS'
      passing acct_doc as "d",
      columns detail_no      for ordinality,
              detail_xml     xmltype       path 'DETAIL'
    ) x2,
    xmltable(
      'DETAIL'
      passing x2.detail_xml
      columns segment_number number        path 'SEGMENT_NUMBER',
              remarks        varchar2(100) path 'REMARKS') x3
    WHERE x1.header_no = x2.detail_no;
    This follows the approach you started with.  Table x1 creates a row for each HEADER node and table x2 creates a row for each DETAILS node.  It assumes there is always a one and only one association between the two.  I use table x3, which is joined to x2, to parse the many DETAIL nodes.  The WHERE clause then joins each header row to the corresponding details row and produces the eight rows you are seeking.
    There is another approach that I know of, and that would be using XQuery within the XMLTable.  It should require using only one XMLTable but I would have to spend some time coming up with that solution and I can't recall whether restrictions exist in 10gR2 Express Edition compared to what can run in 10.2 Enterprise Edition for XQuery.

  • How to load a XML file into a table using PL/SQL

    Hi Guru,
    I have a requirement, that i have to create a procedure or a package in PL/SQL to load  XML file into a table.
    How we can achive this.

    ODI_NewUser wrote:
    Hi Guru,
    I have a requirement, that i have to create a procedure or a package in PL/SQL to load  XML file into a table.
    How we can achive this.
    Not a perfectly framed question. How do you want to load the XML file? Hoping you want to parse the xml file and load it into a table you can do this.
    This is the xml file
    karthick% cat emp_details.xml
    <?xml version="1.0"?>
    <ROWSET>
    <ROW>
      <EMPNO>7782</EMPNO>
      <ENAME>CLARK</ENAME>
      <JOB>MANAGER</JOB>
      <MGR>7839</MGR>
      <HIREDATE>09-JUN-1981</HIREDATE>
      <SAL>2450</SAL>
      <COM>0</COM>
      <DEPTNO>10</DEPTNO>
    </ROW>
    <ROW>
      <EMPNO>7839</EMPNO>
      <ENAME>KING</ENAME>
      <JOB>PRESIDENT</JOB>
      <HIREDATE>17-NOV-1981</HIREDATE>
      <SAL>5000</SAL>
      <COM>0</COM>
      <DEPTNO>10</DEPTNO>
    </ROW>
    </ROWSET>
    You can write a query like this.
    SQL> select *
      2    from xmltable
      3         (
      4            '/ROWSET/ROW'  passing xmltype
      5            (
      6                 bfilename('SDAARBORDIRLOG', 'emp_details.xml')
      7               , nls_charset_id('AL32UTF8')
      8            )
      9            columns empno    number      path 'EMPNO'
    10                  , ename    varchar2(6) path 'ENAME'
    11                  , job      varchar2(9) path 'JOB'
    12                  , mgr      number      path 'MGR'
    13                  , hiredate varchar2(20)path 'HIREDATE'
    14                  , sal      number      path 'SAL'
    15                  , com      number      path 'COM'
    16                  , deptno   number      path 'DEPTNO'
    17         );
         EMPNO ENAME  JOB              MGR HIREDATE                    SAL        COM     DEPTNO
          7782 CLARK  MANAGER         7839 09-JUN-1981                2450          0         10
          7839 KING   PRESIDENT            17-NOV-1981                5000          0         10
    SQL>

  • How to load a XML file into the database

    Hi,
    I've always only loaded data into the database by using SQL-Loader and the data format was Excel or ASCII
    Now I have to load a XML.
    How can I do?
    The company where I work has Oracle vers. 8i (don't laugh, please)
    Thanks in advance!

    Hi,
    Tough job especially if the XML data is complex. The have been some similar question in the forum:
    Using SQL Loader to load an XML File -- use 1 field's data for many records
    SQL Loader to upload XML file
    Hope they help.
    Regards,
    Sujoy

  • How to load the .xml file list from 'C:\Drag_list\Modified' into xmltype tb

    Hi all experts,
    I am in Oracle Enterprise Manager 11g 11.2.0.1.0.
    SQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 22 11:40:23 2011
    is there anyone know why
    SQL> create or replace directory XMLDIR as '/xdb/faq/testdata'
    2 /
    SQL> set long 10000 pages 200 lines 150
    SQL> --
    SQL> select xmltype(bfilename('XMLDIR','2003.xml'),nls_charset_id('AL32UTF8'))
    2 from dual
    worked. but
    SQL> create or replace directory XMLDIR as 'C:\Drag_list\Modified';
    SQL> select xmltype(bfilename('XMLDIR','2011.xml'),nls_charset_id('AL32UTF8'))
    from dual
    did not work?
    IS there any way I can load the .xml file list from 'C:\Drag_list\Modified' into xmltype table?
    Thanks.

    did not work?Generally we'll need a bit more info than "it didn't work", was there an ora-X error message? What was the error?
    Assuming you're on *nix a 'C:\<folder name>\...' directory spec just plain won't work, the directory has to point to a valid storage location on the database server host.
    Try a host command (at the database server) and make sure the .xml file name and location is valid, in sqlplus a "bang" (exclamation) runs a host command, i.e.:
    SQL> !ls -l /xdb/faq/testdata
    ... usr grp ... 2003.xml
    ...But if you are on windows, its the `host` command:
    SQL> host dir c:\drag_list\modified
    mm/dd/yyyy ... 2011.xml
    ...  The create directory ... as ... must point to a valid storage location for it to work, at least that is step one.

  • How to load the .xml file list from 'C:\Drag_list\Modif into xmltype table?

    Hi all experts,
    I am in Oracle Enterprise Manager 11g 11.2.0.1.0.
    SQL*Plus: Release 11.2.0.1.0 Production on Tue Feb 22 11:40:23 2011
    is there anyone know why
    SQL> create or replace directory XMLDIR as '/xdb/faq/testdata'
    2 /
    SQL> set long 10000 pages 200 lines 150
    SQL> --
    SQL> select xmltype(bfilename('XMLDIR','2003.xml'),nls_charset_id('AL32UTF8'))
    2 from dual
    worked. but
    SQL> create or replace directory XMLDIR as 'C:\Drag_list\Modified';
    SQL> select xmltype(bfilename('XMLDIR','2011.xml'),nls_charset_id('AL32UTF8'))
    from dual
    did not work?
    IS there any way I can load the .xml file list from 'C:\Drag_list\Modified' into xmltype table?
    Thanks.
    Edited by: Cow on Apr 13, 2011 12:58 AM

    This is a question better suited for the sql and pl/sql support forum, since it is NOT an APEX based question..: PL/SQL
    Thank you,
    Tony Miller
    Webster, TX
    On the road of life...There are 'windshields', and there are 'bugs'
    (splat!)
    "Squeegees Wanted"
    If this question is answered, please mark the thread as closed and assign points where earned..

  • How to load the XML file to BW3.5

    Hi Gurus,
    i am following the steps for extracting the data from XML to 3.5 following the steps in the HOWTOSENDXMLDATATOBW.doc. i have a doubt at the 22 nd Point where in the document given that jump to point 26 for 3.5 version. But where we need to specify the path of the XML file. Used the Tcode WSADMIN to test the Webservices, but i am unable to load the delta due to the above problem. what are the steps i need to follow in WSADMIN. We are using SOAPservice in BW.
    Please help me for finding the soluction for XML loading of the delta data to BW.
    Thanks,
    James
    Message was edited by:
            james winslet

    Hi,
    I am sending you a link that will provide you with some good idea on XML File Uploading....
    How to upload XML flat file
    Hope this helpful... award points
    regards,
    raj
    Message was edited by:
            gangaraju mullapudi

  • How to load a xml file from a package inside of a jar file

    hi@all
    my application has got a xml configuration file which is saved inside the package tree of the class that reads this file.
    when i`m developing using eclipse the class can find that file, everything works fine. but when i create a jar file of my application to use it in another application it cannot find that file anymore.
    can anyone tell me how to solve this problem, please?
    thx a lot
    dialsc

    hi all,
    the xml file is in the jar file and
    ClassLoader.getSystemResourceAsStream(..) solved my problem.
    in fact i did nameOfClassInSamePackageAsXmlFile.class.getResourceAsStream("nameOfFile.xml");thank you all
    greez
    dialsc

  • Loading an XML File in an Application!

    Hy Guys!
    I'm quite new on Java, so I'm missing some important knowledge, for example: how to load an XML file in an Application downloaded by Java WebStart:
    In Details:
    I'm downloading an Application which needs an XML File for setting up an Legend. As far as I know, the XMLParser needs a File as argument to parse. By Java WebStart/jnlp, I can't download the XML-File to the local machine, and trying to create an instance by the url (as String), doesn't work. So now I'm missing some information, and I hope you can help me:
    Is there a possiblility to download the XML file via the application explicitly,
    or is there a possibility to "convert" the ResourceInputStream into a "parseable" class?
    I'm happy for every suggestion ..
    some code:
    public class EvalXML extends org.xml.sax.helpers.DefaultHandler {
    /** Creates a new instance of EvalXML */
    public EvalXML() {
    * @param args the command line arguments
    public static int main(String[] args) {
    DefaultHandler handler = new EvalXML();
    SAXParserFactory factory = SAXParserFactory.newInstance();
    String url = new String();
    //String url = EvalXML.class.getClassLoader().getResource("com/msgis/res/Lcc_Test_XML_Addressen.xml").getPath();
    //String url= "msgis.jar!/com/msgis/res/Lcc_Test_XML_Addressen.xml";
    if (args[0] + "empty" != "empty") url = args[0];
    else{
    System.out.println("no argument");
    return 0;
    System.out.println("PATH: \n" + url + "\n");
    try{
    SAXParser saxParser = factory.newSAXParser();
    //saxParser.parse(new File(EvalXML.class.getClassLoader().getResource("com/msgis/res/Lcc_Test_XML_Addressen.xml").getPath()), handler);
    saxParser.parse(new File(url), handler);
    System.out.println("pascht");
    catch(Throwable t){
    System.out.println(t.getMessage());
    return 1;
    regards dominik

    Although nobody wrote back, it is the quality of a forum depends on soluted problems so:
    the following function loads the file from the server to the box:
    public boolean loadResource(String pURL){
    DownloadService ds;
    URL lURL;
    boolean lLoaded = true;
    try{
    lURL = new URL(pURL);
    try {
    ds = (DownloadService)ServiceManager.lookup("javax.jnlp.DownloadService");
    } catch (UnavailableServiceException e) {
    ds = null;
    lLoaded = false;
    if (ds != null) {
    try {
    // determine if a particular resource is cached
    //URL url = new URL("http://java.sun.com/products/javawebstart/lib/draw.jar");
    boolean cached = ds.isResourceCached(lURL, "1.0");
    // remove the resource from the cache
    if (cached) {
    ds.removeResource(lURL, "1.0");
    // reload the resource into the cache
    DownloadServiceListener dsl = ds.getDefaultProgressWindow();
    ds.loadResource(lURL, "1.0", dsl);
    } catch (Exception e) {
    e.printStackTrace();
    lLoaded = false;
    catch(MalformedURLException mue)
    System.out.println(mue.getMessage());
    lLoaded =false;
    return lLoaded;
    dominik

  • How to read a xml file in ActionScript

    In mxml we can find <mx:Model> to load a xml and using
    it easily. But in ActionScript, there is no such a Class about this
    function(only implemented in mxml), so how to load a xml file in a
    easy way in ActionScript?
    And I tried using HTTPService, but I think that is not the
    best solution because the code do not know when the hander get the
    data in xml then the function return that value.
    So please someone give a easy way as <mx:model> in mxml
    to read the xml file?
    Thank you very much.

    Flex is asynchronous so HTTPService with result event handler
    is the way to go.

  • Runtime loading of XML file off a ComboBox selection

    I need to load an XML file at runtime based on a ComboBox
    selection that has the XML file path as its data.
    I figured out how to load an XML file at runtime by defining
    an HTTPService
    <mx:HTTPService id="stocksXML" url="xml/StockList.xml"
    resultFormat="e4x"/>
    and setting the <mx:Application
    creationComplete="stocksXML.send();"
    But when I now try to set the HTTPService url dynamically in
    the ComboBox change event handler
    private function loadData_changeHandler(event:ListEvent):void
    stocksXML.url = event.target.selectedItem.path;
    stocksXML.send();
    no data gets retrieved and the stocksXML.lastResult is null.
    What am I missing here? Why doesn't that work?
    Thanks in advance for any pointers

    I suggest adding a resultHandler to the HTTPService and check
    the results there. Also add a faultHandler so that you will know
    what the error was.

  • How to transfer a xml file?

    Dear friends,
    I have a question about how to transfer a xml file between server and client using axis or weblogic.
    My application needs to send xml files instead of primitive data types and bean objects.
    Is it possible to tranfer files between server and client?
    thank you very much for your great help!
    jayanandan.

    hi,
    There are two ways in which u can send an xml file.
    1) U send it along with the body of the soap message.
    2)u can send it as an attachment in the soap envelope. this method u can use for any type of files.
    If u send it in soap body the it will take more time for the processing of the soap body.so attachment is the best way.
    I case of any queries please feel free to post it in the forum
    Regards
    Sandy

  • Can you tell me How to loading sessions.xml in servlet

    Can you tell me How to loading sessions.xml in servlet

    Getting a session in a servlet is no different than in any other environment except that you need to be careful which classloader you pass to the SessionManager and correctly configure what to do if your application is reloaded. If you use the oracle.toplink.util.SessionFactory introduced in 10.1.3.1 you don't have to worry about these details--it uses the correct settings. The SessionFactory greatly simplifies the code required to get a session or unit of work. It's well documented in the SessionFactory javadoc.
    If you do use SessionFactory beware there is a bug when running in a JTA environment and there's no transaction started. Doug posted a work around in his blog[1].
    --Shaun
    [1] http://www.jroller.com/page/djclarke/20060412

  • How to load 2 xml galleries in single function loop.

    how to load 2 xml galleries in single function loop.
    my function is--------
    var myGalleryXML = new XML();
    myGalleryXML.ignoreWhite = true;
    myGalleryXML.load("gallery.xml");
    function callThumbs()
        _root.createEmptyMovieClip("wall",_root.getNextHighestDepth());
        wall._x = _root.gallery_x;
        wall._y = _root.gallery_y;
        wall.addEventListener(MouseEvent.CLICK);
        var clipLoader = new MovieClipLoader();
        var preloader = new Object();
        clipLoader.addListener(preloader);
            for (i =0; i <6; i++)
            thumbURL = myImages[i].attributes.thumb_url;
            myThumb_mc = wall.createEmptyMovieClip(i, wall.getNextHighestDepth());
            myThumb_mc._x = _root.thumb_height * i;
            myThumb_mc._x = _root.thumb_position = -3100 + (i-j) * 765;
       clipLoader.loadClip("shop/" + thumbURL,myThumb_mc);  // i want to load this  by xml gallery "gallery1.xml"
    preloader.onLoadStart = function(target)
                target.createTextField("my_txt",target.getNextHighestDepth(),0,0,10,10);
                target.my_txt.selectable = false;
            preloader.onLoadProgress = function(target, loadedBytes, totalBytes)
                target.my_txt.text = Math.floor((loadedBytes / totalBytes) * 100);
            preloader.onLoadComplete = function(target)
                new Tween(target, "_alpha", Strong.easeOut, 0, 100, .5, true);
                target.my_txt.removeTextField();
                target.onRelease = function()
                    callFullImage(this._name);
                target.onRollOver = function()
                    this._alpha = 100;
                target.onRollOut = function()
                    this._alpha = 100;
        for (i = 0; i < 6; i++)
            thumbURL = myImages[i].attributes.thumb_url;
            myThumb_mc = wall.createEmptyMovieClip(i, wall.getNextHighestDepth());
            myThumb_mc._x = _root.thumb_height * i;
            myThumb_mc._x = _root.thumb_position = -7210 + (i-j) * 765;
            myThumb_mc._y = _root.thumb_position = 180;
            clipLoader.loadClip("banner/" + thumbURL,myThumb_mc);  // i want to load this  by xml gallery "gallery2.xml"
            preloader.onLoadStart = function(target)
                target.createTextField("my_txt",target.getNextHighestDepth(),0,0,10,10);
                target.my_txt.selectable = false;
            preloader.onLoadProgress = function(target, loadedBytes, totalBytes)
                target.my_txt.text = Math.floor((loadedBytes / totalBytes) * 100);
            preloader.onLoadComplete = function(target)
                new Tween(target, "_alpha", Strong.easeOut, 0, 100, .5, true);
                target.my_txt.removeTextField();
                target.onRelease = function()
                    callFullImage(this._name);
                target.onRollOver = function()
                    this._alpha = 100;
                target.onRollOut = function()
                    this._alpha = 100;

    combine the two xml files into one if you want to create one gallery.
    if you want two different galleries that display at different times, remove the movieclip wall after you're done with gallery1 and execute myGalleryXML.load("gallery2.xml");

Maybe you are looking for

  • Ipod won't sync with itunes, wiped itself, won't leave apple logo screen

    I think the problem showed up after I plugged my ipod classic into a Belkin (I think) ipod speaker dock. The next time I plugged it into my computer, it wouldn't sync with itunes. When there's no ipod plugged into the computer, itunes opens fine, but

  • Problem in Building CAF project

    Hi All, I have imported an external service and wrapped it in an entity service. Whilie buiding th project i am getting the following error: "The project was not built since its classpath is incomplete. cannot find the class file for com.sap.caf.core

  • Alert Modeler in IC Winclient

    Hi all, I am configuring the alert modeler in IC WinClient in CRM 5.0. I have created a Alert modeler profile assigned it to the IC WinClient profile. And i am able to trigger the events defined the profile. My problem is that i am unable to use the

  • Why is my video in iPhoto

    I have a Iphone C5 and i was filming with the camera and the video is in iphoto. Plus, how do i pause, fast forward and rewind my video in iphoto?

  • S10-3t bios 24CN25WW Wireless

    hi, i installed update bios 24cn25ww , and now hardware switch for wireless not work, even LED not light. Fn+F5 not work, neither in QS or windows 7 who not install this, please give me backup file of your bios, thx backup of 24cn19ww maybe be good