apache > cocoon
 
Font size:      

SVG/XML Serializer (2.1 legacy document)

Warning
This document was copied as is from the Cocoon 2.1 documentation, but has not yet been fully reviewed or moved to its new home.

SVG/XML Serializer

The SVG serializer serializes sax events to SVG XML. The output of the SVG serializer is SVG XML; the SVG XML is not rasterized to any image format by this serializer.

  • Name : svgxml
  • Class: org.apache.cocoon.serialization.XMLSerializer
  • Cacheable: yes

Sitemap Configuration

The SVG XML serializer is declared in the sitemap serializers section.

<map:serializers ...
...
  <map:serializer name="xml"
    src="org.apache.cocoon.serialization.XMLSerializer"
    mime-type="text/xml"  
    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>
...
     

The declaration of the SVG serializer shall use following XML serializer configuration parameters

NameValueComment
doctype-public-//W3C//DTD SVG 1.0//ENspecifies the SVG XML public document type
doctype-systemhttp://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtdspecifies the SVG XML system document type
mime-typetext/xmlFollowing mime-type may be used, too: image/svg+xml, application/xml. The mime-type text/xml is the most general one.

Pipeline Usage

Using the SVG XML serializer in a pipeline is just setting the serializer type to svgxml. The following code snippet uses the svxml serializer:

<map:match pattern="svg">
...
  <map:serialize type="svgxml"/>
</map:match>
...
     

Further Reading

As SVG serializer uses the XML serializer internally, you might want to read the complete list of valid XML configuration parameters. It is available at XML serializer user documentation.

Comments

add your comments