Reading XML using java

Hi all
To read XML document is:

< customer name = 'A' >
FA1 < FileToBeProcessed > < / FileToBeProcessed >
FA2 < FileToBeProcessed > < / FileToBeProcessed >
SA3 < FileToBeProcessed > < / FileToBeProcessed >
< / customer >

< customer name = "B" >
FB1 < FileToBeProcessed > < / FileToBeProcessed >
FB2 < FileToBeProcessed > < / FileToBeProcessed >
FB3 < FileToBeProcessed > < / FileToBeProcessed >
< / customer >


I want to get all the names of files to be treated by A client in an array of java. How can I read and search in this type of xml file using java?

If this is then can not the correct way of writing in xml you suggest other alternative and corresponding Java solutions to read this kind of xml format?

Thanks in advance... :-)

Take a look at javax.xml.xpath. Very suitable for this type of application.

Tags: Java

Similar Questions

  • Nested reading XML using XQUERY in the PL/SQL procedure

    I'm using Oracle 11 G.
    I have a PL/SQL procedure, which is reading XML using xquery XMLTYPE column in a table. The XML contains data of the DEPARTMENT and its SECTIONS. DEPARTMENT has a to-many with SECTIONS or a DEPARTMENT can have one or more SECTIONS, and there may be cases where the DEPARTMENT will have all SECTIONS.

    The XML structure is such that
    <DATA>
    label to identify a DEPARTMENT and all its corresponding SECTIONS.

    XML
    <ROWSET> 
    <DATA>
     <DEPARTMENT>
      <DEPARTMENT_ID>DEP1</DEPARTMENT_ID>
      <DEPARTMENT_NAME>myDEPARTMENT1</DEPARTMENT_NAME>
     </DEPARTMENT>
     <SECTIONS>
      <SECTIONS_ID>6390135666643567</SECTIONS_ID>
      <SECTIONS_NAME>mySection1</SECTIONS_NAME>
      </SECTIONS>
       <SECTIONS>
      <SECTIONS_ID>6390135666643567</SECTIONS_ID>
      <SECTIONS_NAME>mySection2</SECTIONS_NAME>
      </SECTIONS>
     </DATA>
     <DATA>
     <DEPARTMENT>
      <DEPARTMENT_ID>DEP2</DEPARTMENT_ID>
      <DEPARTMENT_NAME>myDEPARTMENT2</DEPARTMENT_NAME>
     </DEPARTMENT>
     <SECTIONS>
      <SECTIONS_ID>63902</SECTIONS_ID>
      <SECTIONS_NAME>mySection1</SECTIONS_NAME>
      </SECTIONS>
     </DATA>
    </ROWSET>
    XQUERY
    select
     department_id,
      department_name,
      sections_id,
      sections_name
    from
      OFFLINE_XML xml_list,
      xmltable(
        '
          for $department in $param/ROWSET/DATA
            return $department
        '
        passing xml_list.xml_file as "param"
        columns
          "DEPARTMENT_ID"   varchar2(100) path '//DEPARTMENT/DEPARTMENT_ID',
          "DEPARTMENT_NAME" varchar2(4000) path '//DEPARTMENT/DEPARTMENT_NAME',
          "SECTIONS_ID"     varchar2(100) path '//SECTIONS/SECTIONS_ID',
          "SECTIONS_NAME"   varchar2(4000) path '//SECTIONS/SECTIONS_NAME'
      ) section_list
    where
      xml_list.Status = 5
    The performance of the query, you receive an error
    ORA-19279: XPTY0004 - XQuery dynamic type mismatch: expected singleton 
    sequence - got multi-item sequence
    It is natural because I have several sections, now how I'll handle this situation.

    It's the usual approach to manage several nested collections:

    SQL> select d.department_id
      2       , d.department_name
      3       , s.sections_id
      4       , s.sections_name
      5  from offline_xml t
      6     , xmltable(
      7         '/ROWSET/DATA'
      8         passing t.xml_file
      9         columns
     10           DEPARTMENT_ID   varchar2(20) path 'DEPARTMENT/DEPARTMENT_ID'
     11         , DEPARTMENT_NAME varchar2(30) path 'DEPARTMENT/DEPARTMENT_NAME'
     12         , SECTIONS        xmltype      path 'SECTIONS'
     13       ) d
     14     , xmltable(
     15         '/SECTIONS'
     16         passing d.sections
     17         columns
     18           SECTIONS_ID     varchar2(20) path 'SECTIONS_ID'
     19         , SECTIONS_NAME   varchar2(30) path 'SECTIONS_NAME'
     20      ) s
     21  ;
    
    DEPARTMENT_ID        DEPARTMENT_NAME                SECTIONS_ID          SECTIONS_NAME
    -------------------- ------------------------------ -------------------- ------------------------------
    DEP1                 myDEPARTMENT1                  6390135666643567     mySection1
    DEP1                 myDEPARTMENT1                  6390135666643567     mySection2
    DEP2                 myDEPARTMENT2                  63902                mySection1
     
    
  • Reading XML using XSLT data

    I have a problem of reading xml using XSLT data. There is a CASE - 900000016, has two sequences. SEQ NO1 and NO2 SEQ. Each sequence has an activity. I try to display the info of the activity under corresponding sequences.

    SEQ 01

    Activity

    SEQ 02

    Activity

    This is the xml file.

    <? XML version = "1.0" encoding = "utf-8" standalone = "yes"? >
    < case >
    < EventList >
    < PAEvent >
    < CASENO > 900000016 < / CASENO >
    < > 01 SEQ_NO < / SEQ_NO >
    APPROVED < STATUS > < / STATUS >
    < REASON > < / REASON >
    < PR_NO > 506024 < / PR_NO >
    < SRV_BEG_DAT > 11/02/2010 < / SRV_BEG_DAT >
    < SRV_END_DAT > 11/02/2010 < / SRV_END_DAT >
    < / PAEvent >
    < PAEvent >
    < CASENO > 900000016 < / CASENO >
    < > 02 SEQ_NO < / SEQ_NO >
    APPROVED < STATUS > < / STATUS >
    < TYPE > < / TYPE >
    < REASON > < / REASON >
    < PR_NO > < / PR_NO >
    < SRV_BEG_DAT > 11/02/2010 < / SRV_BEG_DAT >
    < SRV_END_DAT > 28/02/2010 < / SRV_END_DAT >
    < / PAEvent >
    false < hasErrors > < / hasErrors >
    < / EventList >
    < ActivitiesList >
    < PAActivity >
    < CASE_NO > 900000016 < / CASE_NO >
    < > 01 SEQNO < / SEQNO >
    < ACTVTY_LN_NO > 03 < / ACTVTY_LN_NO >
    < ACTVTY_TYP >: < / ACTVTY_TYP >
    < UNIT_PRC > 16.2500 < / UNIT_PRC >
    < / PAActivity >
    < PAActivity >
    < CASE_NO > 900000016 < / CASE_NO >
    < > 02 SEQNO < / SEQNO >
    < ACTVTY_LN_NO > 01 < / ACTVTY_LN_NO >
    < ACTVTY_TYP > P < / ACTVTY_TYP >
    < UNIT_PRC > 0.0000 < / UNIT_PRC >
    < / PAActivity >
    false < hasErrors > < / hasErrors >
    < / ActivitiesList >
    < / Cases >


    XSLT code

    <? XML version = "1.0" encoding = "utf-8"? >
    < xsl: stylesheet version = "1.0" xmlns: xsl = "http://www.w3.org/1999/XSL/Transform" >
    < xsl: template match = "Case" >
    < div Id = "dvEvents" align = "center" >
    <!--list of events-->
    < table width = "75%" border = "0" >
    < style tr = "text-align: left;" background-color: gray; ">
    < td colspan = "8" class = "SmallBlackFontBolder" >
    < b > < /b > events
    < table >
    < /tr >
    < xsl: for-each select = "EventList/PAEvent" >
    < b >
    < class td = "SmallBlackFontBold" style = "" text-align: left; "width ="8% "> Seq No.: < table >"
    < class td = "SmallGreenFontBold" align = "left" width = "10%" >
    < xsl: value-of select = "SEQ_NO" / >
    < table >

    < class td = "SmallBlackFontBold" align = "left" width = "8%" > status: < table >
    < td align = "left" width = "11%" >
    < xsl: value-of select = "STATUS" / >
    < table >
    < /tr >

    < b >
    < td >
    <!--get the list of activities-->
    < xsl: for-each select = "Case/ActivitiesList/PAActivity" >
    < xsl: if test = "Case, EventList, PAEvent, SEQ_NO = case, ActivitiesList, PAActivity, SEQNO" >
    < table width = "75%" >
    < b >
    < class td = "SmallBlackFontBold" style = "" text-align: left; "width ="8% "> Seq No.: < table >"
    < class td = "SmallGreenFontBold" align = "left" width = "10%" >
    < xsl: value-of select = "Case, ActivitiesList, PAActivity, SEQNO" / >
    < table >
    Unit price < td >: < table >
    < td align = "left" width = "11%" >
    < xsl: value-of select = "Case, ActivitiesList, PAActivity, UNIT_PRC" / >
    < table >
    < /tr >
    < /table >
    < / xsl: if >
    < / xsl: foreach >
    <!--get the list of activities-->
    < table >
    < /tr >

    < b >
    < class td = "SmallBlackFontBold" align = "left" width = "8%" > reason: < table >
    < td align = "left" width = "20%" >
    < xsl: value-of select = "PAEvent/EventList/reason" / >
    < table >
    < td > < table >
    < td > < table >
    < class td = "SmallBlackFontBold" align = "left" width = "14%" > PR_NO: < table >
    < td align = "left" width = "18%" >
    < xsl: value-of select = "PAEvent/EventList/PR_NO" / >
    < table >
    < /tr >

    < / xsl: foreach >
    < /table >

    < / div >
    < / xsl: template >
    < / xsl: stylesheet >

    Published by: 837989 on April 25, 2013 14:13
  • Problem in the evaluation of the XPath in xml using java.

    Hello

    I wrote a method to evaluate the xpath expression and returns the result in the string 'true' or 'false' or 'anyValue as in the xpath expression.

    for example:

    < k >
    < g > 1 / < g >
    < c >! / < c >
    < /k >
    < k >
    < g > 2 / < g >
    < c > # </c >
    < /k >

    < k >
    $ < c >/< c >
    < /k >

    If the xpath expression is /k [g / text () = '1'] / c/text () = "#"-the code returns false

    Similarly /k [g / text () = '1'] / c/text () ='! ' - returns true

    But in the flow of my project, we have removed the xml node that contains no data. Thus, the last < k > tag is not have < g >. then, East - wat I think

    If the xpath expression is /k [g / text () = "] / c / text () = ' $' should return true. but since there is no < g > tag, it returns false. But, by the logic of my project, g is there, but the bcz removed its null...

    Pls help me with this...

    Thank you
    Sabarisri. N

    Edited by: Sabarisri N November 11, 2011 16:33

    Edited by: Sabarisri N November 11, 2011 16:35

    The criteria for the return of true or false is not clear as the three bodies that are specific. To take account of these three cases, the xpath expression can be very restrictive in look like that. By way of illustration, I put it in a knot xsl or xsl: When, use tests, assuming the context node to be the parent of the node k.

    
    

    Because the conditions are specific, it seems inevitably awkward due to the need of the enumeration of the case-by-case basis.

  • Reading an XML file and write the content in another file xml in java

    Hello

    I'm new to xml parsing. My requirement is that I get a message (xml) using ibm MQ in the ByteArrayInputStream format. I read this xml message and write to another file.

    To do this, I create a CEP.

    First of all, I used simple reading and writing concept, but the output is "java.io.FileInputStream@3e25a5".
    Example of xml file
    -< customer >
    < > 1234 ClientId < / ClientId >
    STechnology < ClientName > < / ClientName >
    < DTU_ID > 567 < / DTU_ID >
    < ClientStatus > ACTIVE < / ClientStatus >
    -< LEAccount >
    < Customer > 678989 < / customer >
    < > 56743 LEId < / LEId >
    -< account >
    < AccountNumber > 9876543678 < / account number >
    < / account >
    < / LEAccount >
    -< Service >
    Y2Y < Cindicator > < / Cindicator >
    < PrefCode > 980 < / PrefCode >
    < BSCode > 876 < / BSCode >
    < MandatoryContent > MSP < / MandatoryContent >
    < / service >
    < / customer >

    Code:


    import java.io.ByteArrayInputStream;
    import java.io.FileInputStream;
    to import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;

    public class ByteArrayInputStreamToXml {}

    Public Shared Sub main (String [] GIS) throws IOException {}

    InputStream inputStream = new FileInputStream("C:\\soft\\test2\\sample1.xml");
    currentXMLBytes Byte = inputStream.toString () .getBytes ();
    ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream (currentXMLBytes);

    OutputStream out = new FileOutputStream("C:\\soft\\test\\data.xml");
    int read = 0;
    ubyte bytes [] = new byte [1024];

    While ((read = byteArrayInputStream.read (bytes))! = - 1) {}
    out. Write (bytes, 0, read);
    out. Write ("\n");
    }

    inputStream.close ();
    out. Flush();
    out. Close();

    System.out.println ("new file created!");

    }

    }

    Please suggest me how can I use DOM/SAX parser, I see several code on the net to read the xml file using SAX/DOM parser, but write an xml file after reading using ByteArrayInputStream I don't get. Assistance through some link examples will also be useful for me.

    Thank you
    Sumit

    Published by: user8687839 on April 30, 2012 02:37

    Published by: user8687839 on April 30, 2012 02:43

    user8687839 wrote:
    But the file is coming thanks to a queue and byte format. Must read the byte, and write to a file. So, how I tried to read the byte using the code above. Please suggest me the correct way.

    Simply write the bytes of the contents of the queue directly to a FileOutputStream. Still no need to SAX or DOM!

    Pseudo-code-

    Open a FileOutputStream .
    
    Until all the bytes of the queue have been read
        read some bytes from the queue.
        wite these bytes to the FileOutputStream.
    
    Close the FileOutputStream.
    

    Published by: sabre150 on April 30, 2012 11:30

  • How to remove xml xmlns using java

    Hello


    < DLList xmlns = "http://www.test.com/integration/feed" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" >
    < weather >
    Karnataka < StateName > < / StateName >
    < ForecastName > Bagalkote < / ForecastName >
    < > 89.9 humidity < / humidity >
    < / weather >
    < weather >
    Karnataka < StateName > < / StateName >
    < ForecastName > Devengiri < / ForecastName >
    < > 89.9 humidity < / humidity >
    < / weather >
    < / DLList >

    The above xml code must be decomposed using xsu. I am facing a problem because the XML contains namespaces.
    How to remove namespace using java to get the xml below
    Note: I use XSLT for transformation. The tag XSLT is not to identify the < DLList > tag with namespace

    < DLList >
    < weather >
    Karnataka < StateName > < / StateName >
    < ForecastName > Bagalkote < / ForecastName >
    < > 89.9 humidity < / humidity >
    < / weather >
    < weather >
    Karnataka < StateName > < / StateName >
    < ForecastName > Devengiri < / ForecastName >
    < > 89.9 humidity < / humidity >
    < / weather >
    < / DLList >

    Help, please. Let me know if any other information is required
    Thank you

    Hello

    Here is a small test case that works with xsu12:

    test_xsu.XML:

    
    
    Karnataka
    Bagalkote
    89.9
    
    
    Karnataka
    Devengiri
    89.9
    
    
    

    test_xsu.xsl:

    
    
      
        
          
        
      
      
        
          
            
          
          
            
          
          
            
          
        
      
    
    

    Java class Test_xsu:

    import java.io.*;
    import oracle.xml.sql.dml.*;
    import java.sql.*;
    import oracle.jdbc.*;
    
    public class test_xsu
    {
      public static void entry()
      throws SQLException, FileNotFoundException
      {
       int rowCount;
    
       Connection conn = DriverManager.getConnection("jdbc:default:connection:");
       OracleXMLSave save = new OracleXMLSave(conn, "TEST_XSU");
    
       Reader xsltReader = new FileReader(new File("c:\\ora11\\test\\test_xsu.xsl"));
       Reader xmlReader = new FileReader(new File("c:\\ora11\\test\\test_xsu.xml"));
    
       save.setXSLT(xsltReader, null);
       save.setRowTag("Weather");
    
       rowCount = save.insertXML(xmlReader);
    
       save.close();
    
      }
    }
    

    For personal reasons, I call the class through a java stored procedure directly from the database (which shouldn't make a difference):

    SQL> create table test_xsu
      2  (
      3   state varchar2(30),
      4   district_name varchar2(30),
      5   humidity number
      6  );
    
    Table created
    
    SQL>
    SQL> create procedure p_test_xsu
      2  as language java name 'test_xsu.entry()';
      3  /
    
    Procedure created
    
    SQL> exec p_test_xsu;
    
    PL/SQL procedure successfully completed
    
    SQL> select * from test_xsu;
    
    STATE                          DISTRICT_NAME                    HUMIDITY
    ------------------------------ ------------------------------ ----------
    Karnataka                      Bagalkote                            89,9
    Karnataka                      Devengiri                            89,9
     
    
  • Is it possible to create a new file using the XML via java Script?

    Hello everyone,

    Is it possible to create a new file using the XML via java Script

    • I have xml information that need to use for file name, size.
    • Based on xml file we can create a new file in InDesign with java script?
    • Kindly help me if anyone has an idea about this.

    I use InDesign CS4 on windows 7

    Sample file is attached below.

    Kind regards

    Siva

    <UpdateAd>
    <AdId>3403699</AdId>
    <Width type="mm">91,79</Width>
    <Height type="mm">80,00</Height>
    <ProductionCategory>4</ProductionCategory>
    <BookedCCIColors>sw</BookedCCIColors>
    <WorkFlowType>PDF</WorkFlowType>
    <CustomerNumber>652224</CustomerNumber>
    <CustName1>Erich Prang</CustName1>
    <Description/>
    <Description2>R</Description2>
    <UpdateIns>
    <Titel>RHZ</Titel>
    <Publication>B2</Publication>
    <RunDate>26-07-2011</RunDate>
    <Zone>H30</Zone>
    <KDDATEN>nein</KDDATEN>
    </UpdateIns>
    <WorkflowStep>IR</WorkflowStep>
    <Proof>No</Proof>
    </UpdateAd>
    
    

    xml.png

    Try this:

    var f =File.openDialog ();
    f.open('r');
    var xml = new XML(f.read());
    f.close();
    
    var myDocument = app.documents.add();
    myDocument.documentPreferences.pageHeight = xml..Height+"mm";
    myDocument.documentPreferences.pageWidth = xml..Width+"mm";
    var rect = myDocument.pages[0].rectangles,add();
    rect.geometricBounds = myDocument.pages[0].bounds;
    rect.strokeAlignment = StrokeAlignment.INSIDE_ALIGNMENT;
    rect.strokeColor = myDocument.swatches.item("Black");
    rect.strokeWeight = 1;
    myDocument.save(File(f.path + "/" + xml..AdId + ".indd"))
    

    Substances

  • Reading XML clob field

    Hi guys

    I want to read XML file that is stored as a clob in the database table (test_clob) in column (xml_file).

    <?xml version="1.0" encoding="UTF-8"?>
    <!--Sample XML file generated by xmlspy.com)-->
    <mslv-sa:orEvent xmlns:mslv-sa="http://www.metav.com/oss/Sctivation/2003" xmlns:tls="http://www.meolv.com/oss/Sctivation/2003" xmlns:co="http://java.sun.com/products/oss/xml/Common" xmlns:sa="http://java.sun.com/products/oss/xml/Sivation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <co:applicationDN/>
         <co:eventTime>2006-07-17T03:21:13</co:eventTime>
         <sa:currentState>closed.completed</sa:currentState>
         <sa:orderKey>
              <co:applicationDN/>
              <co:type/>
              <sa:primaryKey>SUAUG20_1ADSLCON-268554296-JOB-ISPSERVICE23</sa:primaryKey>
         </sa:orderKey>
         <sa:reason/>
         <mslv-sa:externalSystemId/>
         <mslv-sa:eventId>36</mslv-sa:eventId>
         <mslv-sa:eventStatus>1</mslv-sa:eventStatus>
         <mslv-sa:except>N</mslv-sa:except>
         <mslv-sa:rollbackExcept>N</mslv-sa:rollbackExcept>
         <mslv-sa:services>
              <mslv-sa:item>
                   <mslv-sa:serviceKey>
                        <co:applicationContext>
                             <co:factoryClass/>
                             <co:url/>
                             <co:systemProperties/>
                        </co:applicationContext>
                        <co:applicationDN/>
                        <co:type>ACT_POSTPAID</co:type>
                        <sa:primaryKey>aitorc01_5100719489001</sa:primaryKey>
                        <mslv-sa:serviceSequenceNumber>1</mslv-sa:serviceSequenceNumber>
                   </mslv-sa:serviceKey>
                   <mslv-sa:serviceState>active.completed</mslv-sa:serviceState>
              </mslv-sa:item>
         </mslv-sa:services>
    </mslv-sa:orderCompleteEvent>
    I use the following query just to read data from the file.
    select x.time
    FROM test_clob
            ,XMLTABLE('/mslv-sa:orderCompleteEvent/co:applicationDN/' 
                  PASSING XMLTYPE(test_clob.xml_file)
                  COLUMNS time VARCHAR2(100)PATH '/mslv-sa:orderCompleteEvent/mslv-sa:orderCompleteEvent/co:eventTime')x
    But its giving following error
    21:22:53  LPX-00801: XQuery syntax error at 'EOF'
    21:22:53  1   /mslv-sa:orderCompleteEvent/co:applicationDN/
    Please provide details


    See you soon

    Sexy

    Hi Vanessa,

    I see several issues here.

    -L' example of XML document you gave is not well-formed.
    -Some XPath expressions are false, i.e. they address anything in the document.
    -You must also declare the namespaces that you use in XMLTable.

    Assuming that the root element is actually "mslv - its: orderCompleteEvent", it should be better:

    SELECT x.eventtime
    FROM test_clob t
       , XMLTable(
           XMLNamespaces(
             'http://www.metav.com/oss/Sctivation/2003' as "mslv-sa"
           , 'http://java.sun.com/products/oss/xml/Common' as "co"
           )
         , '/mslv-sa:orderCompleteEvent'
           PASSING XMLTYPE(t.xml_file)
           COLUMNS eventtime timestamp PATH 'co:eventTime'
         ) x
    ;
    
  • You say don't not to use Java, but when I remove it, I just can't see vedios and things don't work properly. So, if I cancel Java I use.i

    Explain to us whether to use Java. ? If she isent safe for our games and coupons and videos that which must be loaded on the computer to make these things work. ? Damed if we do and damed if we do not have. People who are not computer and get older, how do you know how. We need 1 2 3 4 steps. After I update you, I started getting pop ups, especially since a Web Guard, I tried to take off and fought with him for 1 1/2. My computer wouldn't work. I have Avast security and when these security companies we safe. And these cleaner companies, other things, try to take over the computer. If you pay or you pay not it's the same, everyone wants to take control of your computer. I don't have a TV, my computer is important to me. And then the computer when I try to enter read something special on an e-mail, it begins to roll said empty in the box and just keeps circling. Unfortunate I need free things to download to help me and then the things I try something underhanded coming on the tail and destroy my computer. Not in the position to hire Nerds to fix.

    The Java security problems is Java Deployment Toolkit.
    Not all Java programs.

    Java downloads for all operating systems

  • Thunderbird attempts to use Java to open attachments in pdf.

    I have the add-on for Adobe Reader in Thunderbird. I also checked to use the file extension to open the attachment. But whenever I try to open a .pdf attachment, TBird tries to open it as a Java file. The only way I can open a pdf attachment is to use Internet Explorer.

    I am not ware of any player from adobe for Thunderbird addon. There is a plugin for Adobe Reader for use with the Firefox browser.

    Adobe Reader is a free software to view and print PDF documents.
    It includes a plugin for browser Adobe Acrobat to view PDF documents in Firefox and other Web browsers.

    Tools > Options > Annexes > Incoming tab

    Under 'Content Type' you see:

    • «Adobe Acrobat document (application/pdf: .pdf)»

    is what action set?

    • Click the set Action to see a drop down menu and select Adobe Reader
    • Click Ok to save the changes.

    If it does not appear:

    • In Thunderbird,.
    • Select the e-mail with attachment pdf
    • Right-click on the attachment and choose open.
    • A small window will open asking what to do with the file.
    • Choose "Open with" and select "Adobe Reader"
    • Select this option to "do this automatically for files like this in the future"
    • Click OK
  • I really need professional help in the analysis of XML to the XML Document, or I want to read XML

    Hi all

    I'm really looking for your sweet help. I have suffered for two days. I'm working on Blackberry java app. I have the xml file is located in "file:///store/home/user/myNotes.xml".

    I want to be able to parse the XML into XMLDocument to confront the NodeList and ChildNode.

    I always get Eception Exception RunTimeError

    NOTE the following prayer:

    1 - my JDK is 1.7.0.5.5 (SE) only

    2. I don't have "XMLSerializer" or "Transformer", or "TransformerFactory', 'KXML.

    3. all I want is just to be able to read XML above and analyzed to XMLDocument.

    Find my Java code below:

    =====================================================================================

    Private Sub parseXmlFile() raises {RuntimeException
    try {}

    XMLDocument DOM = null;
    private static final String fileN = "file:///store/home/user/myNotes.xml";
    FileConnection fc = (FileConnection) Connector.open (fileN);
    fc.openDataInputStream ();
    DocumentBuilderFactory plant = DocumentBuilderFactory.newInstance ();
    DocumentBuilder builder = factory.newDocumentBuilder ();
    InputStream is = getClass () .getResourceAsStream (fileN);
    DOM = builder.parse (is);
        
    } catch (Exception pce) {}
    Dialog.Alert (PCE. ToString());
    }
            
    }

    ======================================================================

    End of my Code

    Thank you very much for your time of reading and you answer to help me.

    I appreciate really.

    Dear all,

    Hello and thank you from the bottom of my heart. This works. My problem was absent "normalization."

    Thank you once again I ng3epa enjoyed your valuable contribution.

  • Help parsing XML (XMLParseDemo.java)

    Hello world

    I'm trying to parse the XML code in my application. Here's a sample of what I'm trying to analyze:

    
    
      http://api.netflix.com/catalog/titles/autocomplete?{-join|&|term}
      
        
      
      
        
      
      
        
      
      
        
      
    
    

    For the parser, I use the XMLDemoScreen.java that is provided in the JDE samples. What I'm trying to do is to analyze all of theitem. However, when I run the application, my output is as follows:<p class="help"> <pre> autocomplete url_template = <a href="http://api.netflix.com/catalog/titles/autocomplete?{-join" rel="external nofollow noreferrer">http://api.netflix.com/catalog/titles/autocomplete?{-join</a>|&|term}" autocomplete_item title autocomplete_item title autocomplete_item title autocomplete_item title </pre> <p class="help">So, that's the impression not the values of "title". Anyone know why? Is it because the element contains<title short="">?<p class="help"> <p class="help">Thanks for your help. Here is the code that I use (which can be found in the JDE samples):</p> <pre> /* * XMLDemoScreen.java * * Copyright © 1998-2009 Research In Motion Ltd. * * Note: For the sake of simplicity, this sample application may not leverage * resource bundles and resource strings. However, it is STRONGLY recommended * that application developers make use of the localization features available * within the BlackBerry development platform to ensure a seamless application * experience across a variety of languages and geographies. For more information * on localizing your application, please refer to the BlackBerry Java Development * Environment Development Guide associated with this release. */ package com.kflicks.xml; import java.io.InputStream; import net.rim.device.api.ui.component.*; import net.rim.device.api.ui.container.MainScreen; import net.rim.device.api.xml.parsers.*; import org.w3c.dom.*; /** * The main screen for the application. Displays the results of parsing the XML * file. */ /* package */public final class XMLDemoScreen extends MainScreen { // Constants // ----------------------------------------------------------------------------------- private static final int _tab = 4; InputStream input; /** * This constructor parses the XML file into a W3C DOM document, and * displays it on the screen. * * @see Document * @see DocumentBuilder * @see DocumentBuilderFactory */ public XMLDemoScreen(InputStream input) { setTitle(new LabelField("XML Demo")); this.input = input; try { // Build a document based on the XML file. DocumentBuilderFactory factory = DocumentBuilderFactory .newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); Document document = builder.parse(input); // Normalize the root element of the XML document. This ensures that // all Text // nodes under the root node are put into a "normal" form, which // means that // there are neither adjacent Text nodes nor empty Text nodes in the // document. // See Node.normalize(). Element rootElement = document.getDocumentElement(); rootElement.normalize(); // Display the root node and all its descendant nodes, which covers // the entire // document. displayNode(rootElement, 0); } catch (Exception e) { System.out.println(e.toString()); } } /** * Displays a node at a specified depth, as well as all its descendants. * * @param node * The node to display. * @param depth * The depth of this node in the document tree. */ private void displayNode(Node node, int depth) { // Because we can inspect the XML file, we know that it contains only // XML elements // and text, so this algorithm is written specifically to handle these // cases. // A real-world application will be more robust, and will handle all // node types. // See the entire list in org.w3c.dom.Node. // The XML file is laid out such that each Element node will either have // one Text // node child (e.g. <Element>Text</Element>), or >= 1 children // consisting of at // least one Element node, and possibly some Text nodes. Start by // figuring out // what kind of node we're dealing with. if (node.getNodeType() == Node.ELEMENT_NODE) { StringBuffer buffer = new StringBuffer(); indentStringBuffer(buffer, depth); NodeList childNodes = node.getChildNodes(); int numChildren = childNodes.getLength(); Node firstChild = childNodes.item(0); // If the node has only one child and that child is a Text node, // then it's of // the form <Element>Text</Element>, so print 'Element = "Text"'. if (numChildren == 1 && firstChild.getNodeType() == Node.TEXT_NODE) { buffer.append(node.getNodeName()).append(" = \"").append( firstChild.getNodeValue()).append('"'); add(new RichTextField(buffer.toString())); } else { // The node either has > 1 children, or it has at least one // Element node child. // Either way, its children have to be visited. Print the name // of the element // and recurse. buffer.append(node.getNodeName()); add(new RichTextField(buffer.toString())); // Recursively visit all this node's children. for (int i = 0; i < numChildren; ++i) { displayNode(childNodes.item(i), depth + 1); } } } else { // Node is not an Element node, so we know it is a Text node. Make // sure it is // not an "empty" Text node (normalize() doesn't consider a Text // node consisting // of only newlines and spaces to be "empty"). If it is not empty, // print it. String nodeValue = node.getNodeValue(); if (nodeValue.trim().length() != 0) { StringBuffer buffer = new StringBuffer(); indentStringBuffer(buffer, depth); buffer.append('"').append(nodeValue).append('"'); add(new RichTextField(buffer.toString())); } } } /** * Adds leading spaces to the provided string buffer according to the depth * of the node it represents. * * @param buffer * The string buffer to add leading spaces to. * @param depth * The depth of the node the string buffer represents. */ private static void indentStringBuffer(StringBuffer buffer, int depth) { int indent = depth * _tab; for (int i = 0; i < indent; ++i) { buffer.append(' '); } } } </pre> <p class="help">Thank you!</p> <p class="reply">You should get properly "title" attributes of node via</p> <p class="reply">NamedNodeMap attributes = node.getAttributes ();</p> <p class="reply">iterate through the mapping of attributes to retrieve the values you want.</p>

  • Best way to Parse XML using Dreamweaver CC 2015.3

    I was on a wild goose chase - trying to figure out how to parse XML using DW CC

    every article I read, says something about XML & XSLT, but it is no longer available in the new CC - I read about using jQuery or php, but have not yet find a resource to learn specifically "using DW CC.

    I'm willing to learn how to parse XML with DW CC but I would get a definitive direction to go before I'm trying to learn something that adobe will put in 'end of life '.

    advice or links to resources that can parse XML DW CC 2015 would be LARGELY APPRECIATED, thank you

    x 126 has written:

    What I'm asking is...

    1. What is the best procedure to insert XML into a page using DW CC 2015 as my editor?
    a. what happened to spry? b. what happened to XSLT?

    As Nancy explained, Spry has been abandoned by Adobe, a few years ago.

    XSLT server behavior has been removed at the same time as other server behaviors Dreamweaver CC. The problem with most of the PHP server behaviors was that they were based on code that has been removed from PHP 7. The XSLT server behavior didn't rely on these features, but it was not the most friendly of server behaviors. XSLT is a complex language that is to be avoided when parsing XML unless you really know what you're doing.

    The easiest way to manipulate XML in Dreamweaver should use PHP SimpleXML. I've linked to the samples page in the PHP online documentation. Believe me, it's much easier than trying to do battle with XSLT. If you have a subscription to lynda.com, you can learn more about SimpleXML to my operational with SimpleXMLclass.

  • Send a mail using java in oracle 11 g

    I using database 11 g...

    I created a procedure to send a mail using java... as below

    [code]

    CREATE OR REPLACE AND COMPILE JAVA NAMED "SendAttach" AS SOURCES

    import java.util.Properties;

    Javax.mail import. *;

    Javax.mail.internet import. *;

    Javax.activation import. *;

    public class SendAttach {}

    Public Shared Sub sendmail (recipient String, object, String, String msg, String file)

    {

    String host = "smtp.gmail.com; »

    " the end user String = ' [email protected] '; change accordingly

    final String password = "psd"; changes accordingly

    String to = recipient; changes accordingly

    Properties props = new Properties ();

    props.put ("mail.smtp.host", "smtp.gmail.com");

    props.put ("mail.smtp.socketFactory.port", "465");

    props.put ("mail.smtp.socketFactory.class",

    "javax.net.ssl.SSLSocketFactory");

    props.put ("mail.smtp.auth", "true");

    props.put ("mail.smtp.port", "465");

    A session = Session.getDefaultInstance (accessories,

    new javax.mail.Authenticator () {}

    protected PasswordAuthentication getPasswordAuthentication() {}

    return new PasswordAuthentication (user, password);

    }

    });

    try {}

    MimeMessage message = new MimeMessage (session);

    message.setFrom (new InternetAddress (user));

    message.addRecipient (Message.RecipientType.TO, new InternetAddress (to));

    message.setSubject (subject);

    BodyPart messageBodyPart1 = new MimeBodyPart();  newly added

    messageBodyPart1.setText (msg);  newly added

    message.setText (msg);

    MimeBodyPart messageBodyPart = new MimeBodyPart();

    Several multipart part = new MimeMultipart();

    messageBodyPart = new MimeBodyPart();

    String file1 = file;

    String fileName = "sql";

    Data source source = new FileDataSource (file1);

    messageBodyPart.setDataHandler (new DataHandler (source));

    messageBodyPart.setFileName (fileName);

    multipart.addBodyPart (messageBodyPart);

    multipart.addBodyPart (messageBodyPart1);

    message.setContent (multipart);

    Transport.Send (message);

    System.out.println ("message sent successfully...");

    } catch (MessagingException e) {e.printStackTrace () ;}

    }

    }

    /

    It works finw with sysdba login.

    But it gives below error when I connected as user (ori) my username

    prs.png

    Help me to solve the problem...

    Thank you all for the response guys...

    Finally, I have soluion...

    Please follow these steps. If you want to do the same thing

    step 1: connect sysdba virtue

    step 2:grant the bottom of the permissions for the database

    • Call dbms_java.grant_permission ('ORI',
    • ("java.util.PropertyPermission ',' * ',"read, write");
    • run dbms_java.grant_permission('ORI','java.util.PropertyPermission','*','read').
    • run dbms_java.grant_permission ("ORI", 'SYS:java.lang.RuntimePermission', 'getClassLoader', ' ');
    • run dbms_java.grant_permission ("ORI", 'SYS:oracle.aurora.security.JServerPermission', 'Check', ' ');
    • run dbms_java.grant_permission ("ORI", 'SYS:java.lang.RuntimePermission', 'accessClassInPackage.sun.util.calendar', ' ');   run dbms_java.grant_permission ("ORI", 'java.net.SocketPermission', ' *', ' connect, solve ");
    • run dbms_java.grant_permission ("ORI", 'SYS:java.lang.RuntimePermission', 'createClassLoader', ' ');

    Note: replace ORI with your user_name DB

    Step 3: Download 2 jar files jaf - 1.1.1 and javamail - 1.1.1.jar oracle community network

    Step 4: Unzip these two files in sphecific folder.so you can find two jar files activation.jar and mail.jar

    step 5:now open the command prompt in the path where the files two jar are placed in and loading these two pots in DB using below command

    loadjava-user U_name/PSD - solve - synonym mail.jar

    loadjava-user U_name/PSD - solve - synonym activation.jar

    step 6:now run your java process

    [code]

    CREATE OR REPLACE AND COMPILE JAVA NAMED "SendAttach" AS SOURCES

    import java.util.Properties;

    Javax.mail import. *;

    Javax.mail.internet import. *;

    Javax.activation import. *;

    public class SendAttach {}

    Public Shared Sub sendmail (recipient String, object, String, String msg, String file)

    {

    String host = "smtp.gmail.com; »

    the final String user = "mail_id"; changes accordingly

    final String password = 'email_password '; changes accordingly

    String to = recipient; changes accordingly

    Retrieve the session object

    Properties props = new Properties ();

    props.put ("mail.smtp.host", "smtp.gmail.com");

    props.put ("mail.smtp.socketFactory.port", "465");

    props.put ("mail.smtp.socketFactory.class",

    "javax.net.ssl.SSLSocketFactory");

    props.put ("mail.smtp.auth", "true");

    props.put ("mail.smtp.port", "465");

    A session = Session.getDefaultInstance (accessories,

    new javax.mail.Authenticator () {}

    protected PasswordAuthentication getPasswordAuthentication() {}

    return new PasswordAuthentication (user, password);

    }

    });

    Compose the message

    try {}

    MimeMessage message = new MimeMessage (session);

    message.setFrom (new InternetAddress (user));

    message.addRecipient (Message.RecipientType.TO, new InternetAddress (to));

    message.setSubject (subject);

    BodyPart messageBodyPart1 = new MimeBodyPart();  newly added

    messageBodyPart1.setText (msg);  newly added

    message.setText (msg);

    MimeBodyPart messageBodyPart = new MimeBodyPart();

    Several multipart part = new MimeMultipart();

    messageBodyPart = new MimeBodyPart();

    String file1 = file;

    String fileName = "sql";

    Data source source = new FileDataSource (file1);

    messageBodyPart.setDataHandler (new DataHandler (source));

    messageBodyPart.setFileName (fileName);

    multipart.addBodyPart (messageBodyPart);

    multipart.addBodyPart (messageBodyPart1);

    message.setContent (multipart);

    Send the message

    Transport.sendMessage (message, to);

    Transport.Send (message);

    System.out.println ("message sent successfully...");

    } catch (MessagingException e) {e.printStackTrace () ;}

    }

    }

    /

    step 7:

    CREATE or REPLACE procedure NAME of JAVA LANGUAGE AS Send_Attach (container VARCHAR, subject VARCHAR, msg VARCHAR, leader VARCHAR) "SendAttach.sendmail (java.lang.String, java.lang.String, java.lang.String, java.lang.String);

    /

    step 8: say commit.

    step 9:

    Declare

    beneficiary varchar (50): = "recipient_id";

    subject varchar (100): = "Hello";

    MSG varchar (500): = 'this is a test mail with an attachment;

    varchar (100) file: = "path of the file";                   file path - weed

    Begin

    dbms_java.grant_permission('ORI','java.) IO. FilePermission ', leader,' read');

    Send_Attach (container, Subject, MSG, file);

    End;

    [\commit]

    Note: disable windows firewall and anti virus before phone emails

    keep smiling...

  • ORA-03113 "reading" XML of CLOB

    Hello

    I use XMLTable for reading XML to insert data into the DB table. I have:

    PROCEDURE IMPORT_XML)

    p_plik VARCHAR2,

    p_tp_id NUMBER,

    number of p_commit_po: = 500) IS

    l_blob_id TERYT_PLIKI.tp_blob_id%type;

    l_blob BLOB;

    XMLTYpe l_teryt_xml;

    L_Name varchar2 (100);

    l_type varchar2 (100);

    l_date varchar2 (100);

    -l_part varchar2 (100);

    XMLType l_rows;

    l_commit number (6);

    l_cnt_rows NUMBER: = 0;

    procedure do_commit is

    Start

    l_commit: = l_commit + 1;

    l_cnt_rows: = l_cnt_rows + 1;

    If l_commit > = p_commit_po then

    commit;

    l_commit: = 0;

    end if;

    end do_commit;

    BEGIN

    -# variable l_BLOB contains BLOB from a column of table #.

    Err.d ("convert BLOB CLOB type...', 'IMPORT_XML', 70 ');

    declare

    dest_lob CLOB.

    src_lob BLOB;

    the sum integer: = DBMS_LOB. LOBMAXSIZE;

    dest_offset integer: = 1;

    offset integer: = 1;

    number of blob_csid: = nls_charset_id ('AL32UTF8');

    lang_context integer: = 0;

    the warning integer: = DBMS_LOB. WARN_INCONVERTIBLE_CHAR;

    Start

    dest_lob: = empty_Clob();

    DBMS_LOB. CREATETEMPORARY (dest_lob, false);

    DBMS_LOB. OPEN (dest_lob, DBMS_LOB. LOB_READWRITE);

    DBMS_LOB. OPEN (l_blob, DBMS_LOB. LOB_READONLY);

    DBMS_LOB. () CONVERTTOCLOB

    dest_lob,

    l_blob,

    amount,

    dest_offset,

    offset,

    blob_csid,

    lang_context,

    (caveat);

    DBMS_LOB. Close (l_blob);

    l_teryt_xml: = XMLType (dest_lob);

    commit;

    DBMS_LOB. FREETEMPORARY (dest_lob);

    end;

    l_rows: = l_teryt_xml.extract('/teryt/catalog/row');

    l_commit: = 0;

    If l_name = "TERC" then

    Err.d ("name =" |) L_Name, cm, 80);

    for r in (SELECT x.*

    FROM XMLTable ('/ rank ' ADOPTION l_rows)

    ["COLUMNS"WOJ"PATH of the VARCHAR2 (20) ' col[@name="WOJ "]',

    ["VARCHAR2 (20)"POW"PATH" col[@name="POW"]',

    ["Path"GMI"VARCHAR2 (20) ' col[@name="GMI "]',

    PATH of VARCHAR2 (2) "RODZ" "col[@name="RODZ"]',"

    PATH of VARCHAR2 (50) "NAME" "col[@name="NAZWA"]',"

    PATH of VARCHAR2 (50) "NAZDOD" "col[@name="NAZDOD"]',"

    "[" "STAN_NA PATH" VARCHAR2 (10) ' col[@name="STAN_NA"] "

    ) x

    ) loop

    INSERT INTO TERYT_TERC (WOJ, POW, GMI, RODZ, NAME, NAZDOD, STAN_NA, TP_ID)

    VALUES (r.WOJ, r.POW, r.GMI, r.RODZ, r.NAZWA, r.NAZDOD, r.STAN_NA, P_TP_ID);

    do_commit;

    end loop;

    elsif l_name = "SIMC" then

    Err.d ("name =" |) L_Name, cm, 80);

    for r in (SELECT x.*

    FROM XMLTable ('/ rank ' ADOPTION l_rows)

    "WOJ" VARCHAR2 COLUMNS (3) path "col[@name="WOJ"]',"

    ["" POW"VARCHAR2 (3) path" col[@name="POW"]',

    "GMI" VARCHAR2 (3) PATH "col[@name="GMI"]',"

    PATH of VARCHAR2 (2) "RODZ_GMI" "col[@name="RODZ_GMI"]',"

    ["" RM"VARCHAR2 (3) path" col[@name="RM"]',

    "MZ' VARCHAR2 (3) PATH" col[@name="MZ"]', "

    PATH of VARCHAR2 (60) "NAME" "col[@name="NAZWA"]',"

    "SYM' VARCHAR2 (7) PATH" col[@name="SYM"]', "

    PATH of VARCHAR2 (7) "SYMPOD" "col[@name="SYMPOD"]',"

    PATH of VARCHAR2 (10) "STAN_NA" "col[@name="STAN_NA"]"

    ) x

    ) loop

    INSERT INTO TERYT_SIMC (WOJ, POW, GMI, RODZ_GMI, RM, MZ, NAME, SYMBOL, SYMPOD, STAN_NA, TP_ID)

    VALUES (r.WOJ, r.POW, r.GMI, r.RODZ_GMI, r.RM, r.MZ, r.NAZWA, r.SYM, r.SYMPOD, r.STAN_NA, P_TP_ID);

    do_commit;

    end loop;

    elsif l_name = "ULIC" then

    Err.d ("name =" |) L_Name, cm, 80);

    for r in (SELECT x.*

    FROM XMLTable ('/ rank ' ADOPTION l_rows)

    "WOJ" VARCHAR2 COLUMNS (3) path "col[@name="WOJ"]',"

    ["" POW"VARCHAR2 (3) path" col[@name="POW"]',

    "GMI" VARCHAR2 (3) PATH "col[@name="GMI"]',"

    PATH of VARCHAR2 (2) "RODZ_GMI" "col[@name="RODZ_GMI"]',"

    "SYM' VARCHAR2 (7) PATH" col[@name="SYM"]', "

    PATH of VARCHAR2 (7) "SYM_UL" "col[@name="SYM_UL"]',"

    PATH of VARCHAR2 (5) "CECHA" "col[@name="CECHA"]',"

    PATH of VARCHAR2 (50) "NAZWA_1" "col[@name="NAZWA_1"]',"

    PATH of VARCHAR2 (50) "NAZWA_2" "col[@name="NAZWA_2"]',"

    PATH of VARCHAR2 (10) "STAN_NA" "col[@name="STAN_NA"]"

    ) x

    ) loop

    INSERT INTO TERYT_ULIC (WOJ, POW, GMI, RODZ_GMI, SYM, SYM_UL, CECHA, NAZWA_1, NAZWA_2, STAN_NA, TP_ID)

    VALUES (r.WOJ, r.POW, r.GMI, r.RODZ_GMI, r.SYM, r.SYM_UL, r.CECHA, r.NAZWA_1, r.NAZWA_2, r.STAN_NA, P_TP_ID);

    do_commit;

    end loop;

    elsif l_name = "WMRODZ" then

    Err.d ("name =" |) L_Name, cm, 80);

    for r in (SELECT x.*

    FROM XMLTable ('/ rank ' ADOPTION l_rows)

    "RM" VARCHAR2 COLUMNS (5) path "col[@name="RM"]',"

    PATH of VARCHAR2 (50) "NAZWA_RM" "col[@name="NAZWA_RM"]',"

    PATH of VARCHAR2 (10) "STAN_NA" "col[@name="STAN_NA"]"

    ) x

    ) loop

    INSERT INTO TERYT_WMRODZ (RM, NAZWA_RM, STAN_NA, TP_ID)

    VALUES (r.RM, r.NAZWA_RM, r.STAN_NA, P_TP_ID);

    do_commit;

    end loop;

    end if;

    validation work;


    When I'm loading file of type "SIMC" (the file size is approximately 32 MB), all right.

    When I am trying to load the "NEW" type (size file is about 80 MB), there's an ORA-03113.


    The problem is with the LOOP SELECTION, because

    Err.d ("name =" |) L_Name, cm, 80);

    connects name = ULIC


    What can I do to fix this?

    My DB is: Oracle Database 11 g Release 11.2.0.4.0 - 64 bit Production

    As Jason said, there are a bunch of useless stuff in there:

    -The VALIDATION inside the loop: do not do, commit only once, after that the job is done.

    -FOR lines: do not do this, use only one (possibly multi-table) INSERT SELECT.

    -BLOB CLOB conversion: not necessary, use the XMLTYPE constructor.

    -Extract from the XML document, that the work of the intermediate parties do in the whole structure directly.

    Basically, your procedure can be simplified to this couple of statements:

    -- insert XML into a temporary binary XMLType table, for performance :
    insert into tmp_xml values ( xmltype(l_blob, nls_charset_id('AL32UTF8')) );
    
    -- multitable insert into the target tables :
    INSERT FIRST
    WHEN l_name = 'TERC' THEN INTO
      TERYT_TERC (WOJ, POW, GMI, RODZ, NAZWA, NAZDOD, STAN_NA, TP_ID)
      VALUES (WOJ, POW, GMI, RODZ, NAZWA, NAZDOD, STAN_NA, P_TP_ID)
    WHEN l_name = 'SIMC' THEN INTO
      TERYT_SIMC (WOJ, POW, GMI, RODZ_GMI, RM, MZ, NAZWA, SYM, SYMPOD, STAN_NA, TP_ID)
      VALUES (WOJ, POW, GMI, RODZ_GMI, RM, MZ, NAZWA, SYM, SYMPOD, STAN_NA, P_TP_ID)
    WHEN l_name = 'ULIC' THEN INTO
      TERYT_ULIC (WOJ, POW, GMI, RODZ_GMI, SYM, SYM_UL, CECHA, NAZWA_1, NAZWA_2, STAN_NA, TP_ID)
      VALUES (WOJ, POW, GMI, RODZ_GMI, SYM, SYM_UL, CECHA, NAZWA_1, NAZWA_2, STAN_NA, P_TP_ID)
    WHEN l_name = 'WMRODZ' THEN INTO
      TERYT_WMRODZ (RM, NAZWA_RM, STAN_NA, TP_ID)
      VALUES (RM, NAZWA_RM, STAN_NA, P_TP_ID)
    SELECT x.*
    FROM tmp_xml t
       , XMLTable('/teryt/catalog/row'
           PASSING t.object_value
           COLUMNS "WOJ"      VARCHAR2(20) PATH 'col[@name="WOJ"]',
                   "POW"      VARCHAR2(20) PATH 'col[@name="POW"]',
                   "GMI"      VARCHAR2(20) PATH 'col[@name="GMI"]',
                   "RODZ"     VARCHAR2(2)  PATH 'col[@name="RODZ"]',
                   "NAZWA"    VARCHAR2(50) PATH 'col[@name="NAZWA"]',
                   "NAZDOD"   VARCHAR2(50) PATH 'col[@name="NAZDOD"]',
                   "STAN_NA"  VARCHAR2(10) PATH 'col[@name="STAN_NA"]',
                   "RODZ_GMI" VARCHAR2(2)  PATH 'col[@name="RODZ_GMI"]',
                   "RM"       VARCHAR2(3)  PATH 'col[@name="RM"]',
                   "MZ"       VARCHAR2(3)  PATH 'col[@name="MZ"]',
                   "SYM"      VARCHAR2(7)  PATH 'col[@name="SYM"]',
                   "SYMPOD"   VARCHAR2(7)  PATH 'col[@name="SYMPOD"]',
                   "SYM"      VARCHAR2(7)  PATH 'col[@name="SYM"]',
                   "SYM_UL"   VARCHAR2(7)  PATH 'col[@name="SYM_UL"]',
                   "CECHA"    VARCHAR2(5)  PATH 'col[@name="CECHA"]',
                   "NAZWA_1"  VARCHAR2(50) PATH 'col[@name="NAZWA_1"]',
                   "NAZWA_2"  VARCHAR2(50) PATH 'col[@name="NAZWA_2"]',
                   "NAZWA_RM" VARCHAR2(50) PATH 'col[@name="NAZWA_RM"]'
         ) x
    ;
    

    where TMP_XML is defined as follows:

    create global temporary table tmp_xml of xmltype
    xmltype store as securefile binary xml;
    

Maybe you are looking for

  • Problem with S3 organizer

    I have a problem accessing my Amazon S3 account. I get this message every time I try to open a session..."The difference between the duration of the request and at the present time is too large"

  • Replace Satellite C850 cooling fan

    Hi everyone, noob here needing help. I dropped my C850 1 kN (very stupid, I know) and now I think the cooling fan is broken. I removed all the screws from the underside of the laptop and removed the hard drive. Still, the case seems closed and I can'

  • Y580 GTX 660 m &amp; HD 4000 supported Technologies?

    Hi again, I have another question on my new Y580 and his GTX 660 m. NVIDIA posted: support technology: 3D Vision, CUDA, DirectX 11, PhysX, Optimus, OpenCL, DirectCompute. When I open the GPU - Z (with my gtx 660 m running) on the bottom, I don't get

  • Windows Update error 8E5E03FA

    Windows Update error 8E5E03FA occurs after he tried to update Windows Vista Ultimate Edition.  No information has been found on this error code. Thank you. Mitch

  • Dial-up access hangs after the authenticated message

    switched freezes after authenticated message or register your computer on the network.using windows xpISP contacted all my settings are correct and registered with themWhat is the fix for this problem.  help certainly appreciated