This discussion is archived
8 Replies Latest reply: Jan 31, 2013 10:24 PM by Rahul_India RSS

XML DB

Rahul_India Journeyer
Currently Being Moderated
Hi folks

In my project i get xml files daily which is complex and unordered.What i have to do is to transform the complex XML file to simple one by applying business logic.Currently i am using XML ALTOVA MAP FORCE.
Can i do it using pl/sql



 <DIAMessage xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xyz.com" release="1.2">
- <Header sourceSystem="EPM" messageDate="2011-04-26 09:10:34.0" messageNumber="10055140" messageNote="NA">
  <defaultLanguage>eng</defaultLanguage> 
  </Header>
- <Contributor opCode="I" DIAKey="29601996" sourceClassName="PROD_CONTRIBUTOR" sourceInstanceID="12433779" sourceSystem="EPM">
- <hasPersonContributor opCode="I" DIAKey="29601996" sourceClassName="PROD_CONTRIBUTOR" sourceInstanceID="12433779" sourceSystem="EPM">
- <hasPersonExtent opCode="I" DIAKey="27504175" sourceClassName="LASTUPDATEDDATETIME" sourceInstanceID="12433779" sourceSystem="EPM">
  <name opCode="I">LASTUPDATEDDATETIME</name> 
  <ExtName opCode="I">LastUpdatedDateTime</ExtName> 
  </hasPersonExtent>
  <lastName opCode="I">ActivStats</lastName> 
  </hasPersonContributor>
  </Contributor>
  </DIAMessage>
Suppose what if i want to change the values of s ourceClassName="PROD_CONTRIBUTOR" to sourceClassName="RAHUL"

i am on oracle 11gr2
and delete some attributes like opCode="I" and add some some missing attributes
  • 1. Re: XML DB
    odie_63 Guru
    Currently Being Moderated
    I've already given you some options in the original thread : {message:id=10820369}

    What did you not understand about them?
    Ask specific questions so that we can go somewhere.

    And again, what's the db version? all digits from "SELECT * FROM v$version".

    Thanks.
  • 2. Re: XML DB
    Rahul_India Journeyer
    Currently Being Moderated
    odie_63 wrote:
    I've already given you some options in the original thread : {message:id=10820369}

    What did you not understand about them?
    Ask specific questions so that we can go somewhere.

    And again, what's the db version? all digits from "SELECT * FROM v$version".

    Thanks.
    Hi Odie
    thanks for the help.
    i want some basic tutorial.i am very new to xml db.i dont know anything .i have mentioned my oracle db above.I will mention it again its 11gR2.I am confused how to get started. :)

    Thank You
    Rahul
  • 3. Re: XML DB
    odie_63 Guru
    Currently Being Moderated
    i have mentioned my oracle db above.I will mention it again its 11gR2.
    That's not a version.

    This is a version :
    SQL> select * from v$version;
     
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE     11.2.0.3.0     Production
    TNS for 64-bit Windows: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
     
    i want some basic tutorial.i am very new to xml db.i dont know anything .
    Well, then start with part 1 here :
    http://docs.oracle.com/cd/E11882_01/appdev.112/e23094/toc.htm
  • 4. Re: XML DB
    MarcoGralike Oracle ACE Director
    Currently Being Moderated
    As you mentioned, because you new to this, we just ask you to be as precise as possible, and followup requested "mini tasks" so we can anticipate on your needs and environment.

    For example if you had followed up Odie's request "select * from v$version", you could have come back with the following instead of "11gR2"
    SQL> select * from v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE    11.2.0.3.0      Production
    TNS for Linux: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    The reason we ask, FOR EXAMPLE, mention all digits, so not "11gR2" is that this is not specific enough for us.

    Current "11gR2" versions are Express Edition (XE), Standard Edition (SE), Enterprise Edition (EE) etc / 11.2.0.1.0 or 11.2.0.2.0 or 11.2.0.3.0 etc. Why so specific??? Because some new functionality is introduced or changed. For example, XQuery Update in 11.2.0.3, is a valid alternative for some problems. XQuery Update in 11.2.0.2.0 or 11.2.0.1.0 is not supported and/or doesn't work.
    I am confused how to get started. :-)
    So be precise. What is your goal.

    When I read your initial question, stuff that popped into my mind as an alternative for implementing Business rules/transformations of XML via MapForce were

    - Schematron
    - XSLT
    - XQuery (Update)

    But then again, in one of your questions on the PLSQL/SQL forum, out-of-the-blue, you asked "how do I insert XML in the database".

    So where do you want us to start....?

    Edited by: Marco Gralike on Jan 30, 2013 3:08 PM
  • 5. Re: XML DB
    mdrake Expert
    Currently Being Moderated
    Training links

    For Self Paced there are a few possibilities..

    1.     A pre-record seminar on OTN..

    http://download.oracle.com/otndocs/xmldb/seminar/OTN%20XMLDB%20Seminar.html

    2.     The Oracle XML DB Hands on Lab on the Oracle Developer Days VM Image

    http://www.oracle.com/technetwork/database/enterprise-edition/databaseappdev-vm-161299.html

    3.     The XML DB Course in the Oracle Learning Library (This is basically the same material as the HOL)

    http://apex.oracle.com/pls/apex/f?p=44785:24:0::NO:24:P24_CONTENT_ID,P24_PREV_PAGE:5528,2

    4.     Best Practices Guide on OTN.

    http://www.oracle.com/technetwork/database/features/xmldb/xmlqueryoptimize11gr2-168036.pdf

    5.     The Oracle XML DB OTN Page and Sample Code Library

    http://www.oracle.com/technetwork/database/features/xmldb/index.html
  • 6. Re: XML DB
    Rahul_India Journeyer
    Currently Being Moderated
    Hi all.My version is
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    "CORE     11.2.0.2.0     Production"
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    I have a xml file and i am applying XSLT file on it to get the modified required output.Currently i am using Talend tool do this.
    How can i achieve this in oracle?
  • 7. Re: XML DB
    Jason_(A_Non) Expert
    Currently Being Moderated
    From the XML DB documentation, we have
    [url http://docs.oracle.com/cd/E11882_01/appdev.112/e23094/xdb08tra.htm#ADXDB4724]XMLTRANSFORM and XMLType.transform(): Examples
    There are also examples of both of those methods here on the forum as well if you search for them.

    Oh, I see the above was mentioned to you in {message:id=10820369} so I've now provided the link to what Marc (Odie) mentioned.
  • 8. Re: XML DB
    Rahul_India Journeyer
    Currently Being Moderated
    When I read your initial question, stuff that popped into my mind as an alternative for implementing Business rules/transformations of XML via MapForce were

    - Schematron
    - XSLT
    - XQuery (Update)
    Yes Marco spot on.
    I have a xml file and i am applying XSLT file on it to get the modified required output.Currently i am using Talend tool do this.
    How can i achieve this in oracle?Document is bit difficult to follow i read it.Can i get a small example for this.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points