Link to home
Start Free TrialLog in
Avatar of ramadevimandala
ramadevimandalaFlag for India

asked on

need to convert CLOB sxml data to xml files

Hi,

In my JSP code I want to convert the clob data(in xml format) to XML file which can be stored in any directory .
I am pasting my XML data which is there in CLOB.
please provide the solution asap.
Thanks,
Rama
<chart xaxisname="Ethnic Origin" yaxisname="Employees" palette="4" decimals="0" enableSmartLabels="1" enableRotation="0" bgColor="99CCFF,FFFFFF" bgAlpha="40,100" bgRatio="0,100" bgAngle="360" showBorder="1" startingAngle="250">
<set label="American Indian or Alaska Native (Not Hispanic or Latino)" value="11"/>
<set label="Asian (Not Hispanic or Latino)" value="14"/>
<set label="Black or African American (Not Hispanic or Latino)" value="50"/>
<set label="Hispanic or Latino" value="22"/>
<set label="Native Hawaiian/Other Pacific Islander(Not Hispanic/Latino)" value="5"/>
<set label="White (Not Hispanic or Latino)" value="257"/>
<set label="" value="273"/>
</chart>

Open in new window

Avatar of Gibu George
Gibu George
Flag of India image

Hello ramadevimandala,
Use an output stream and write it to file.


Regards,

gibu_george
Avatar of ramadevimandala

ASKER

Hi,
I have already tried in that way, here is my code. but this is not generating the file in current dir .
here xmlVal is the CLOB
long  v_len          = xmlVal.length();
          xmlValbuff = xmlVal.getSubString(1,(int)v_len);
          byte[] b=xmlValbuff.getBytes();
          try{        
            FileOutputStream output = new FileOutputStream(new File("FirstChartData.xml"));
            output.write(b);
            output.flush();
            output.close();
          } catch (IOException e) {
              System.out.println("IOException " + e.getMessage());
          }

please tell me if I am wrong
Is there any exceptions?
No not getting any execption
ASKER CERTIFIED SOLUTION
Avatar of Gibu George
Gibu George
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hmmm, my code was generating XML but OC4j server not storing in current directory it is storing in ..\OAF\jdevhome\jdev\system9.0.3.5.1447\oc4j-config , that I could not figured it out.
Now after giving the absolute path it is generating fine.
Thank you for your help George.