cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Bierenfeld <>
Subject Dynamic attributes from xsp to xslt
Date Fri, 06 Oct 2000 13:06:18 GMT

I am trying to figure out how the following can be

1) XML-File :

<form name="form1" action="/whatever.xml"

	... some content ...


and another like

<form name="hallo2" action="/whatever.xml"

	... some content ...


so form1 contains no enctype-attribute but form2
If enctype is not given, the default should be

2) this is caught by an xsp :

<xsl:template match="form">

	<!-- do some java stuff -->


		String listMode = null;
		int listCount = 0;

		InputHash inputHash = engine.getInputHash


	<!-- create a form -->
	<!-- check if attribute enctype is given. if not
set it to text/plain -->

	<xsl:variable name="tmpenctype">


		<xsl:when test="@enctype">
			<xsl:value-of select="@enctype"/>




	<!-- fire <form> for futher xslt processing -->

	<form name="{@name}" action="{@action}"



3) that is furthermore processed by xsl

<xsl:template match="form">

	<!-- Send out HTML-Stuff to be displayed -->
	<form action="{@action}" method="{@method}"
		 name="{@name}" enctype="{enctype}">


So xsp "catchs" <form> and "sends" <form> to xslt.
Is it possible to transfer all parameters even
without knowing them ? Cause XSP should not be
worried about Layouts or something like that. Just
pass the parameters. If they are there send them
if not just dont send them.

This is valid for a lot of things eg. <img> where
you specify height, width and so on. If you would
catch this in xsp (to get it out of a database or
so) you would be worried about the imagename but
now for the layout-attributes of the html-tag



PS: I will never do it again. My Mailbox is
somewhat spoiled. But anyway I think this gives a
good feeling about using cocoon.

View raw message