cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael French <mfre...@zycor.lgc.com>
Subject RE: XSP size limit??
Date Fri, 28 Apr 2000 03:27:24 GMT


> -----Original Message-----
> From: Ricardo Rocha [mailto:ricardo@apache.org]
> Sent: Thursday, April 27, 2000 3:42 PM
> To: cocoon-dev@xml.apache.org
> Subject: RE: XSP size limit??
> 
> 
> In the meantime, a suitable workaround is to replace static, 
> repetitive markup by logic as illustrated in the example below.
> 
> Instead of a long list of nested elements like:
> 
>     <selectcountry selected="US">
>       <country>
>         <value>AF</value>
>         <name>Afghanistan</name>
>       </country>
>       . . . LOTS OF COUNTRIES ...
>       <country>
>         <value>ZW</value>
>         <name>Zimbabwe</name>
>       </country>
>     </selectcountry>
> 
> one may define a static, class-level array:
> 
>     <xsp:page>
>       <xsp:logic>
>         static String[][] countries = {
>           { "AF", "Afghanistan" },
>            . . .
>           { "ZW", "Zimbawe" },
>         }
>       </xsp:logic>
>       ... STUFF ...
>     </xsp:page>
> 
> and dynamically generate the "selectcountry" element like:
> 
>     <selectcountry selected="US">
>       <xsp:logic>
>         for (int i = 0; i < countries.length; i++) {
>           <country>
>             <value><xsp:expr>countries[i][0]</xsp:expr></value>
>             <name><xsp:expr>countries[i][0]</xsp:expr></name>
>           </country>
>         }
>       </xsp:logic>
>     </selectcountry>
> 

Or use external XML file:

	http://www.altheim.com/xml/specs/iso-3166.xml

Mike

Mime
View raw message