cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Newland" <cnewl...@nortelnetworks.com>
Subject using xsp:logic to generate attributes inside a template
Date Fri, 09 Jun 2000 11:00:46 GMT
Hi All,

Is there a way to use xsp:logic (actually a java 'for' loop) to generate the
attributes of a template in an xml page:

<xsp:logic>

<xsp:content>

<my_template>
	<xsp:attribute name="label">Hello</xsp:attribute>

</xsp:content>
			
<[CDATA
	for (int i = 0; i < 10; i++) {

		attr_varname = "var" + i;

		attr_value	= (String)value_vector.elementAt(i);
]]>
		
		<xsp:content>
 
<xsp:attribute><name><xsp:expr>attr_varname</xsp:expr></name><xsp:expr>attr_
value</xsp:expr></xsp:attribute>
		</xsp:content>
<[CDATA
	} // end for
]]>
		
<xsp:content>
	</my_template>
</xsp:content>

</xsp:logic>

The problem is that the <my_template> tag is not closed inside the first
<xsp:content> section so a parse exception is thrown.

Am I asking the impossible here or am I just going about it the wrong way?

Thanks for any ideas.

Regards,

Chris

--
Chris Newland 
Software Research Engineer 
Advanced IP Services and Management 
Nortel Networks, London Road, Harlow, Essex, CM17 9NA. 
Tel:   +44(0)1279 405165 
Fax:   +44(0)1279 402047 
Email: cnewland@nortelnetworks.com
"This message may contain information proprietary to Nortel Networks 
so any unauthorised disclosure, copying or distribution of its 
contents is strictly prohibited." 
------------------------------------------------------------
Company name: Nortel Networks plc
Company number: 2515751
Company's registered office address: Maidenhead Office Park, 
Westacott Way, Maidenhead, Berkshire SL6 3QH.
------------------------------------------------------------


Mime
View raw message