Return-Path: Delivered-To: apmail-cocoon-cvs-archive@www.apache.org Received: (qmail 34759 invoked from network); 18 Nov 2005 04:29:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 18 Nov 2005 04:29:44 -0000 Received: (qmail 41586 invoked by uid 500); 18 Nov 2005 04:24:23 -0000 Delivered-To: apmail-cocoon-cvs-archive@cocoon.apache.org Received: (qmail 32454 invoked by uid 500); 18 Nov 2005 04:21:39 -0000 Mailing-List: contact cvs-help@cocoon.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@cocoon.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@cocoon.apache.org Received: (qmail 23684 invoked by uid 99); 18 Nov 2005 04:20:27 -0000 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 17 Nov 2005 20:17:33 -0800 Received: (qmail 8404 invoked by uid 65534); 18 Nov 2005 04:16:00 -0000 Message-ID: <20051118041600.8403.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r345438 [274/286] - in /cocoon/site/site/2.1: ./ developing/ developing/portal/ developing/portal/coplets/ developing/webapps/ developing/webapps/authentication/ faq/ howto/ installing/ plan/ plan/documentation/ plan/otherplanning/ plan/ove... Date: Fri, 18 Nov 2005 04:13:22 -0000 To: cvs@cocoon.apache.org From: crossley@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Added: cocoon/site/site/2.1/userdocs/xml-serializer.html URL: http://svn.apache.org/viewcvs/cocoon/site/site/2.1/userdocs/xml-serializer.html?rev=345438&view=auto ============================================================================== --- cocoon/site/site/2.1/userdocs/xml-serializer.html (added) +++ cocoon/site/site/2.1/userdocs/xml-serializer.html Thu Nov 17 20:00:02 2005 @@ -0,0 +1,1603 @@ + + + + + + + +XML Serializer + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + +
+
+
+
+ +
+ + +
+ +
+ +   +
+ + + + + +
+

XML Serializer

+ +

XML Serializer

+
+

The xml serializer is the simplest possible serializer. It generates an xml +document from the sax events. This serializer is used for serializing to any XML +document format, ie. SVG, WML, VRML, et. al.

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

Sitemap Configuration

+

The 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"  
+    logger="sitemap.serializer.xml" 
+    pool-max="32">
+    <!-- serializer configurations -->
+...    
+  </map:serializer>
+...
+        
+

XML Serializer can be configured, specifying elements inside of the +<map:serializer> body.

+ +

Configuration Example

+

The following XML Serializer snippet is setting encoding configuration for +the XML Serializer

+
+<map:serializer name="xml"         
+  src="org.apache.cocoon.serialization.XMLSerializer"
+  mime-type="text/xml">
+  <encoding>ISO-8859-1</encoding>
+</map:serializer>
+          
+

This configuration will result in xml output of the form

+
+<?xml version="1.0" encoding="ISO-8859-1"?>
+...
+          
+

The XML Serializer accepts following configuration parameters. These +configurations are not Xalan specific.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

Name

+ +
+ +

Xalan Default Value

+ +
+ +

Comment

+ +
+ +

cdata-section-elements

+ +
+ +

none

+ +
cdata-section-elements + +

specifies a whitespace delimited list of the names of elements whose text +node children should be output using CDATA sections. See +section 16 of the XSL Transformations +(XSLT) W3C Recommendation. +

+ +
+ +

doctype-public

+ +
+ +

none

+ +
doctype-public + +

specifies the public identifier to be used in the document type declaration. +

+ +
+ +

doctype-system

+ +
+ +

none

+ +
+ +

+doctype-system specifies the system identifier to be used in the +document type declaration. See +section 16 of the XSL Transformations +(XSLT) W3C Recommendation +

+ +
+ +

encoding

+ +
+ +

none

+ +
encoding + +

specifies the preferred character encoding that the Transformer should use to +encode sequences of characters as sequences of bytes. The value of the attribute +should be treated case-insensitively. The value must only contain characters in +the range #x21 to #x7E (i.e., printable ASCII characters). The value should +either be a charset registered with the Internet Assigned Numbers +Authority [IANA], [RFC2278] or start +with X-. See section 16 of +the XSL Transformations (XSLT) W3C Recommendation +

+ +
+ +

indent

+ +
+ +

yes

+ +
+ +

A Flag for toggling indent. This flag toggles only if some elements should +trigger a line break.

+ +
+ +

media-type

+ +
+ +

+media-type specifies the media type (MIME content type) of the data +that results from outputting the result tree. The charset parameter +should not be specified explicitly; instead, when the top-level media type is +text, a charset parameter should be added according to the +character encoding actually used by the output method. See +section 16 of the XSL Transformations +(XSLT) W3C Recommendation +

+ +
+ +

method

+ +
+ +

The method attribute identifies the overall method that should be used for +outputting the result tree. Other non-namespaced values may be used, such as +"xhtml", but, if accepted, the handling of such values is implementation +defined. If any of the method values are not accepted and are not namespace +qualified, then {@link javax.xml.transform.Transformer#setOutputProperty} or +{@link javax.xml.transform.Transformer#setOutputProperties} will throw a {@link +java.lang.IllegalArgumentException}. See +section 16 of the XSL Transformations +(XSLT) W3C Recommendation +

+ +
+ +

omit-xml-declaration

+ +
+ +

+omit-xml-declaration specifies whether the XSLT processor should +output an XML declaration; the value must be yes or no. See +section 16 of the XSL Transformations +(XSLT) W3C Recommendation +

+ +
+ +

standalone

+ +
+ +

+standalone specifies whether the Transformer should output a +standalone document declaration; the value must be yes or no. +See section 16 of the XSL +Transformations (XSLT) W3C Recommendation +

+ +
+ +

version

+ +
+ +

+version specifies the version of the output method. When the output +method is "xml", the version value specifies the version of XML to be used for +outputting the result tree. The default value for the xml output method is 1.0. +When the output method is "html", the version value indicates the version of the +HTML. The default value for the xml output method is 4.0, which specifies that +the result should be output as HTML conforming to the HTML 4.0 Recommendation +[HTML]. If the output method is "text", the version property is ignored. See +section 16 of the XSL Transformations +(XSLT) W3C Recommendation +

+ +
+
+
Note
+
Former property buffer-size is deprecated, and is +ignored.
+
+

The XML Serializer sets the method property to xml.

+ +

Pipeline Usage

+

Using the XML Serializer in a pipeline is just setting the serializer type to +xml. The following code snippet uses the XML Serializer:

+
+...
+<map:match pattern="*.xml">
+<map:generate...
+...
+<map:serialize type="xml"/>
+...
+      
+ +

Further Reading

+

The XML serializer is usable for serializing any SAX events to a plain xml +output. The various xml documents requires in most cases a proper configuration +of following parameters

+
    + +
  • doctype-public
  • + +
  • doctype-system
  • + +
+

Moreover the mime-type, and name attribute of the serializer definition shall +be set propertly.

+

Read the XML serializer configuration user documentation for +SVG/XML, and WML in order to +understand using the XML serialiazer for serializing to some specific XML +content type.

+ +
+
+ +
 
+
+ + + Propchange: cocoon/site/site/2.1/userdocs/xml-serializer.html ------------------------------------------------------------------------------ svn:eol-style = native