You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Anjul Srivastava <an...@anjul.com> on 2001/03/26 01:40:42 UTC

SVG serving problem

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20001102//EN" 
  "http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd">
<svg width="12cm" height="4cm">
  <desc>Example rect01 - rectangle expressed in physical coordinates</desc>
  <rect x="4cm" y="1cm" width="4cm" height="2cm"
        style="fill:yellow; stroke:navy; stroke-width:0.1cm" />
</svg>

Try as I might I cannot get cocoon to serve this file as an SVG file such that my browser recognizes it as an SVG file and invokes the plug-in. Could somebody please tell me the cocoon processing/formatting instructions necessary to get Cocoon to serve the file in such a way that my Internet Explorer with the Adobe SVG 2.0 beta plugin recognizes it as SVG and renders it as such?

As of now, I access this file from : http://www.w3.org/TR/SVG/images/shapes/rect01.svg and it renders fine in my browser. But if I copy this file into my own web site: http://www.anjul.com/rect01.svg it shows up in my browser as a regular XML file (the plugin is not invoked and it is not rendered).

Thank you,
Anjul.

Re: SVG serving problem

Posted by Gritsenko <vg...@acm.org>.
http://www.anjul.com/rect01.svg

works for me too!

Something wrong with your svg plug-in.
It may be that your browser security settings make browser treat
application/svg type of content as one
that should not be handled.

Viktor


----- Original Message -----
From: Bartlomiej Pater <no...@poland.com>
To: Anjul Srivastava <co...@xml.apache.org>
Sent: Sunday, March 25, 2001 7:16 PM
Subject: Re: SVG serving problem


> Hello Anjul,
>
> Monday, March 26, 2001, 1:40:42 AM, you wrote:
>
> AS> As of now, I access this file from :
http://www.w3.org/TR/SVG/images/shapes/rect01.svg and it renders fine in my
browser. But if I copy this file into my own web site:
> AS> http://www.anjul.com/rect01.svg it shows up in my browser as a regular
XML file (the plugin is not invoked and it is not rendered).
>
> hmmm, strange. it works perfectly for me...
> [from your site]
>
> n.
>
>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: SVG serving problem

Posted by Bartlomiej Pater <no...@poland.com>.
Hello Anjul,

Monday, March 26, 2001, 1:40:42 AM, you wrote:

AS> As of now, I access this file from : http://www.w3.org/TR/SVG/images/shapes/rect01.svg and it renders fine in my browser. But if I copy this file into my own web site:
AS> http://www.anjul.com/rect01.svg it shows up in my browser as a regular XML file (the plugin is not invoked and it is not rendered).

hmmm, strange. it works perfectly for me...
[from your site]

n.



---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: SVG serving problem

Posted by Anjul Srivastava <an...@anjul.com>.
It would be nice if points 4 and 5 below could be overcome
but I suspect it is a Tomcat issue or something that I am
doing wrong. That would enable me to get around the
workaround of appending "?dummy=rect01.svg". Of course, the
problem maybe with Adobe's SVG viewer for Internet Explorer,
or with MSIE itself.

Thanks,
Anjul.

----- Original Message -----
From: "Anjul Srivastava" <an...@anjul.com>
> Okay, I found the problem. I thought I should share the
> observations for anybody else trying to do similar stuff:
>
> 1. cocoon ignores any file that does not match the pattern
> *.xml
> 2. Adobe's SVG viewer ignores any file that does not match
> the pattern *.svg
> 3. You can change the pattern that cocoon matches by
> modifying <url-pattern/> in WEB-INF/web.xml
> 4. You CANNOT (rather, I could not) specify multiple
> patterns *.xml and *.svg in web.xml.
> 5. You CANNOT (rather, I could not) specify a pattern of
*.*
> or * in web.xml.
>
> The solution:
>
> 6. When a cocoon URL is accessed with "?dummy=xxx.yyy"
> appended, cocoon translates the SERVED file name as if it
> were xxx.yyy. So, instead of accessing:
> http://www.anjul.com/rect01.xml I access:
> http://www.anjul.com/rect01.xml?dummy=rect01.svg
> 7. In the XML file, add as the second line:
<?cocoon-format
> type="image/svg-xml"?> (this is an obvious step)



---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: SVG serving problem

Posted by Steve Muench <St...@oracle.com>.
Also, one problem I found serving SVG from the Oracle XSQL Servlet
was that earlier releases of the Adobe SVG plugin (maybe even
the current ones) did not like having the character-set information
in the ContentType.

If the servlet sent a ContentType of:

image/svg; charset=UTF-8

the dynamically-served SVG would get ignored,
while a ContentType of:

image/svg

would get recognized ok.

Not sure if this has something to do with how the plug-in
registers itself with IE5 or something, but in any event
removing the character set information solved the problem.

______________________________________________________________
Steve Muench, Lead XML Evangelist & Consulting Product Manager
BC4J & XSQL Servlet Development Teams, Oracle Rep to XSL WG
Author "Building Oracle XML Applications", O'Reilly
http://www.oreilly.com/catalog/orxmlapp/

----- Original Message -----
From: "Sebastien Koechlin" <sk...@ivision.fr>
To: <co...@xml.apache.org>
Sent: Monday, March 26, 2001 8:11 AM
Subject: Re: SVG serving problem


| Anjul Srivastava wrote:
| >
| > Okay, I found the problem. I thought I should share the
| > observations for anybody else trying to do similar stuff:
| >
| > 1. cocoon ignores any file that does not match the pattern
| > *.xml
|
| Wrong: your web-server and/or your servlet engine are not
| configured to send request to Cocoon except thoses matching
| *.xml; in any case, cocoon accept any request!
|
| > 2. Adobe's SVG viewer ignores any file that does not match
| > the pattern *.svg
|
| With IE, plugins are triggered by file extention, this is why
| you have to add something like "?a=a.svg"; usually, plugins are
| triggered by MIME-Type send by server.
|
| Is your svg file static? You can configure your webserver to
| send the right MIME-Type, and do not use Cocoon, this would
| be really faster.
|
| > 3. You can change the pattern that cocoon matches by
| > modifying <url-pattern/> in WEB-INF/web.xml
| > 4. You CANNOT (rather, I could not) specify multiple
| > patterns *.xml and *.svg in web.xml.
| > 5. You CANNOT (rather, I could not) specify a pattern of *.*
| > or * in web.xml.
|
| You should read Java Servlet specification 2.2 Chapter 10
| "Mapping Requests to Servlets"
| You can also look at chapter 13.2, which is the web.xml
| DTD, it's quite unreadable, but usefull where you have
| an error in web.xml
|
| You can find it at
| http://java.sun.com/products/servlet/download.html
|
| --
| Sébastien Koechlin - IVision - skoechlin@ivision.fr
|
| ---------------------------------------------------------------------
| Please check that your question has not already been answered in the
| FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
|
| To unsubscribe, e-mail: <co...@xml.apache.org>
| For additional commands, e-mail: <co...@xml.apache.org>
|
|


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: SVG serving problem

Posted by Sebastien Koechlin <sk...@ivision.fr>.
Anjul Srivastava wrote:
> 
> Okay, I found the problem. I thought I should share the
> observations for anybody else trying to do similar stuff:
> 
> 1. cocoon ignores any file that does not match the pattern
> *.xml

Wrong: your web-server and/or your servlet engine are not
configured to send request to Cocoon except thoses matching
*.xml; in any case, cocoon accept any request!

> 2. Adobe's SVG viewer ignores any file that does not match
> the pattern *.svg

With IE, plugins are triggered by file extention, this is why
you have to add something like "?a=a.svg"; usually, plugins are
triggered by MIME-Type send by server.

Is your svg file static? You can configure your webserver to
send the right MIME-Type, and do not use Cocoon, this would
be really faster.

> 3. You can change the pattern that cocoon matches by
> modifying <url-pattern/> in WEB-INF/web.xml
> 4. You CANNOT (rather, I could not) specify multiple
> patterns *.xml and *.svg in web.xml.
> 5. You CANNOT (rather, I could not) specify a pattern of *.*
> or * in web.xml.

You should read Java Servlet specification 2.2 Chapter 10
"Mapping Requests to Servlets"
You can also look at chapter 13.2, which is the web.xml
DTD, it's quite unreadable, but usefull where you have
an error in web.xml

You can find it at
http://java.sun.com/products/servlet/download.html

-- 
Sébastien Koechlin - IVision - skoechlin@ivision.fr

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: SVG serving problem

Posted by Anjul Srivastava <an...@anjul.com>.
Okay, I found the problem. I thought I should share the
observations for anybody else trying to do similar stuff:

1. cocoon ignores any file that does not match the pattern
*.xml
2. Adobe's SVG viewer ignores any file that does not match
the pattern *.svg
3. You can change the pattern that cocoon matches by
modifying <url-pattern/> in WEB-INF/web.xml
4. You CANNOT (rather, I could not) specify multiple
patterns *.xml and *.svg in web.xml.
5. You CANNOT (rather, I could not) specify a pattern of *.*
or * in web.xml.

The solution:

6. When a cocoon URL is accessed with "?dummy=xxx.yyy"
appended, cocoon translates the SERVED file name as if it
were xxx.yyy. So, instead of accessing:
http://www.anjul.com/rect01.xml I access:
http://www.anjul.com/rect01.xml?dummy=rect01.svg
7. In the XML file, add as the second line: <?cocoon-format
type="image/svg-xml"?> (this is an obvious step)

That causes the SVG image to be successfully displayed by
the Adobe SVG viewer. And all's fine with the world :)

Tip:

  <xsl:template match="svg">
   <a href="{@name}.xml?dummy={@name}.svg"><xsl:value-of
select="@name"/></a>
     <xsl:apply-templates/>
  </xsl:template>

I use the above stylesheet template to automatically add on
the .xml and .svg tags. In my .xml file containing the
links, I add:

   <svg name="rect01"/>
   <svg name="clock"/>
   <svg name="circles"/>

Thanks to everybody for trying my link and helping me out in
figuring the problem. I appreciate it a lot.

Cheers,
Anjul.

----- Original Message -----
From: Anjul Srivastava
Try as I might I cannot get cocoon to serve this file as an
SVG file such that my browser recognizes it as an SVG file
and invokes the plug-in. Could somebody please tell me the
cocoon processing/formatting instructions necessary to get
Cocoon to serve the file in such a way that my Internet
Explorer with the Adobe SVG 2.0 beta plugin recognizes it as
SVG and renders it as such?


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>