You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by sh...@apache.org on 2002/07/03 01:18:24 UTC

cvs commit: xml-cocoon2/src/documentation/xdocs/faq faq-serializers.xml

shannon     2002/07/02 16:18:24

  Modified:    src/documentation/xdocs/faq faq-serializers.xml
  Log:
  Added
  - new FAQ based on cocoon-user thread
  on removing doctype declaration from serialized files
  - new FAQ based on Harry Lai's ( HLai@coremetrics.com )
  method of excluding namespaces by extending a serializer
  component, edited by me from summary posted by
  Reinhard Poetz (reinhard_poetz@gmx.net)
  
  Revision  Changes    Path
  1.4       +63 -0     xml-cocoon2/src/documentation/xdocs/faq/faq-serializers.xml
  
  Index: faq-serializers.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/documentation/xdocs/faq/faq-serializers.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- faq-serializers.xml	6 Jun 2002 18:18:38 -0000	1.3
  +++ faq-serializers.xml	2 Jul 2002 23:18:24 -0000	1.4
  @@ -56,7 +56,70 @@
   
   </answer>
   
  +</faq>
  +
  +<faq>
  + <question>
  +How can I remove the DTD declaration at the top of my HTML
  +pages created from pipelines with the default (HTML) serializer?
  + </question>
  +
  + <answer>
  +  <p>
  +Within the map:components section of sitemap.xmap, adjust the configuration of your HTML serializer component as follows.
  +  </p>
  +<source><![CDATA[
  +<map:serializers default="html">
  +
  +  <map:serializer name="html" mime-type="text/html; charset=ISO-8859-1"
  +     src="org.apache.cocoon.serialization.HTMLSerializer">
  +    <encoding>ISO-8859-1</encoding>
  +    <omit-xml-declaration>true</omit-xml-declaration>
  +  </map:serializer>
  +   
  +  <!-- other serializers -->
  +   
  +</map:serializers>
  +]]></source>
  +
  +  <note>
  +Consider using the XMLSerializer in your pipeline. The XMLSerializer will not write a DocType Declaration.
  +  </note>
  +  
  +</answer>
  +
  +</faq>
  +
  +<faq>
  + <question>
  +How can I remove namespaces from my xml files?
  + </question>
  +
  + <answer>
  +  <p>
  +Sometimes adding xsl:exclude-result-prefixes attributes
  +to the &lt;xsl:stylesheet&gt; or literal result element is not effective
  +in removing all namespace declarations. For example, namespace nodes copied 
  +from the source document within &lt;xsl:copy&gt; or &lt;xsl:copy-of&gt; instructions 
  +(commonly found in catch-all stylesheet templates) will not be excluded.
  +  </p> 
  +  <p>
  +There are two approaches to this problem. 
  +  </p> 
  +    <p>
  +One approach is to extend your serializer component and override the startPrefixMapping and endPrefixMapping methods to do nothing. This will remove <strong>all</strong> namespaces from the serialized output. Since your serializer will no longer be processing namespaces, this theoretically will improve performance ever so slightly. You could generalize this approach by using the serializer's configuration method to declare namespaces to be excluded.
  +  </p>
  + <p>
  +Another approach is to use an interim transformation step in your pipeline with a stylesheet described <link href="faq-xslt.html#faq-5">here</link>.
  +  </p>
  +
  +  
  +</answer>
   
   </faq>
  +
  +
  +
  +
   
   </faqs>
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org