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
 

Tags: Oracle Development

Similar Questions

  • How to remove red-eye using Windows 7 Photo Viewer

    Help!

    How to remove red-eye using Windows 7 Photo Viewer

    Windows Photo Viewer, it's just what it says, a spectator only. But there is no editing capabilities.

    To edit a photo, you will need software such as Windows Live Photo Gallery or IrvanView (to name only a few).

  • How to remove the pagefile used?

    I had used for VM's C: drive once and create a ghost for the backup of the OS image.

    After that, I had spent D; drive for VM, but not updated the ghost for the backup of the OS image.

    After I restored my OS image and find that C: drive is used for the virtual machine instead of D: drive, but the swap file is stored on the D: drive, and

    I would like to know how to remove unused pagefile on the D: drive.

    Does anyone have any suggestions?

    Thanks in advance for your suggestions

    D: as a separate hard drive, place a swap a file

    partition, is not advisable... Either way, R.click my computer, properties,

    Advanced, virtual memory, change button, L.click on the hard drive, the value

    "no page file" click 2 X game, close...

  • How to remove an update to Java which will not uninstall?

    I have windows vista and I recently upgraded Java 6 update 23 and my program mp3 Rocket quit working, he kept sayingnot to access c libmp3Rocket jar, so I tried to uninstall the update of java, but when I click on uninstall it says preparing to remove, but then the account control user box pop up to ask if I leave this program not identified to my computer and I click on access to the so then he says to it you please wait while Windows configures java, but its only up there for a second and then the box disappears, and then the update is still there, nothing happened.  I went to the site of java to check my java version and have downloaded the update of java 6 22, but he always says that something is wrong. Java does not work.  And I tried to open mp3 rocket after java 6 update 22 d/l would be and now, nothing happened, is no longer, box pops up saying cannot access c, but the program does not come either.  Does anyone know how can I get rid of the update of java 6 23, I think that's the problem, but it just will not, uninstall I think I need strength somehow remove it.

    Go to http://java.com/en/download/help/index_installing.xml

    and click on the Red help button now great.  Ask for help to uninstall manually.

    Colin Barnhorst

  • How to generate XML nested using PL/SQL data?

    I have an XML that looks like this file...

    <? XML version = "1.0"? >
    < TDefs >
    < ListItem >
    < TDef >
    < DisplayName > AFP < / DisplayName >
    < enabled > True < / enabled >
    < LISName > AFP < / LISName >
    < LOINC / >
    < PrintName > AFP < / PrintName >
    < CompatibilityCode > 1 < / CompatibilityCode >
    < details >
    < PatientReplicates > 1 < / PatientReplicates >
    < AutoReDilute > false < / AutoReDilute >
    < / details >
    < DilutionList >
    < TDefDilution >
    < dilution > 1 < / Dilution >
    < CalculationFactor > 1 < / CalculationFactor >
    < / TDefDilution >
    < / DilutionList >
    < TDefRange >
    < RangeList >
    < RangeInfo >
    < ID >
    < int > 6509 < / int >
    < /ID >
    < name >
    < string > check Range2 < / string >
    < / name >
    < Name_MessageID >
    < int >-1 < / int >
    < / Name_MessageID >
    < IsNull RepeatedlyReactiveData = "true" / >
    < IsNull RepeatedlyReactiveComments = "true" / >
    < CreatedByIM >
    < Boolean > true < / Boolean >
    < / CreatedByIM >
    < / RangeInfo >

    This is data that are from different tables. It is a multilevel nested nodes each other.
    How do I achieve using PL/SQL? What is the best way?

    I've only used to date dbms_xmlgen to generate data from a single table.
    Can anyone help?

    How do I achieve using PL/SQL? What is the best way?

    SQL/XML functions.

    For example: {message identifier: = 9670705}

    After a few data structures and table (DDL) samples if you need specific help on the query.

  • How to build a query using Java HTTP

    Hello

    I am fairly new and I looked on many positions and tried several implementations but no work and seem to be too complex for what I'm trying to do. All I want is to have my application use a connection to the internet and send an http request to a url and returns the chain reaction in my application.

    It seems that BB should have some kind of class to do what I can imagine it is common but I found all the solutions seem to have manually coded methods to check the available connections etc...    Am I wrong to think this should be simple or can I just can't get the right classes. I imagine that someone came up with a class already.

    I'm looking for a curl or equivalent LWP for BB, which is smart enough to recognize what connection to use.

    If it does not exist, I would appreciate a nod in the right direction.

    Unfortunately, this is probably * the * party the more complex learning to develop for the Blackberry.

    You will find a bit of info in the thread sticky at the top of this forum (by Peter Strange).

    There is also a factory 5.0 connection method, but of course, it's pretty useless since 99% of devices are running a more low level of operating system.

    Here is a link to a factory for connections 'rolling', maybe you will find useful.

    http://www.versatilemonkey.com/HttpConnectionFactory.Java

  • How to remove the project using sql with the proper sequence

    Hello

    Tried to delete the project failed with query according to the sequence shown below. But get error when running below final sql script (delete from epub_process where of the project = '?')

    SQL error: ORA-02292: integrity constraint (PUB.) PROC_HIST_ID_FK) violated - book of the foundling

    02292 00000 - 'constraint integrity (s.%s) violated - child notebook found. '

    * Cause: attempted to remove a parent key value that was a stranger

    dependence.

    * Action: remove dependencies first then the parent or disable the constraint.

    delete from avm_asset_lock where workspace_id in

    (select avm_devline id, whose name in)

    (select Workspace from epub_project where project = 'prj49024')) ;

    delete from EPUB_PR_HISTORY where project in

    (select project in epub_project where project = "prj49024");

    delete from epub_project where project = "prj49024";

    delete from EPUB_PROC_HISTORY where ID_processus in

    (select ID_processus from epub_process where of the project = "prj49024");

    delete from EPUB_PROC_TASKINFO where id in

    (select ID_processus from epub_process where of the project = "prj49024");

    delete from epub_taskinfo where ID_processus in

    (select ID_processus from epub_process where of the project = "prj49024");

    delete from EPUB_WORKFLOW_STRS where id in

    (select ID from EPUB_IND_WORKFLOW where ID_processus in)

    (select ID_processus from epub_process where of the project = 'prj49024')) ;

    delete from EPUB_IND_WORKFLOW where ID_processus in

    (select ID_processus from epub_process where of the project = "prj49024");

    Get the error when running this script

    remove the epub_process of the project where = "prj49024";

    Please let me know good sequence or how to avoid this mistake

    Thank you

    Sri

    Here are the steps:

    delete from EPUB_PR_HISTORY where project in ('prj213002', 'prj200001');

    delete from EPUB_PROC_HISTORY where ID_processus in

    (select ID_processus from the epub_process of the project where in ('prj213002', 'prj200001'));

    delete from EPUB_PROC_TASKINFO where id in

    (select ID_processus from the epub_process of the project where in ('prj213002', 'prj200001'));

    delete from EPUB_IND_WORKFLOW where ID_processus in

    (select ID_processus from the epub_process of the project where in ('prj213002', 'prj200001'));

    remove the epub_process of the project where in ('prj202001', 'prj213002');

    delete from avm_asset_lock where workspace_id in

    (select avm_devline id, whose name in)

    (sélectionnez project_id dans epub_project où project_id dans ('prj213002', 'prj213002'))) ;

    delete from epub_project where project in ('prj202001', 'prj213002');

    commit;

    Peace

    Shaik

  • Don't use not home computer, how to remove and re use record on my laptop.

    I have been with a Mac Pro at home but now will be on the road quite a bit, how can I UN register the Mac and the laptop re? Or am I allowed to run both?

    You simply copy the installation on a memory stick files or use the CD, if necessary, take to the new computer and install. You must always have the available for installation SN.

  • How to remove null lines using the feature BOX

    Hi all

    I use the CASE FUNCTION to retrieve data from a domain.

    The command is:

    CASE ' candidate Q & A» "" Question Code ' WHEN 'R3 questionnaire 3' THEN ' candidate Q & has. " "" Response (of your choice) (BL) ' END

    The results show the correct data over a line with a null value.

    I want to show that the value is not null.

    Is this possible with CASE function or other function? I tryied to use the FILTER function, but this function does not work as I want.Untitled.png

    Thank you!

    Carlos.

    Bigger than worker Carlos.

    Therefore one more step for you: close the thread so that others with similar questions will know that they can find something here... Is not good it is still this question is no answer.

  • How to disable a button using Java Script in Apex

    Hi all

    I tried to disable a button when the value of an element of the selection in the same page list is zero. Here are the steps that I did.

    (1) created a new model of button like < table class = "t9StandardButton" id = "" #BUTTON_ID # "cellspacing ="0"cellpadding ="0"border ="0"Summary =" ">"
    2) has changed the model of existing button to the newly created button model.
    (3) added onchange = "javascript:fdisplay (this); "the selection list form element value
    (4) added the following in the page header java script

    < script type = "text/javascript" >
    function fdisplay (some) {}
    If {(some.value == 0)
    html_GetElement (' #BUTTON_ID # "") .disabled = true;
    }
    on the other
    {
    html_GetElement (' #BUTTON_ID # "") .disabled = false;
    }
    }
    < /script >




    But the script does not work. Is there something I'm missing here. Please advice.

    Thank you
    Vikas

    Vikas:

    In the field "attributes button" button type "id ="Ceboutonsélectionnel".

    Edit the button template to include the #BUTTON_ATTRIBUTES substitution string #. This should be put in the anchor tag in the template definition.
    Change your Javascript to reference the ID above as

    ....
    html_GetElement ('thisButton').disabled = true;
    ....
    

    CITY

  • 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.

  • How to create screen saver using the java bean

    Hi all

    can someone knows how to create screen saver using java beans?

    Thanks in advance.
    Sarah

    It is a strange requirement, but you can go

    A TIME-NEW-FORM-INSTANCE:

    DECLARE timer_id Timer;
     one_minute NUMBER(5) := 60000;
    BEGIN
     timer_id := CREATE_TIMER('chnage_color', one_minute, REPEAT);
    END; 
    

    WHEN-TIMER-EXPIRED:

    DECLARE
         RandomR NUMBER(10):=dbms_random.value(1,256);
         RandomG NUMBER(10):=dbms_random.value(1,256);
         RandomB NUMBER(10):=dbms_random.value(1,256);
    BEGIN
    
     SET_CANVAS_PROPERTY('CANVAS2',BACKGROUND_COLOR, 'R'||RandomR||'G'||RandomG||'B'||RandomB);
    END; 
    
  • How to remove networko on windows 7?

    How to remove the network using windows 7?

    1. in the center of sharing, I pressed "set up a new connection or network".
    2 then "set up a new network.
    3. then, I chose my TP-LINK
    4 boom! I named it "NeriuX Internet community"
    5. I have my Android phone. So, I want to connect to my WiFi router.

    Question: How do delet network step 2?

    Hi Nicole,.

    Please refer to the article:

    http://TechNet.Microsoft.com/en-us/library/gg252588 (v = ws.10) .aspx

    Please let us know if you need more assistance. We will be happy to help you.

  • Alteration of the content of an XML node in java

    Hi all

    I change the contents of an XML node using java, using the method of setTextContent() a node.

    Sometimes I also add child nodes of a node. In this case, when I add the child nodes of a given node, when I print the xml data, I see the added nodes.

    for example:

    Initial XML:

    < a > < / a >
    < b > < / b >
    < c > < / c >


    For my project requirement, based on certain conditions, I do 'a' 'b', 'c' as children nodes nodes. I reached this output.


    The problem is

    FINAL XML:

    < a > < b > < / b > < c > < / c > < / a >


    I get the nodes children in the same line as above. But the power required should be as below.


    REQUIRED XML

    < a >
    < b > < / b >
    < c > < / c >
    < /a >

    I also used the Doc.normalize () function. But still, it helps strength.

    Kindly help me in this regard.

    Thank you
    Sabarisri. N

    Hello

    You can try to transform the result as below:

    Transformer transformer = TransformerFactory.newInstance () .newTransformer ();
    transformer.setOutputProperty (OutputKeys.INDENT, 'yes');

    initialize the StreamResult with the object of the file to save to file
    StreamResult result = new StreamResult (new StringWriter());

    DOMSource source = new DOMSource (doc); Here, the doc is you XML document.
    transform. Transform (source, result);

    String xmlString = result.getWriter (m:System.NET.SocketAddress.ToString ());
    System.out.println (xmlString);

    Thank you best regards &,.
    Nilesh Sahni (www.infocepts.com)

    Published by: Nilesh on August 30, 2011 12:31

  • How can I remove Flash Player and Java.

    I heard recently that Java and Flash Player are unnecessary and dangerous to have on your mac. I can't understand how to remove however.

    Someone told me to go to this link, is it reliable? (this is not a https that is why I asked.)

    http://Java.com/en/download/help/mac_uninstall_java.XML

    Download uninstaller for Adobe.

    You can find it https://helpx.adobe.com/flash-player/kb/uninstall-flash -Player-mac - os.html? sdid = 952G4XMS & skim803X112722X93c5ed8aaad2bcfb...

    There is a different version depending on the age of your operating system.

    Start the uninstall program of your download on your Mac folder.

    When the uninstall program runs, click on uninstall

    Enter your admin password and close all your browsers.

    Uninstall is complete it is also wise to delete the two folders, according to Adobe. These appear in the library of the House of the directory folder. Go to Finder, click on reach in the menu and press Alt (or Option) to present the case of the library as a menu drop-down. Look for these two folders and delete them:

    ~/Library/Preferences/Macromedia/Flash\ Player

    ~/Library/caches/Adobe/Flash\ Player

Maybe you are looking for