Return-Path: Mailing-List: contact cocoon-users-help@xml.apache.org; run by ezmlm Delivered-To: mailing list cocoon-users@xml.apache.org Received: (qmail 20071 invoked from network); 19 Aug 2000 04:48:14 -0000 Received: from ev-nat-a.siterock.com (mail@207.33.153.2) by locus.apache.org with SMTP; 19 Aug 2000 04:48:14 -0000 Received: from exh01-em.siterock.com ([192.168.10.63] helo=exh01-em.captech.com) by EV-Nat-A.siterock.com with esmtp (Exim 3.12 #1 (Debian)) id 13Q0YI-0007lf-00 for ; Fri, 18 Aug 2000 21:48:15 -0700 Received: by exh01-em.siterock.com with Internet Mail Service (5.5.2650.21) id ; Fri, 18 Aug 2000 21:48:14 -0700 Message-ID: <99D3002A877BD311B3BC00A0C9CFA1FC0190E76B@exh01-em.siterock.com> From: Saravanan Bellan To: "'cocoon-users@xml.apache.org'" Subject: RE: variables in util:include-uri Date: Fri, 18 Aug 2000 21:48:08 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Thanks so much. It really helps. -----Original Message----- From: Ricardo Rocha [mailto:ricardo@apache.org] Sent: Friday, August 18, 2000 8:37 PM To: cocoon-users@xml.apache.org Subject: Re: variables in util:include-uri Saravanan Bellan wrote: > > How can I use a variable in the href attribute of util:inlcude-uri? Parameter values are passed to dynamic tags by means of constant attributes or nested elements. For example, the utility tag is used to include XML content from any arbitrary URI:

The following is included XML content:

In this case, the URI is known at design time an is expressed as an attribute in tag . When the URI is known only at request time, the URI parameter is passed as a nested element. Thus:

The following is included XML content:

will include the contents of the URL pointed to by the value of the HTTP request parameter "whereTo". This allows for requests such as: http://localhost/dispatcher.xml?whereTo=/real/page.xml Note that the following also works fine: http://localhost/something.xml that is: the nested element form can also be used for constant values if preferred. Note: constant values used inside are treated by XSP as XML text() nodes. They're _not_ [Java] expressions. Passing parameters to taglib dynamic tags as either attributes or nested elements is an XML pattern used consistently in all Cocoon-supplied taglibs, not only in the "util.xsl" taglib. The criteria used is rather simplistic but uniform: - For constant values use attributes if it makes the XML document more readable:

It's now

- For variable values, always use nested elements with the same tag name as the attribute name and within the same namespace as the dynamic tag: String defaultFormat = "hh:mm:ss aa"; . . .

It's now defaultFormat

The following also works:

It's now

where system time would be formatted: - as specified by the value of the HTTP request parameter "format", or - as "hh:mm:ss" when such parameter is not specified in the request. --------------------------------------------------------------------- To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org For additional commands, e-mail: cocoon-users-help@xml.apache.org