cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <cziege...@sundn.de>
Subject C2: Sitemap-extension: New configuration scheme for components
Date Thu, 03 Aug 2000 10:38:13 GMT
Hello,

according to the sitemap draft, the following configuration possibility is desired:

	<map:serializer name="wap" mime-type="text/vnd.wap.wml" src="org.apache.cocoon.serialization.XMLSerializer">

	    	<doctype-public>-//WAPFORUM//DTD WML 1.1//EN</doctype-public>
		<doctype-system>http://www.wapforum.org/DTD/wml_1.1.xml</doctype-system>
    		<encoding>UTF-8</encoding>
	</map:serializer>

The current sitemap creates an org.apache.avalon.Configuration object which gets a value of
the first node inside the map:serializer node, in this example doctype-public. The other nodes
are not reachable.

I changed the sitemap.xsl so that an org.apache.avalon.Configuration object is created which
is constructed similar to the Configuration objects of the general components of the cocoon.xconf:
A root Configuration object is created which gets all attributes of the map:serializer node.
For each child of map:serializer a new sub-configuration object is created.

If this is an acceptable solution, here is the diff:
Index: sitemap.xsl
===================================================================
RCS file: /home/cvspublic/xml-cocoon/src/org/apache/cocoon/components/language/markup/sitemap/java/Attic/sitemap.xsl,v
retrieving revision 1.1.2.18
diff -r1.1.2.18 sitemap.xsl
475a496,513
> 
>       <xsl:if test="$ns">
>         confBuilder.startPrefixMapping("","<xsl:value-of select="namespace-uri(.)"/>");

>       </xsl:if>
> 	  <!-- Create root configuration -->	  
>       attr.clear();  
>       <xsl:for-each select="attribute::*[name(.)!=$qname]">
>         attr.addAttribute ("", 
> 						   "<xsl:value-of select="local-name(.)"/>", 
> 						   "<xsl:value-of select="name(.)"/>", 
> 						   "CDATA", 
> 						   "<xsl:value-of select="."/>"); 
>       </xsl:for-each>
> 
>  	  confBuilder.startElement ("", 
> 	  							"<xsl:value-of select="translate(@name, '- ', '__')"/>",
> 	                            "<xsl:value-of select="translate(@name, '- ', '__')"/>",
attr); 
> 
483a522,528
> 	  <!-- end root configuration -->
> 	  confBuilder.endElement ("",
> 	  						  "<xsl:value-of select="translate(@name, '- ', '__')"/>",
> 	                          "<xsl:value-of select="translate(@name, '- ', '__')"/>");

>       <xsl:if test="$ns">
>         confBuilder.endPrefixMapping(""); 
>       </xsl:if>


Regards
Carsten Ziegeler

Open Source Group              sunShine - Lighting up e:Business
================================================================
Carsten Ziegeler, S&N AG, Klingenderstrasse 5, D-33100 Paderborn
www.sundn.de                           mailto:cziegeler@sundn.de 
================================================================

------------------------------------------------------------------------------------------
...this mail was scanned for viruses by mailserver...

Mime
View raw message