Creation of XML to relational Tables Using java code

I would like to create an XML document querying relational tables in java

try {}

connection = getConnection().

final String qryStr = "sΘlectionner the XMLElement (foo, 'bar') from dual;

final OracleXMLQuery qry = new OracleXMLQuery (connection, qryStr);

final String xmlString = qry.getXMLString ();

} ....

I expect this to give the result depending on whether I get the statement being executed in SQL Developer

Select XMLElement (foo, 'bar') of double

< FOO > bar < / FOO >

Instead, I get

<? XML version = "1.0"? >
oracle.xml.sql.OracleXMLSQLException < ERROR >: character ')' is not allowed in an XML tag name. < / ERROR >

What is the right way to go about this?

What is the right way to go about this?

Not really.

OracleXMLQuery class is the implementation of Java-side API DBMS_XMLQUERY.

It is mainly designed to generate a canonical XML document of a SQL query.

Assuming a query "SELECT col1, col2 FROM my_table", the resulting XML document should appear as follows:

123

ABC

456

XYZ

...

So in your test, since the resulting column is not an alias (XMLElement), you actually try to build something like this:

bar

which of course is not valid, so the error message.

If you want to generate only the bar output, just use a regular PreparedStatement with your query and access the document in the result set with the appropriate getter.

Tags: Oracle Development

Similar Questions

  • PartialTriggers application using java code?

    We can perform a partial Trigger on a component using java code?

    For example,.
    I have a textBox element and an attribute of partialTriggers link commandButton.If in the text box for the commandButton control, he gets the renderer every time I click the commandButton control.

    Can I get the same thing by writing some piece of java code inside the listener of the CommandButton action?

    Kind regards
    Lokesh.

    If you bind the element to an attribute of bean (i.e. attrXYZ), you can use

    RequestContext.getCurrentInstance().addPartialTarget(attrXYZ);
    

    in the listener to update it.

    Timo

  • How to create a BPEL Process task using java code

    Hello

    I created a BPEL process (for creating task), in which my requirement is that I need to create a task based on some inputs and assign it to the user in partucular and then get out of this flow.

    earlier, I felt that I will use the human task activity. but when I use that task will be created in the same process and proceedings will be stuck on there until human intervention (the BPEL process waits for the result.).

    is it possible that I can use Java activity and create tasks from java code, 'I know how to assign a specific user task. Please tell me.
    Abhishek

    Published by: abhishek on April 25, 2011 12:42 AM

    Hi Abhishek
    1. you can try this alternative approach and it should work.

    2. basically, most of the BPEL process eventually auto generated Web services (.) WSDL). When we create a BPEL process, everything we do is give diagram of input, output schema and creates a bpel process with the default operation named as "process" in all the old versions as up to 11.2 SOA (and maybe before). BUT SOA 11.3 from, we can create a process BPEL, with our own WSDL and our own scheme. There is no restrictions like having only a single operation named 'process', etc.. In any case, what I mean is, each BPEL process ends up as a WebService, with entry and exit of the payloads of XSD.

    3. from the JDeveloper itself, locate the .wsdl for your BPEL process under the Workflow project. Create a new project of Proxy customer service Web and generate a customer for this wsdl Web service proxy. This will create you Service, Port and JAVA classes equivalent payload theoretically in your case taskpayload.xsd with these 4 items you have. Ignore the full blown the HumanTask which has all the system elements and attributes of a task of bpel. All you need is to undertake a task with your own payload data. Create a simple Client Java (EJB or Servlet later to make more flexible). In this Java client, retrieve the Service object in the proxy and port. Then instantiate the java class that represents the payload. Set 4 values you want and set the user name, etc. You may need some adjustments for the setting of the user. Then the port invoke otherwise (go your java object here).

    Sample code snippet
    prepare the message for BPEL of appeal; Define the fields that can not be null
    MyPayloadRequest myPayloadRequest = new MyPayloadRequest();
    myPayloadRequest.setInitiator("");
    myPayloadRequest.setTitle("");
    myPayloadRequest.setEmployeeName("");
    myPayloadRequest.setEmpContact("");

    web service client Get for BPEL receive point and call: first generate client proxy
    MyBPELPProcess_client_ep serviceClient = new MyBPELPProcess_client_ep();
    MyBPELPProces proxy = serviceClient.getNewMyBPELPProces_port ();
    proxy. Process (myPayloadRequest);

    Please note that you can also use the SOA workflow API and the Manager back call personalized for this first task classes. In this class, you can have the methods of the interceptor, which is called each time a task is initiated, saved, Submit, approve etc etc (all events essentially). This gives you access to all the objects in a workflow with full charge blown. So you can always get the data you pass above and in this custom class, the value of the user, date/time etc..

    It's just a different approach you can try.

    Thank you
    Ravi Jegga

  • Inserting data in several related tables using the database

    Hello world
    I'm working on a BPM application using Oracle BPM 11.1.1.5.0 and JDeveloper 11.1.1.5.0.

    In my database, I have two tables, loan and guarantee that are related by a field named employeeID (PK on loan) and FK in warranty.
    Each line can have several lines of guarantee.

    At this point, I'm doing an entry form for the user to insert data in the two tables.

    I did successfully before with a single table that has no relations.

    The way I'm doing here is, after the creation of the database successfully adapter, a type of LoanCollection is created in the types module, which can be used to create business objects and data objects of.

    The problem is when I create an object of type loanCollection process data and then create a UI generated automatically on that basis, only the fields in the primary table (the Table of loan) appear in the form.
    On the other hand, if I create a business object based on the LoanSchema, the form for all of the two tables is created automatically (the loan as a form, the guarantee in a table), but then, when I try to access it in the section processing service mission which calls the database adapter, I have no access to such.
    In fact, the only type which can be used in the service task is the process based on the loanCollection data object.

    To summorize, I have to use the type of business for my UI object to include all the fields in both tables, so I have to use the data object from the collection process in the transformation of service task dialog box.
    And I can't find a way to map to another.

    Can someone help me with this please?
    Thank you very much

    Try to follow these steps.

    1. create a new module in your catalogue our BPM project management section
    2. in this new module create 3 Business Objects - (LoanBusinessObject, GuaranteeBusinessObject and GuaranteeArrayBusinessObject)
    3. Add the attributes appropriate to the LoanBusinessObject and the GuaranteeBusinessObject so that they mimic your database tables, then to the GuaranteeArrayBusinessObject add an array of type attribute GuraranteeBusinessObject
    4. now you need to create two process data objects, type loanProcessObject LoanBusinessObject and type guaranteesProcessObject GuaranteeArrayBusinessObject
    5. as inputs to your human task adds the loanProcessObject and guaranteesProcessObject, these should now be available in your data controls and can be used to auto generate the form
    6. in your dbadapter you'll then use XSL Transformation and use for each so that it will write the data to the ready table and all the line items of warranty for the warranty table.

  • I'm not able to get the value of an element in the region from the table using Java script

    I have a fixation with two columns area, when the user tries to add a new line without having to fill in the line above, then it should throw an exception. It is the custom page and the home region is located at the end of my page so normal exception raises at the top of the page where the end user referred to in the current. I need to go with popup warning. I built a java script in PR

    code:

    OkButton OASubmitButtonBean = (OASubmitButtonBean) webBean.findChildRecursive ("addrow");

    okButton.setOnClick ("javascript: a = document.getElementById ('prompt');" + "alert ('outside ' + (a.value));" +)

    "if ((a.value)! = ") {input = alert ('check' + (a.value)) ;}} else {alert (' inside the else'+ (a.value));} ");"

    The code above works for entering the message text in the header area, but it is does not make any value if the sub-region of table in advance. Kindly share your point of view on this issue.

    attach_js_issue.png

    This code will give you the same ID only.

    Check the "View Source" code generated from the browser.  https://support.Google.com/AdSense/answer/181951?hl=en

    See you soon

    AJ

  • Insert the VO data by using java code on OFA?

    Hi all,

    I m trying a way to insert data by a VO using the Row.setAttribute () function, I need pair this way, but with not much success, for now, I created the following code in the

    Application module:

    ' public void createRecord (String responsabilidad, String segment, String subsegmento) {}

    OAViewObject vo = this.getMovQuiebresComercialesVO1 ();

    If (! vo.isPreparedForExecution ()) {}

    vo.executeQuery ();

    }

    Line studrow = vo.createRow ();

    studrow.setAttribute ("ResponsibilityName", responsibility);

    studrow.setAttribute ("DescSegmento", segment);

    studrow.setAttribute ("DescSubsegmento", subsegmento);

    vo.insertRow (studrow);

    vo.setCurrentRow (studrow);

    vo.insertRow (studrow);

    vo.setCurrentRow (studrow);

    studrow.setNewRowState (Row.STATUS_INITIALIZED);

    }

    After that, I made a call to the apply method in the AM:

    {} public void apply()

    getTransaction () .commit ();

    }

    The VO has the following attributes: http://screencast.com/t/hJiNoyY8

    But I have not ben able to store the data in the Database, I would appreciate any suggestion

    Thank you all

    The solution was to initialize the VO in the page load Apps - OA Framework controller ViewObject for Table screen

  • How to generate XML from database data using a procedure?

    Hello

    I want to generate output as xml to database tables using a procedure. Can anyone suggest me on how to do this?

    Thanks for your time.

    Reel for the XML script

  • Master in detail using using java

    Hello

    I use jdev 11.1.1 5

    My duty to create a master-details using java code. My opinion don't have view link. How to reach through code

    Why can't use u see the link...

    BTW, you can see this

    http://www.techartifact.com/blogs/2013/08/master-detail-iterations-using-tree-component-by-managed-bean.html

  • Send messages via the java code, but using definitions of Mail

    Hello

    I want to send mails using java code, but reading the data (body, subject, sender, etc.) of the IOM Mail definitions.

    can someone send me a link or a thread where this method is used?
    or a reference to some Thor API manual.

    Thank you.

    You can use tcEmailOperationsintf API to call IOM Email definitions from java code.

    Here is the snippet of code on the use of this API.

    {} public void getEmailTemp (String email_def_name)
    tcEmailOperationsIntf emailIntf = null;
    resSet tcResultSet = null;
    Map emailMap = new HashMap();
    emailMap.put ("Email Definition.Name", email_def_name);
    try {}
    emailIntf = getUtilityFactory() (Thor.API.Operations.tcEmailOperationsIntf)
    .getUtility ("Thor.API.Operations.tcEmailOperationsIntf");
    resSet = emailIntf.findEmailDefinition (emailMap);
    for (int i = 0; i)< resset.getrowcount();="" i++)="">
    resSet.goToRow (i);
    Void String = resSet.getStringValue ("Email Definition.Subject");
    System.out.println ("subject of the email is:" + sub);
    String body = resSet.getStringValue ("Email Definition.Body");
    System.out.println ("body of the email is:" + body);
                                  
    }
    } catch (tcAPIException e) {}
    System.out.println ("Exception occurred in the getEmailTemp method:" + e);
    } catch (tcColumnNotFoundException e) {}
    System.out.println)
    «cloumn illegal name allowing access to the getEmailTemp method: "+ e);»
    }
    System.out.println ("getEmailTemp smoothly method");
    }

    You can use this code for your reference.

  • Force sync LDAP via the Java Code

    Hello

    I have 2 servers LDAP (AD) and there are a few changes made every night, using Java code. I want force synchronization between these 2 servers after that change is done using Java. I am not able to find any mothod to do by using the LDAPContext class.

    Any help on this is appreciated.

    -Spengler.

    LDAP replication aka sync is standard and implemented differently on the application of each seller, so there is no standard interface that can use Java. You would be better of the configuration of the synchronization directly on the side of things AD. You could use Java potentically to launch/run a native ADSI script that forces synchronization on if configured AD.

  • Loading XML into the relational Table data

    Hello

    I get a generated XML file to other tools (Windows), I am trying to create a Linux shell script that will gather the necessary XML file to my Linux server, then ask Oracle to use this file to load the XML data into a relational table. This activity and the data will be needed on an ongoing basis.

    I tried two ways. First, I loaded the XML document into the database and tried to extract the data directly from the document, but it does not work. Now I want to try to read the data directly from the file on the server through select, however I don't get all the returned data. In the Select statement below, I am trying to query the data to see what is returned for my tests.

    Create Table ci_results_table (transactionID Varchar2 (100), //transactionID should be PrimaryKey but became errors in test of insert, PK so deleted NULL value)

    message Varchar2 (200),

    This Varchar2 (50).

    XMLType of the ProcessedDate,

    status Varchar2 (50).

    sourceFile VarChar2 (100));

    Select x.*

    from XMLTable)

    ' TSPLoadResults/results '.

    PASSAGE xmltype (bfilename('CMDB_DEVADHOCRESULTS_DIR','LoadResults-HP_146.results.xml'), nls_charset_id ('AL32UTF8'))

    COLUMNS

    transactionID PATH Varchar2 (100) 'TransactionID '.

    Result XMLType PATH 'result ',.

    Message Varchar2 (200) PATH "Message."

    PrimaryKey Varchar2 (50) PATH "PrimaryKey"

    Date of ProcessedDate path "ProcessedDate."

    Status Varchar2 (50) PATH "Status."

    SourceFile VarChar2 (100) PATH "SourceFileName.

    ) x

    ;

    Eventually, I'll have to build on that to limit the returned data to records where SourceFileName is like '% PA' and insert what is returned in to the ci_results_table. Attached is an example of the XML results file I am trying to load, it is named "ResultsTransformedtoUnix" because I used dos2Unix to convert Unix which can be good or bad. (I send the output file must be converted to the format BACK until the other application can read). Original (before converting Unix) file named in the script is also attached.

    Help, please. Thank you!

    Hello

    I see some bad things in your query.

    (1) obvious one, explaining why you get all the data: there is a typing error in the XQuery expression, there 'result' not'slead.

    (2) ProcessedDate can be extracted as a date (at least not directly) because it actually represents a timestamp, use the TIMESTAMP WITH time ZONE HOURS and cast back to DATE data type in the SELECT clause

    (3) transactionID is an attribute, it must be accessible with ' @' (or ' attribute:' axis)

    (4) if the encoding of file really is ISO-8859-1 as suggested in the prologue, then do not use AL32UTF8 but the name of the corresponding character set: WE8ISO8859P1

    Here is the query to work:

    select x.transactionID
         , x.Message
         , x.Primarykey
         , cast(x.ProcessedDate as date) ProcessDate
         , x.Status
         , x.SourceFile
    from XMLTable(
           '/TSPLoadResults/Result'
           PASSING xmltype(bfilename('XML_DIR','LoadResults-HP_146.results.xml'), nls_charset_id('WE8ISO8859P1'))
           COLUMNS
             transactionID Varchar2(100)            PATH '@transactionID',
             Message       Varchar2(200)            PATH 'Message',
             PrimaryKey    Varchar2(50)             PATH 'PrimaryKey',
             ProcessedDate timestamp with time zone PATH 'ProcessedDate',
             Status        Varchar2(50)             PATH 'Status',
             SourceFile    VarChar2(100)            PATH 'SourceFileName'
         ) x
    ;
    

    Directly on the file using this query will only be decently (for large files) on 11.2.0.4 and beyond.

    On older versions, first load the file into a (temporary) XMLType column with binary XML storage and CHOOSE from there.

    because I used dos2Unix to convert Unix which can be good or bad.

    This conversion should not be necessary.

  • XML document to tables relational object

    Experts: I followed several examples online and was able to insert an XML document in a relational Table of Oracle objects. I see that Oracle creates a table behind the scenes and some types of data which map to the elements in the xsd file.

    My hypothesis is that I can run selects plain
    ( select col1, col2, col3 from OR_XML_Table )
    against the inserted xml document columns lbut infact I still have to xpath in the relational table object for oracle to access the values of the element.

    Is it possible to insert xml elements to Oracle relational tables that can be queried without xpath expressions.
    Oracle db 11.2.0.3
    Linux 5
    Thank you
    KeV

    Published by: Kevin_K on February 5, 2013 12:50

    I get an error "ORA-01730: number of column names specified invalid."

    I am very close. Please suggest what I'm doing wrong?

    The error is pretty self-explanatory.
    The columns of three of the projects of query, but you try to generate a view of the object (with a column of the single object).

    You also use the deprecated functions.

    CREATE OR REPLACE VIEW person_view as
    select x.*
    from Person_xml t
       , xmltable(
           '/Person'
           passing t.object_value
           columns First_Name  varchar2(30) path 'FirstName'
                 , Last_Name   varchar2(30) path 'LastName'
                 , dob         date         path 'DateOfBirth'
         ) x
    -- where x.first_name = 'Kevin'
     ;
    

    (adjust as necessary data types)

  • Approach to analyze the large number of XML files in the relational table.

    We are studying the possibility of XML DB to treat a large number of files from same day.
    The goal is to parse the XML file and store it in several relational tables. Once in the relational table don't care us about the XML file.
    The file cannot be stored on the file server and must be stored in a table before analysing because of security concerns. A third-party system will send the file and it will store in the XML database.
    The file size can be between 1 MB to 50MB and high performance is very that much is expected of other wise men, that the solution will be discarded.
    Although we have no of XSD, the XML file is well structured. We are 11g Release 2.

    Based on the reading, that's what my approach.
    1. CREATE THE DONNEES_XML TABLE
    (xml_col XMLTYPE)
    XMLTYPE xml_col STORE AS BINARY XML NAVIGATION;

    2. third will store the data in the donnees_xml table.
    3. create XMLINDEX on the unique XML element
    4 create XMLTYPE views
    CREATE OR REPLACE FORCE VIEW (V_XML_DATA)
    SType,
    Mtype,
    MNAME,
    ROT
    )
    AS
    SELECT x."Stype"
    x."Mtype."
    x."Mname"
    x."ROT".
    OF data_table t,.
    XMLTABLE)
    ' / SectionMain'
    PASSAGE t.data
    COLUMNS Stype VARCHAR2 (30) PATH "Stype"
    Mtype VARCHAR2 (3) path "Mtype."
    MNAME VARCHAR2 (30) PATH "MNAME"
    ROT VARCHAR2 (30) PATH "OID") x;

    5. loading mass analysis of data in the staging table based on the column in the index.

    Please comment on the process that precedes any suggestions that can improve the performance.

    Thank you
    AnuragT

    PASSAGE t.xml_col<--WHAT will="" passing="" here="" since="" no="">

    If you are using an XMLType Table, instead of an XMLType column reference, you are referring to the contents of XMLType while using the NICKNAME "OBJECT_VALUE" column

    If--> t.object_value

  • 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
     
    
  • What is the best way to apply choice relational tables in the XML document?

    I've got an XML document from outside I turn with full DB XSLT document.

    Some parts of the document contain codes I want to tranfsorm to significant labels of relational tables in our database.

    On road is to disassemble the XML into the relational views and join these views with tables of choice and then back, this time with labels translated, using XMLElement, etc...

    Is there another way less heavy? For example,.

    Select updateXML)
    xml_dta
    ,'/ / section_to_translate/node_to_translate/variable / text () '
    ,(
    Select the label
    of table_recherche
    where Group = extractValue (current_node, '... / Group/Text () ')
    and code = extractValue (current_node, '... / variable/Text () ')
    )
    ) xml_dta
    from my_table
    where... criteria

    However, I do not know how to move from the current node to the extractValue function (if it is possible?.)

    Anyone done the second way?

    Thank you

    You didn't tell the version of your database, so I assume one of them later.

    You can include the part of the translation in the XSL transformation, by accessing an external research paper generated from the database beforehand.

    Here is an example of use of the HR diagram example:

    (1) the source document that are to be processed: emp.xml

    
    
     
      198
      Donald
      OConnell
      SH_CLERK
     
     
      199
      Douglas
      Grant
      SH_CLERK
     
     
      200
      Jennifer
      Whalen
      AD_ASST
     
     
      201
      Michael
      Hartstein
      MK_MAN
     
     
      202
      Pat
      Fay
      MK_REP
     
     
      203
      Susan
      Mavris
      HR_REP
     
     
      204
      Hermann
      Baer
      PR_REP
     
     
      205
      Shelley
      Higgins
      AC_MGR
     
     
      206
      William
      Gietz
      AC_ACCOUNT
     
     
      100
      Steven
      King
      AD_PRES
     
    
    

    (2) the lookup table:

    SQL> create table lookup_table as
      2  select job_id, job_title
      3  from hr.jobs;
    
    Table created
    
    SQL> select * from lookup_table;
    
    JOB_ID     JOB_TITLE
    ---------- -----------------------------------
    AD_PRES    President
    AD_VP      Administration Vice President
    AD_ASST    Administration Assistant
    FI_MGR     Finance Manager
    FI_ACCOUNT Accountant
    AC_MGR     Accounting Manager
    AC_ACCOUNT Public Accountant
    SA_MAN     Sales Manager
    SA_REP     Sales Representative
    PU_MAN     Purchasing Manager
    PU_CLERK   Purchasing Clerk
    ST_MAN     Stock Manager
    ST_CLERK   Stock Clerk
    SH_CLERK   Shipping Clerk
    IT_PROG    Programmer
    MK_MAN     Marketing Manager
    MK_REP     Marketing Representative
    HR_REP     Human Resources Representative
    PR_REP     Public Relations Representative
    
    19 rows selected
     
    

    (3) generate us the document search and store it in the XML DB repository (so that it can be referenced in the XSLT):

    SQL> show user
    User is "dev"
    
    SQL>
    SQL> declare
      2   res boolean;
      3  begin
      4   res := dbms_xdb.CreateResource(
      5    abspath => '/public/temp/lookup.xml',
      6    data => dburitype('/DEV/LOOKUP_TABLE').getXML
      7   );
      8   commit;
      9  end;
     10  /
    
    PL/SQL procedure successfully completed
    
    SQL> set long 10000
    SQL> select xdburitype('/public/temp/lookup.xml').getCLOB() from dual;
    
    XDBURITYPE('/PUBLIC/TEMP/LOOKU
    --------------------------------------------------------------------------------
    
    
      
        AD_PRES
        President
      
      
        AD_VP
        Administration Vice President
      
      
        AD_ASST
        Administration Assistant
      
      
        FI_MGR
        Finance Manager
      
      
        FI_ACCOUNT
        Accountant
      
      
        AC_MGR
        Accounting Manager
      
      
        AC_ACCOUNT
        Public Accountant
      
      
        SA_MAN
        Sales Manager
      
      
        SA_REP
        Sales Representative
      
      
        PU_MAN
        Purchasing Manager
      
      
        PU_CLERK
        Purchasing Clerk
      
      
        ST_MAN
        Stock Manager
      
      
        ST_CLERK
        Stock Clerk
      
      
        SH_CLERK
        Shipping Clerk
      
      
        IT_PROG
        Programmer
      
      
        MK_MAN
        Marketing Manager
      
      
        MK_REP
        Marketing Representative
      
      
        HR_REP
        Human Resources Representative
      
      
        PR_REP
        Public Relations Representative
      
    
     
    

    (4) the sheet XSLT stylesheet (stored in XDB repository as well): emp.xsl

    
    
     
     
     
     
     
      
     
     
     
      
      
       
       
        
       
      
     
    
    

    The transformation is rather bland, but the interesting part lies in access to external document within it.
    I used a key to index the JOB_ID/function pairs.

    (5) last step, apply the transformation:

    SQL> select xmlserialize(document
      2   xmltransform(
      3    xmltype(bfilename('DUMP_DIR','emp.xml'),nls_charset_id('AL32UTF8')),
      4    xdburitype('/public/temp/emp.xsl').getXML()
      5   ) as clob indent
      6  )
      7  from dual;
    
    XMLSERIALIZE(DOCUMENTXMLTRANSF
    --------------------------------------------------------------------------------
    
    
      
        Donald OConnell
        Shipping Clerk
      
      
        Douglas Grant
        Shipping Clerk
      
      
        Jennifer Whalen
        Administration Assistant
      
      
        Michael Hartstein
        Marketing Manager
      
      
        Pat Fay
        Marketing Representative
      
      
        Susan Mavris
        Human Resources Representative
      
      
        Hermann Baer
        Public Relations Representative
      
      
        Shelley Higgins
        Accounting Manager
      
      
        William Gietz
        Public Accountant
      
      
        Steven King
        President
      
    
     
    

    The input document is transformed and each job_id is replaced by its corresponding label.

Maybe you are looking for