cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lincoln" <lincoln.mitch...@oracle.com>
Subject How do I do a catalog (SVG > SVG via xslt)
Date Fri, 04 Aug 2006 08:42:50 GMT
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


Mime
View raw message