You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Lincoln <li...@oracle.com> on 2006/08/04 10:42:50 UTC
How do I do a catalog (SVG > SVG via xslt)
A year ago I posted "SVG > SVG via xslt"
http://www.mail-archive.com/users@cocoon.apache.org/msg28925.html however
one part of the solution involved...
---
"It seems to me like the problem is Cocoon (or the parser specifically) is
actually trying to fetch the DTD from the Web, which obviously takes some
time. Cocoon has a mechanism for this situation called "catalogs" that
allows you to map DTD URIs to local files so they're always quickly
accessible. See http://cocoon.apache.org/2.1/userdocs/concepts/catalog.html"
Jason Johnston
---
... now, I don't think I ever got to do this bit or just can't remember how.
I read the link and many other posting regarding catalogs and it just ain't
sinking in. I am a casual Cocooner (a few times a year) and most of these
docs just confuse me. Can someone provide a simplistic explanation of what
needs to happen from the point I got to below?
Environment: Cocoon-2.1.9, XP, JDK1.5.0_06, Jetty4.2.23
ai.svg (As saved from Adobe Illustrator):
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version:
6.00 Build 51448) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY ns_svg "http://www.w3.org/2000/svg">
<!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
]>
<svg version="1.1" id="square" xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;"
width="165" height="126" viewBox="0 0 165 126"
style="overflow:visible;enable-background:new 0 0 165 126;"
xml:space="preserve" >
<g id="myRect">
<rect width="165" height="126" fill="pink"/>
</g>
</svg>
xsl.xsl:
---
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ns_svg="http://www.w3.org/2000/svg">
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="//ns_svg:g[@id='myRect']">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
<ns_svg:rect x="100" y="100" width="165" height="126" fill="blue"/>
</xsl:copy>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
---
Sitemap.xmp:
---
<map:serializer name="xml"
src="org.apache.cocoon.serialization.XMLSerializer"
mime-type="svgxml"
doctype-public="-//W3C//DTD SVG 1.0//EN"
doctype-system="http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"
logger="sitemap.serializer.xml"
pool-max="32">
<!-- serializer configurations -->
</map:serializer>
...
...
...
<map:pipeline>
<map:match pattern="ai.svg">
<map:generate src="ai.svg"/>
<map:transform src="xslt.xslt"/>
<map:serialize type="svgxml"/>
</map:match>
</map:pipeline>
---
Hope this is clear enough.
Linc
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
RE: How do I do a catalog (SVG > SVG via xslt)
Posted by Lincoln <li...@oracle.com>.
I found a solution...
I noticed in the file
"C:\cocoon-2.1.9\build\webapp\WEB-INF\entities\w3c\catalog"
The following svg10 catalog entries
---
-- Oasis entity catalog for Scalable Vector Graphics --
PUBLIC "-//W3C//DTD SVG 20000303 Stylable//EN" "svg-20000303-stylable.dtd"
PUBLIC "-//W3C//DTD SVG 20000303 Shared//EN" "svg-20000303-shared.dtd"
PUBLIC "-//W3C//DTD SVG 20000303 Exchange//EN" "svg-20000303-exchange.dtd"
PUBLIC "-//W3C//DTD SVG 1.0//EN" "svg10.dtd"
---
So... I simple output from illustrator as SVG1.0 rather than SVG1.1.
And ever thing works fine.
Thanks to those that read the post anyway.
Linc
> -----Original Message-----
> From: Lincoln [mailto:lincoln.mitchell@oracle.com]
> Sent: Tuesday, August 08, 2006 12:49 PM
> To: users@cocoon.apache.org
> Subject: RE: How do I do a catalog (SVG > SVG via xslt)
>
> "Wow a reply" I thought! But alas sympathy.
>
> Anyone else?
>
> Linc
>
> > -----Original Message-----
> > From: Mark Lundquist [mailto:ml@wrinkledog.com]
> > Sent: Tuesday, August 08, 2006 11:22 AM
> > To: users@cocoon.apache.org
> > Subject: Re: How do I do a catalog (SVG > SVG via xslt)
> >
> >
> > On Aug 4, 2006, at 1:42 AM, Lincoln wrote:
> >
> > > ... now, I don't think I ever got to do this bit or just can't
> > > remember how.
> > > I read the link and many other posting regarding catalogs and it just
> > > ain't
> > > sinking in. I am a casual Cocooner (a few times a year) and most of
> > > these
> > > docs just confuse me.
> >
> > Well I'm a little more than a casual Cocooner, and those catalog docs
> > confuse the you-know-what out of me as well.
> >
> > sympathetically,
> > -ml-
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
RE: How do I do a catalog (SVG > SVG via xslt)
Posted by Lincoln <li...@oracle.com>.
"Wow a reply" I thought! But alas sympathy.
Anyone else?
Linc
> -----Original Message-----
> From: Mark Lundquist [mailto:ml@wrinkledog.com]
> Sent: Tuesday, August 08, 2006 11:22 AM
> To: users@cocoon.apache.org
> Subject: Re: How do I do a catalog (SVG > SVG via xslt)
>
>
> On Aug 4, 2006, at 1:42 AM, Lincoln wrote:
>
> > ... now, I don't think I ever got to do this bit or just can't
> > remember how.
> > I read the link and many other posting regarding catalogs and it just
> > ain't
> > sinking in. I am a casual Cocooner (a few times a year) and most of
> > these
> > docs just confuse me.
>
> Well I'm a little more than a casual Cocooner, and those catalog docs
> confuse the you-know-what out of me as well.
>
> sympathetically,
> -ml-
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: How do I do a catalog (SVG > SVG via xslt)
Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Aug 4, 2006, at 1:42 AM, Lincoln wrote:
> ... now, I don't think I ever got to do this bit or just can't
> remember how.
> I read the link and many other posting regarding catalogs and it just
> ain't
> sinking in. I am a casual Cocooner (a few times a year) and most of
> these
> docs just confuse me.
Well I'm a little more than a casual Cocooner, and those catalog docs
confuse the you-know-what out of me as well.
sympathetically,
—ml—
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org