Extracting xml from BLOB and display on the Browser on the fly using xslt

HI All,
I am storing my xml file in BLOB in oracle database.
Now in my java-jsp application, I want to display this xml file, by extracting from BLOB in a formatted/html way...( XSLT/CSS Style) on the fly.. means without storing it as a .xml file.
Pl. guide me...
Thanks in advance.
Sandeep Oza

First, can you get an InputStream that allows you to read the XML from the BLOB?
If you can, then simply get a Transformer object for your XSLT, then calltransform(new StreamSource(yourInputStream), new StreamResult(resp.getOutputStream()));Since you won't be writing any HTML for this, there's no point in putting it in a JSP, either. A servlet would be more suitable.

Similar Messages

  • How to retrieve xml file from BLOB and display on browser with css/xslt

    Hi All,
    I am new to xml. I am storing my xml file into BLOB in database. Now in my jsp page I want to retrieve this xml file from BLOB and display in HTML/CSS/XSLT form...
    Pl. guide me.. any docs..?? Logic...??
    Thanks in Advance.
    Sandeep Oza

    Hello Sandeep!
    I'm not familiar with jsp but logic should be as follows:
    -in jsp page instantiate XML parser
    -load specified BLOB into parser
    Now you may traverse the XML tree or you might load XSL file and use transform method to transform XML according to XSL file.
    I have an example where I'm selecting XML straight from relational database and then transform it using XSL into appropriate HTML output, but it's written in PSP.
    You can try http://www.w3schools.com/default.asp for basics on XML, CSS, XSL. It's easy to follow with good examples.
    Regards!
    miki

  • XSQLActionHandler extracting XML from ViewObject not displaying on XSQL pag

    I have the following XSQLActionHandler for a STRUTS project which is supposed to extract the XML from a view object. When I call this from a xsql page I get nothing. I have examined the Node (n) and have seen that it does get XML but after I assign it to root nothing shows up on the XSQL page. Any ideas about what might be wrong?
    package XSQLActionHandler;
    import oracle.xml.xsql.XSQLActionHandlerImpl;
    import oracle.xml.xsql.XSQLServletPageRequest;
    import oracle.xml.xsql.XSQLPageRequest;
    import org.w3c.dom.Node;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.ServletContext;
    import oracle.jbo.html.BC4JContext;
    import oracle.jbo.ViewObject;
    import oracle.jbo.XMLInterface;
    import oracle.xml.parser.v2.XMLNode;
    import oracle.jbo.html.databeans.XmlData;
    public class ActionHandlerTestVO extends XSQLActionHandlerImpl {
    public void handleAction(Node root) {
    XSQLServletPageRequest xspr = (XSQLServletPageRequest)getPageRequest();
    HttpServletRequest request = xspr.getHttpServletRequest();
    BC4JContext context = BC4JContext.getContext(request);
    XSQLActionHandlerModuleImpl appmod = (XSQLActionHandlerModuleImpl) context.getApplicationModule();
    ViewObject vo = context.getApplicationModule().findViewObject("DisciplineView1");
    Node n = (Node) vo.writeXML(1, XMLInterface.XML_OPT_ALL_ROWS);
    root=n;

    You need to append your generated content as a child of "root".
    It's best practice if you call adoptNode() on it first before appending it.
    Like this:
    XMLDocument rootDoc = (XMLDocument)root.getOwnerDocument();
    rootDoc.adoptNode(n);
    root.appendChild(n);

  • Extracting file from blob and storing in file system

    In order to keep the database size down, I would like to run a program to execute on submit of a page containing a file upload control, which will extract the file from the blob in the db and store it in the operating system.
    Any suggestions on how I can accomplish this?

    I use something like this
      procedure blob2file
        ( p_blob blob
        , p_directory varchar2 := 'MY_DIR'
        , p_filename varchar2 := 'my.xlsx'
      is
        t_fh utl_file.file_type;
        t_len pls_integer := 32767;
      begin
        t_fh := utl_file.fopen( p_directory
                              , p_filename
                              , 'wb'
        for i in 0 .. trunc(  ( dbms_lob.getlength( p_blob ) - 1 ) / t_len )
        loop
          utl_file.put_raw( t_fh
                          , dbms_lob.substr( p_blob
                                           , t_len
                                           , i * t_len + 1
        end loop;
        utl_file.fclose( t_fh );
      end;Anton

  • Problem in retreiving from database and viewing it in browser--urgent

    hai,
    i have develped an application using swings where the mails received from client and reply posted will be pasted in JEditorPane. all the mails,query and reply will be stored in database.
    then iam retrieving the mails from database and displaying it in browser using table data.(Just like forum). Iam using encodehtmltag function to omit the html tags that r present in the mail data.
    when i display it in browser it extends a page horizontically. how to avoid this. how to word wrap. one of my friend asked me to set number of character to be displayed per line. i did that. but problem is i could see the word break . i have set 90 characters to be displayed per line. i dont want to break the word. for eg., if the end string of a line is regarding it is displayed like this---reg and then arding in next line. how to avoid this.
    please help me iam breaking my head with this for past few days.

    If the field is a Date in your database, you can use the ResultSet.getDate() method, which will return a java.sql.Date (which extends java.util.Date).
    You can then use SimpleDateFormat to format it the way you like.
    See the API doc for more details.

  • Call  RFC from ECC and display the values in  AET

    Hi ALL,
    I had an RFC in ECC ( Z_CRM_SPEC_DATA) this should be called into my AET Fields in getter method.
    In getter method of tat AET field what code should i write?
    Plz help me on this.

    HI,
    1) Call the  RFC(Z_CRM_SPEC_DATA) from ECC and display the values as mentioned in below AET fields.
    AET FIELDS :    zzfld00000M    zzfld00000N
    Description  :    Budget Quan    Forecast Quan
    values         :    (--5.0)(6.0--
    2) (Fetch Budget and Forecast data from ECC ),you would need to pass Material Number(MATNR) as well as Ship to party info to fetch the budget and forecast data as one material may be assigned to 2 or more SH with specific budget and forecast data for each.
    Edited by: venkatabharathv on May 23, 2011 2:44 PM
    Edited by: venkatabharathv on May 23, 2011 2:49 PM

  • Problem in Retrieve Image from DB and display in the JSP page

    Hi All,
    I did one JSP Program for retriveing image from DB and display in the JSP Page. But when i run this i m getting "String Value" output. Here i have given my Program and the output. Please any one help to this issue.
    Database Used : MS Access
    DSN Name : image
    Table Name: image
    Image Format: bmp
    Output : 1973956
    Sample Program:_
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ page import="java.io.*" %>
    <%
         try{
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              Connection conn = DriverManager.getConnection("jdbc:odbc:image");
              Statement st = conn.createStatement();
              ResultSet rs = st.executeQuery("SELECT images FROM image");
              String imgLen="";
              if(rs.next()){
                   imgLen = rs.getString(1);
                   out.println(imgLen.length());
              if(rs.next()){
                   int len = imgLen.length();
                   byte [] rb = new byte[len];
                   InputStream readImg = rs.getBinaryStream(1);
                   int index=readImg.read(rb, 0, len);
                   System.out.println("index"+index);
                   st.close();
                   response.reset();
                   response.setContentType("image/jpg");
                   response.getOutputStream().write(rb,0,len);
                   response.getOutputStream().flush();
         }catch(Exception ee){
              out.println(ee);
    %>
    Thanks,
    Senthilkumar S

    vishruta wrote:
    <%
    %>Using scriptlets is asking for trouble. Java code belongs in Java classes. Use a Servlet.
                   out.println(imgLen.length());Your JSP was supposed to write an image to the output and you wrote some irrelevant strings to the output before? This will corrupt the image. It's like opening the image in a text editor and adding some characters before to it.
                   byte [] rb = new byte[len];Memory hogging. Don't do that.
              out.println(ee);You should be throwing exceptions and at least printing its trace, not sending its toString() to the output.
    You may find this article useful to get an idea how this kind of stuff ought to work: [http://balusc.blogspot.com/2007/04/imageservlet.html].

  • Tried to install OS X Yosemite on my MacBook. Got message that it could not be installed on my computer due to error while extracting files from package "Essentials.pkg". When i quit the installer as recommended it goes in a loop and gets stuck.

    Tried to install OS X Yosemite on my MacBook. Got message that it could not be installed on my computer due to error while extracting files from package "Essentials.pkg". When i quit the installer as recommended it goes in a loop and gets stuck.

    Hey corrafromlondon,
    Thanks for the question. After reviewing your post, it sounds like the installer file isn't working. Have you tried deleting the installer and redownloading the installer? I would recommend that you read this article, it may be able to help you isolate or resolve the issue.
    How to install OS X Yosemite on your Mac - Apple Support
    you can find the Yosemite installer app in your Applications folder or Launchpad. 
    Thanks for using Apple Support Communities.
    Have a nice day,
    Mario

  • Create a Word document in a OLE container, save it in a BLOB and display it in a rep!

    When im saving a worddoc like a OLE container in a BLOB and trying to display it in a report the text does not look exactly like it did in word. What i happening whit the doc while saving it into the BLOB and tryning to display it in another OLE container?
    Best Regards
    Fredrik Hammarqvist

    You might want to add a browser layer over your flex
    application and let the browser manage the file types. I personally
    use the HTML component from
    http://drumbeatinsight.com/.

  • Store and Display doc/pdf files in the database using Forms

    Hi all,
    How can i store and display doc/pdf files in the database using Forms 10g?.
    Arif

    How to get up and running with WebUtil 1.06 included with Oracle Developer Suite 10.1.2.0.2 on a win32 platform
    Solution
    Assuming a fresh "Complete" install of Oracle Developer Suite 10.1.2.0.2,
    here are steps to get a small test form running, using WebUtil 1.06.
    Note: [OraHome] is used as an alias for your real oDS ORACLE_HOME.
    Feel free to copy this note to a text editor, and do a global find/replace on
    [OraHome] with your actual value (no trailing slash). Then it is easy to
    copy/paste actual commands to be executed from the note copy.
    1) Download http://prdownloads.sourceforge.net/jacob-project/jacob_18.zip
      and extract to a temporary staging area. Do not attempt to use 1.7 or 1.9.
    2) Copy or move jacob.jar and jacob.dll
      [JacobStage] is the folder where you extracted Jacob, and will end in ...\jacob_18
         cd [JacobStage]
         copy jacob.jar [OraHome]\forms\java\.
         copy jacob.dll [OraHome]\forms\webutil\.
      The Jacob staging area is no longer needed, and may be deleted.
    3) Sign frmwebutil.jar and jacob.jar
      Open a DOS command prompt.
      Add [OraHome]\jdk\bin to the PATH:
         set PATH=[OraHome]\jdk\bin;%PATH%
      Sign the files, and check the output for success:
         [OraHome]\forms\webutil\sign_webutil [OraHome]\forms\java\frmwebutil.jar
         [OraHome]\forms\webutil\sign_webutil [OraHome]\forms\java\jacob.jar
    4) If you already have a schema in your RDBMS which contains the WebUtil stored code,
      you may skip this step. Otherwise,
      Create a schema to hold the WebUtil stored code, and privileges needed to
      connect and create a stored package. Schema name "WEBUTIL" is recommended
      for no reason other than consistency over the user base.
      Open [OraHome]\forms\create_webutil_db.sql in a text editor, and delete or comment
      out the EXIT statement, to be able to see whether the objects were created witout
      errors.
      Start SQL*Plus as SYSTEM, and issue:
         CREATE USER webutil IDENTIFIED BY [password]
         DEFAULT TABLESPACE users
         TEMPORARY TABLESPACE temp;
         GRANT CONNECT, CREATE PROCEDURE, CREATE PUBLIC SYNONYM TO webutil;
         CONNECT webutil/[password]@[connectstring]
         @[OraHome]\forms\create_webutil_db.sql
         -- Inspect SQL*Plus output for errors, and then
         CREATE PUBLIC SYNONYM webutil_db FOR webutil.webutil_db;
      Reconnect as SYSTEM, and issue:
         grant execute on webutil_db to public;
    5) Modify [OraHome]\forms\server\default.env, and append [OraHome]\jdk\jre\lib\rt.jar
      to the CLASSPATH entry.
    6) Start the OC4J instance
    7) Start Forms Builder and connect to a schema in the RDBMS used in step (4).
      Open webutil.pll, do a "Compile ALL" (shift-Control-K), and generate to PLX (Control-T).
      It is important to generate the PLX, to avoid the FRM-40039 discussed in
      Note 303682.1
      If the PLX is not generated, the Webutil.pll library would have to be attached with
      full path information to all forms wishing to use WebUtil. This is NOT recommended.
    8) Create a new FMB.
      Open webutil.olb, and Subclass (not Copy) the Webutil object to the form.
      There is no need to Subclass the WebutilConfig object.
      Attach the Webutil.pll Library, and remove the path.
      Add an ON-LOGON trigger with the code
             NULL;
      to avoid having to connect to an RDBMS (optional).
      Create a new button on a new canvas, with the code
             show_webutil_information (TRUE);
      in a WHEN-BUTTON-PRESSED trigger.
      Compile the FMB to FMX, after doing a Compile-All (Shift-Control-K).
    9) Under Edit->Preferences->Runtime in Forms Builder, click on "Reset to Default" if
      the "Application Server URL" is empty.
      Then append "?config=webutil" at the end, so you end up with a URL of the form
          http://server:port/forms/frmservlet?config=webutil
    10) Run your form.sarah

  • How to Extract Data from SAP and Load it into Essbase

    Hi All,
    Can you recommend some ways to extract data from SAP and load it into Essbase?. I have no knowledge about SAP, not sure how I can perform this task. Can I use ODI for this job?
    Thanks

    hi,
    Not sure if this helps but give a try
    you can create connection from EAS to SAP .. using a plug-in .. if you have access to oracle Support go for [ID 968961.1]
    or
    below are steps
    1. In EASPATH\console, open components.xml in a text editor.
    2. Under <PluginList>, enter <Plugin archiveName="SAP" packageName="com.essbase.eas.sap.ui"/> before the closing </PlugIn> tag.
    3. Save and close the file.
    4. In EASPATH\console\bin, open admincon.lax in a text editor.
    5. Search for lax.class.path= and append ;..\lib\sap_client.jar;..\lib \sap_common.jar to the entry. Save and close the file.
    6. In EASPATH\server\bin, open adminsvr.lax in a text editor.
    7. Search for lax.nl.java.option.additional, and append -DRFC_INI=EASPATH\server\saprfc.ini. Save and close the file.
    8. Create a new environment variable, RFC_INI, with a value of EASPATH\server\saprfc.ini
    9. Copy librfc.dll andsapjcorfc.dll to EASPATH\server\bin. You may need to obtain these files from SAP.
    let me know if it works :)

  • Can't reinstall osx lion from internet, and display a message"cannot find installation information ,please contact applecare, what should i do?

    hello
    I can't reinstall osx lion from internet, and display a message"cannot find installation information ,please contact applecare, what should i do?
    thanks

    I'm no Lion expert, but I believe you can boot from the Recovery partition by pressing the Command and R keys on startup, then reinstall.

  • How to extract keyframe from AVI and MPG

    Hi guy,
    I'm Marco and I'm using JMF; I need for an help because I don't know how to extract keyframes from AVI and MPG files.
    I'm using the code posted in this forum for extracting all frame in a video with the adding of an if expression that in the accessFrame method that I report below:
    void accessFrame(Buffer frame) {
    BufferToImage stopBuffer = new BufferToImage((VideoFormat) frame.getFormat());
    Image stopImage = stopBuffer.createImage(frame);
    try {
    BufferedImage outImage = new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_RGB);
    Graphics og = outImage.getGraphics();
    og.drawImage(stopImage, 0, 0, size.width, size.height, null);
    Iterator writers = ImageIO.getImageWritersByFormatName("jpg");
    ImageWriter writer = (ImageWriter) writers.next();
    File f = new File(frame.getSequenceNumber() + ".jpg");
    {color:#ff0000}
    if ((frame.getFlags() & Buffer.FLAG_KEY_FRAME) != 0){{color}
    {color:#ff9900}
    ImageOutputStream ios = ImageIO.createImageOutputStream(f);
    writer.setOutput(ios);
    {color}
    {color:#ff9900}
    writer.write(outImage);
    ios.close();}
    } catch (IOException e) {{color}
    System.out.println("Error :" + e);
    So, I'm able to extract some keyframe, but i'm not sure it is the correct way and my dubt grows out of the fact that without the if expression highlighted in red, it seems that I have more keyframes (those ones with flag ==1040). Another problem is that it works only with AVI because MPG instead of 1040, they have alternate sequence of 32 and 1056.
    Cheers and thank u
    Marco

    my email-id is [email protected].. anyone plz send me the codings for extracting all the frames from a video..

  • How to extract data from SAP and COBOL using ODI

    Hi Folks,
    Can you please let me know the procedures in ODI to extract data from SAP and COBOL?
    Thank you all for the help.

    Hi
    You can download Patch 8571830 from Oracle metalink.
    It has a new technology "SAP ABAP" and KMs to extract and load data -
    RKM SAP ERP and LKM SAP ERP to Oracle.
    Thanks

  • Extract data from mm and fi

    Hi guys,
    I have lined up an interview tomorrow where the client wants the person to extract data from mm and fi for a pharma company. What are the things I should concentrate on.
    Sincerely

    Hi,
    Go help.sap.com ..business content part of MM & FI and browse through what all reporting content is delivered by SAP in these two areas.
    Also check on how is FI data extracted & how is MM data extracted.
    hope it helps
    Regards
    Vikash

Maybe you are looking for

  • Stop Safari pages from reloading when selected.

    Safari in iPad is driving me crazy. Unlike tabs in Safari for Mac, the pages on the iPad seem to be hardwired to reload when you select them (I usually have several pages open and need to switch back and forth between them). And that means lots of wa

  • Export and Import PST corrupting mailbox folder structure

    Hi, I have an old Exchange 2003 mailserver which I am replacing with Exchange 2013 server. I am doing a fresh install in a new domain and will import the old mailboxes (5) via PST's. I have exported the mail from Exchange 2003 using exmerge to PST fi

  • Having troulbe viewing pdf files in my adobe reader

    I am having trouble seeing some pdf files like income tax returns or my sons fafsa application both online and when i try to uninstall to reinstall to see if that would fix the problem, in my add/remove programs it comes up and says "this patch packa

  • I cannot get iTunes 7 to download

    It started when I reset my PC. When i got it to work correctly, iTunes was the only thing that would not come up. I tried downloading it from the site, but whenever i try nothing happens. It brings me to the 'Thank You' page but no download box appea

  • HT5548 How do I get an App like iCal to launch on startup?

    It has been a few years. But when I added Skype, I was able to get it to load on start up. I've forgotten how. I can't seem to find the answer and I'd like iCal to load on start up.