You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by James Ashton <ja...@yahoo.com> on 2002/10/05 14:08:44 UTC
svg2jpeg not working properly.
Hi,
I'm a fairly new Cocoon user and have encountered a weird
problem that I've not been able to solve. I have an SVG
File which consists of a JPEG image and a Text string. I
have broken that up into a Stylesheet. Once the transform
is done, it is serialized to JPEG before rendering to the
browser. I've done this so that I can automatically put a
copyright notice (or other message) on images before web
delivery.
I did get this working (honest!) but it seemed to just stop
working (in that I'm not aware that I did anything that
could have broken it). However if I serialize to SVGXML it
works fine (so I'm 99.9% sure the stylesheet is still
fine). If I try to serialize the original SVG file to JPEG
it doesn't work.
Here are the relavent sections of my site map to illustrate
what I'm saying:
<!-- This works -->
<map:match pattern="picture.svg">
<map:generate src="docs/picture.xml"/>
<map:transform src="stylesheets/picture.xsl"/>
<map:serialize type="svgxml"/>
</map:match>
<!-- These don't work -->
<map:match pattern="picture.jpg">
<map:generate src="docs/picture.xml"/>
<map:transform src="stylesheets/picture.xsl"/>
<map:serialize type="svg2jpeg"/>
</map:match>
<map:match pattern="testpicture.jpg">
<map:generate src="picture.svg"/>
<map:serialize type="svg2jpeg"/>
</map:match>
The strange thing is that there are no log messages and a
jpeg IS rendered. I've made that available on
http://www10.brinkster.com/jamesashton/broken.jpg
However it only renders the text layered over the top. The
png which is the source image does not render. The other
interesting this is that the Sample Jpeg render no longer
works. I have not touched the main site map or any of the
samples code.
Any Help would be much appreciated,
regards,
James
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: Cocoon, Java Extensions and Xalan
Posted by Barbara Post <ba...@ifrance.com>.
forgot to mention, I pass "local-name(.)" as a parameter for my function.
Go to apache's xalan-j page to learn more on this :-)
----- Original Message -----
From: "Barbara Post" <ba...@ifrance.com>
To: <co...@xml.apache.org>
Sent: Tuesday, October 08, 2002 3:44 PM
Subject: Re: Cocoon, Java Extensions and Xalan
> ok, rather use this kind of stylesheet, below, it runs fine for me, I have
> almost the same configuration.
> Then use a simple pipeline to apply the xsl to an xml file.
>
> Cheers.
>
> <?xml version="1.0" encoding="utf-8"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:java="http://xml.apache.org/xslt/java"
exclude-result-prefixes="java">
> <xsl:variable name="MP5" select="java:baepp.licensekey.MP5.new()"/>
> <xsl:template match="/">
> ....
>
> <xsl:value-of select="java:endElement($MP5,local-name(.))"/>
>
> (value returned by endElement method of my bean declared above. Can return
> void, so only execution then).
>
> Drawback : no Cocoon-like logging :-(
> Ah well...
>
> Babs
>
> ----- Original Message -----
> From: "Spencer" <sp...@ubaccess.com>
> To: <co...@xml.apache.org>
> Sent: Monday, October 07, 2002 5:10 PM
> Subject: Cocoon, Java Extensions and Xalan
>
>
> > Hi
> >
> > I am writing some Java extensions to XSL which are working fine when I
run
> > them off the command line (java org.apache.xalan etc). The Java method
is
> > returned and added to the transformation.
> >
> > However, when I use Cocoon to run the transformation, there is no Java
> > output. The rest of the stylesheet works fine though. I am using Cocoon
> > 2.0.3, Java 1.4.1 and Tomcat/4.1.12-LE-jdk14.
> >
> > Any help would be grateful,
> >
> > thanks Spencer
> >
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <?cocoon-process type="xslt"?>
> > <?xml-stylesheet type="text/xsl" href="patternmatch.xsl"?>
> > <test>
> > <teststring>He
> > llo</teststring>
> > </test>
> >
> > ------
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <xsl:stylesheet version="1.0"
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> > xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:java="java"
> > xmlns:match="XSLPatternMatch">
> > <xsl:template match="teststring">
> > <html>
> > <head>
> > <title></title>
> > </head>
> > <body>
> > <xsl:value-of select="."/>
> > <xsl:copy-of select="match:match(.)"/>
> > Test Test
> > </body>
> > </html>
> > </xsl:template>
> > </xsl:stylesheet>
> > ---------
> >
> > public static boolean match (String pattern)
> > {
> >
> > boolean b;
> >
> >
> > b = Pattern.matches ("He\\Wllo", pattern);
> >
> >
> > return b;
> > }
> >
> >
> >
> > ---------------------------------------------------------------------
> > Please check that your question has not already been answered in the
> > FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
> >
> > To unsubscribe, e-mail: <co...@xml.apache.org>
> > For additional commands, e-mail: <co...@xml.apache.org>
> >
> > ______________________________________________________________________
> > Etudiant: Wanadoo t'offre le Pack eXtense Haut Débit soit 150,92 euros
> > d'économies ! Clique ici : http://www.ifrance.com/_reloc/mail.etudiant
>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
> ______________________________________________________________________
> Etudiant: Wanadoo t'offre le Pack eXtense Haut Débit soit 150,92 euros
> d'économies ! Clique ici : http://www.ifrance.com/_reloc/mail.etudiant
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: Cocoon, Java Extensions and Xalan
Posted by Barbara Post <ba...@ifrance.com>.
ok, rather use this kind of stylesheet, below, it runs fine for me, I have
almost the same configuration.
Then use a simple pipeline to apply the xsl to an xml file.
Cheers.
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:java="http://xml.apache.org/xslt/java" exclude-result-prefixes="java">
<xsl:variable name="MP5" select="java:baepp.licensekey.MP5.new()"/>
<xsl:template match="/">
....
<xsl:value-of select="java:endElement($MP5,local-name(.))"/>
(value returned by endElement method of my bean declared above. Can return
void, so only execution then).
Drawback : no Cocoon-like logging :-(
Ah well...
Babs
----- Original Message -----
From: "Spencer" <sp...@ubaccess.com>
To: <co...@xml.apache.org>
Sent: Monday, October 07, 2002 5:10 PM
Subject: Cocoon, Java Extensions and Xalan
> Hi
>
> I am writing some Java extensions to XSL which are working fine when I run
> them off the command line (java org.apache.xalan etc). The Java method is
> returned and added to the transformation.
>
> However, when I use Cocoon to run the transformation, there is no Java
> output. The rest of the stylesheet works fine though. I am using Cocoon
> 2.0.3, Java 1.4.1 and Tomcat/4.1.12-LE-jdk14.
>
> Any help would be grateful,
>
> thanks Spencer
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <?cocoon-process type="xslt"?>
> <?xml-stylesheet type="text/xsl" href="patternmatch.xsl"?>
> <test>
> <teststring>He
> llo</teststring>
> </test>
>
> ------
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:java="java"
> xmlns:match="XSLPatternMatch">
> <xsl:template match="teststring">
> <html>
> <head>
> <title></title>
> </head>
> <body>
> <xsl:value-of select="."/>
> <xsl:copy-of select="match:match(.)"/>
> Test Test
> </body>
> </html>
> </xsl:template>
> </xsl:stylesheet>
> ---------
>
> public static boolean match (String pattern)
> {
>
> boolean b;
>
>
> b = Pattern.matches ("He\\Wllo", pattern);
>
>
> return b;
> }
>
>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
> ______________________________________________________________________
> Etudiant: Wanadoo t'offre le Pack eXtense Haut Débit soit 150,92 euros
> d'économies ! Clique ici : http://www.ifrance.com/_reloc/mail.etudiant
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Cocoon, Java Extensions and Xalan
Posted by Spencer <sp...@ubaccess.com>.
Hi
I am writing some Java extensions to XSL which are working fine when I run
them off the command line (java org.apache.xalan etc). The Java method is
returned and added to the transformation.
However, when I use Cocoon to run the transformation, there is no Java
output. The rest of the stylesheet works fine though. I am using Cocoon
2.0.3, Java 1.4.1 and Tomcat/4.1.12-LE-jdk14.
Any help would be grateful,
thanks Spencer
<?xml version="1.0" encoding="UTF-8"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet type="text/xsl" href="patternmatch.xsl"?>
<test>
<teststring>He
llo</teststring>
</test>
------
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:java="java"
xmlns:match="XSLPatternMatch">
<xsl:template match="teststring">
<html>
<head>
<title></title>
</head>
<body>
<xsl:value-of select="."/>
<xsl:copy-of select="match:match(.)"/>
Test Test
</body>
</html>
</xsl:template>
</xsl:stylesheet>
---------
public static boolean match (String pattern)
{
boolean b;
b = Pattern.matches ("He\\Wllo", pattern);
return b;
}
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: svg2jpeg not working properly.
Posted by Jacob L E Blain Christen <ja...@entheal.com>.
[snip]
> works. I have not touched the main site map or any of the
> samples code.
Ahh, but has your jdk installation been updated? The headless stuff
on the backend works differently between jdk1.3 and 1.4.
Just a thought.
--
Jacob L E Blain Christen
Entheal LLC
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>