Dynamic SVG content generation

From: Tiago <diariodastrilhas_at_gmail.com>
Date: Mon, 3 Aug 2009 07:53:05 -0700 (PDT)
Message-ID: <e63b668c-2bbf-43be-8312-3ac23b2c1aa3_at_g31g2000yqc.googlegroups.com>


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"

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


Tiago Received on Mon Aug 03 2009 - 09:53:05 CDT

Original text of this message