1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

remove node from xml using oracle 9i

Discussion in 'SQL PL/SQL' started by nrupa, Apr 23, 2012.

  1. nrupa

    nrupa Active Member

    Messages:
    13
    Likes Received:
    1
    Trophy Points:
    90
    HI,

    I want to remove duplicate node from my xml

    example xml is
    <?xml version="1.0"?>
    <CHPOI03PAYLOAD>
    <ROW>
    <DOCUMENTHEADER>
    <HEADER>
    <HEADER>
    <SENDERIDQUALIFIER>1</SENDERIDQUALIFIER>
    <SENDERID>1</SENDERID>
    <RECEIVERIDQUALIFIER>1</RECEIVERIDQUALIFIER>
    <RECEIVERID>1</RECEIVERID>
    <VERSIONNUMBER>1</VERSIONNUMBER>
    <TESTPRODUCTIONFLAG>1</TESTPRODUCTIONFLAG>
    <MESSAGEID>1</MESSAGEID>
    <CONTROLNUMBER>1</CONTROLNUMBER>
    <SENTDATE>1</SENTDATE>
    <SENTTIME>1</SENTTIME>
    <PCSCOMMONREFNUMBER>1</PCSCOMMONREFNUMBER>
    </HEADER>
    </HEADER>
    <VESINFO>
    <VESINFO>
    <MESSAGETYPE>1</MESSAGETYPE>
    <CUSTOMSHOUSECODE>1</CUSTOMSHOUSECODE>
    <IGM_NO>1</IGM_NO>
    <IGM_DT>1</IGM_DT>
    <IMOCODEOFVESSEL>1</IMOCODEOFVESSEL>
    <VESSELCODE>1</VESSELCODE>
    <VOYAGENO>1</VOYAGENO>
    <SHIPPINGLINECODE>1</SHIPPINGLINECODE>
    </VESINFO>
    </VESINFO>
    <DOCUMENTHEADER>
    </ROW>
    </CHPOI03PAYLOAD>

    please help me out

    it's urgent
     
  2. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,351
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    So what is your real issue -- removing the duplicate nodes or finding the duplicate nodes to delete? The Java API in Oracle provides removeNamedItem whch could be used to delete these nodex.
     
  3. nrupa

    nrupa Active Member

    Messages:
    13
    Likes Received:
    1
    Trophy Points:
    90
    hi
    thank u for ur rpl

    i want to removing the duplicate nodes

    i.e my xml is

    <?xml version="1.0"?>
    <CHPOI03PAYLOAD>
    <ROW>
    <DOCUMENTHEADER>
    <HEADER>
    <HEADER>
    <SENDERIDQUALIFIER>1</SENDERIDQUALIFIER>
    <SENDERID>1</SENDERID>
    <RECEIVERIDQUALIFIER>1</RECEIVERIDQUALIFIER>
    <RECEIVERID>1</RECEIVERID>
    <VERSIONNUMBER>1</VERSIONNUMBER>
    <TESTPRODUCTIONFLAG>1</TESTPRODUCTIONFLAG>
    <MESSAGEID>1</MESSAGEID>
    <CONTROLNUMBER>1</CONTROLNUMBER>
    <SENTDATE>1</SENTDATE>
    <SENTTIME>1</SENTTIME>
    <PCSCOMMONREFNUMBER>1</PCSCOMMONREFNUMBER>
    </HEADER>
    </HEADER>
    <VESINFO>
    <VESINFO>
    <MESSAGETYPE>1</MESSAGETYPE>
    <CUSTOMSHOUSECODE>1</CUSTOMSHOUSECODE>
    <IGM_NO>1</IGM_NO>
    <IGM_DT>1</IGM_DT>
    <IMOCODEOFVESSEL>1</IMOCODEOFVESSEL>
    <VESSELCODE>1</VESSELCODE>
    <VOYAGENO>1</VOYAGENO>
    <SHIPPINGLINECODE>1</SHIPPINGLINECODE>
    </VESINFO>
    </VESINFO>
    <DOCUMENTHEADER>
    </ROW>
    </CHPOI03PAYLOAD>

    AND i want xml Like this
    <?xml version="1.0"?>
    <CHPOI03PAYLOAD>
    <ROW>
    <DOCUMENTHEADER>
    <HEADER>
    <SENDERIDQUALIFIER>1</SENDERIDQUALIFIER>
    <SENDERID>1</SENDERID>
    <RECEIVERIDQUALIFIER>1</RECEIVERIDQUALIFIER>
    <RECEIVERID>1</RECEIVERID>
    <VERSIONNUMBER>1</VERSIONNUMBER>
    <TESTPRODUCTIONFLAG>1</TESTPRODUCTIONFLAG>
    <MESSAGEID>1</MESSAGEID>
    <CONTROLNUMBER>1</CONTROLNUMBER>
    <SENTDATE>1</SENTDATE>
    <SENTTIME>1</SENTTIME>
    <PCSCOMMONREFNUMBER>1</PCSCOMMONREFNUMBER>
    </HEADER>
    <VESINFO>
    <MESSAGETYPE>1</MESSAGETYPE>
    <CUSTOMSHOUSECODE>1</CUSTOMSHOUSECODE>
    <IGM_NO>1</IGM_NO>
    <IGM_DT>1</IGM_DT>
    <IMOCODEOFVESSEL>1</IMOCODEOFVESSEL>
    <VESSELCODE>1</VESSELCODE>
    <VOYAGENO>1</VOYAGENO>
    <SHIPPINGLINECODE>1</SHIPPINGLINECODE>
    </VESINFO>
    <DOCUMENTHEADER>
    </ROW>
    </CHPOI03PAYLOAD>

    thank you.:)
     
  4. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,351
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    So you want someone else do to your work?