Re: Dynamic SVG content generation

From: Jeremy <>
Date: Mon, 3 Aug 2009 16:11:14 +0100
Message-ID: <MPG.24e10e6ef31574ac98976e_at_News.Individual.NET>

In article <e63b668c-2bbf-43be-8312-3ac23b2c1aa3>, says...>
> Hi,
> I have a web page generated through Oracle HTTP Server gateway.
> This webpage features a series of bar, line and pie graphics that are
> pre-generated SVG files within iframes:
> <iframe src="moves.svg" width="540" height="450" scrolling="no"
> frameborder="0">
> this work great (aside not working nativelly in IE, but that's another
> issue) but latelly, users are asking to make their customized
> graphics, they want to input the time period for the graphic. I tried:
> <iframe src="reports.moves_dyn?year=' || p_year || '" width="540"
> height="450" scrolling="no" frameborder="0">
> where "reports" is the package name, moves_dyn is the procedure within
> the package, year is the parameter for moves_dyn and p_year is the
> parameter for the year the user wants the graph to be generated.
> When doing this, the procedure generates the SVG doc returning with
> "htp.p" calls. The problem is that the iframe doesn't display the
> graphic, it only displays loose text within <text> tags on the SVG
> file. In other words, the server is treating it like it was a HTML
> file. If I save the generated text (with right click and asking
> browser for iframe's source), it returns me the entire SVG. This code
> works perfectly if I save it on a file and open it with browser.
> What's puzzling (well, not that much...) is if the moves_dyn procedure
> instead of SVG generate regular HTML, it's displayed just fine, which
> lead me to think is something wrong with the http server that's not
> recognizing it as SVG, despite it has all the required headers and the
> file's syntax is ok.
> The question is: Has anyone done anything like this? Does anyone know
> any way I could generate dynamic SVG apart generating one file at the
> server every time an user decides that he needs different periods for
> the graphs? This way I'd have a mess of files that I'd have to worry
> about excluding later...

Hi, try seetting the mime type explicitlyin your reports.moves_dyn procedure.


      owa_util.mime_header('text/xml; charset=UTF-8', false);

Obviously changing text/xml and charset appropriately

Let me know if it works.

Received on Mon Aug 03 2009 - 10:11:14 CDT

Original text of this message