Return-Path: Delivered-To: apmail-forrest-dev-archive@www.apache.org Received: (qmail 33174 invoked from network); 6 Jul 2007 15:25:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Jul 2007 15:25:40 -0000 Received: (qmail 61495 invoked by uid 500); 6 Jul 2007 01:59:03 -0000 Delivered-To: apmail-forrest-dev-archive@forrest.apache.org Received: (qmail 61429 invoked by uid 500); 6 Jul 2007 01:59:03 -0000 Mailing-List: contact dev-help@forrest.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@forrest.apache.org List-Id: Delivered-To: mailing list dev@forrest.apache.org Received: (qmail 61418 invoked by uid 99); 6 Jul 2007 01:59:02 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jul 2007 18:59:02 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [66.111.4.25] (HELO out1.smtp.messagingengine.com) (66.111.4.25) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jul 2007 18:58:55 -0700 Received: from compute1.internal (compute1.internal [10.202.2.41]) by out1.messagingengine.com (Postfix) with ESMTP id EB4E86A7A for ; Thu, 5 Jul 2007 21:58:33 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute1.internal (MEProxy); Thu, 05 Jul 2007 21:58:33 -0400 X-Sasl-enc: p4baYRWIbTxXTVxpwJam+lMon+RVsfxqdv4Waq3X8Jgg 1183687111 Received: from localhost (dsl-41-216.nsw1.net.au [125.168.41.216]) by mail.messagingengine.com (Postfix) with ESMTP id C37EB13D84 for ; Thu, 5 Jul 2007 21:58:31 -0400 (EDT) Date: Fri, 6 Jul 2007 11:58:26 +1000 From: David Crossley To: dev@forrest.apache.org Subject: Re: MOTD template match query Message-ID: <20070706015826.GD12935@igg.indexgeo.com.au> References: <006201c7bd71$90545af0$650fa8c0@developer> <20070704011555.GW1111@igg.indexgeo.com.au> <61c9bc470707051141i45170d2vec762130ed67a937@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <61c9bc470707051141i45170d2vec762130ed67a937@mail.gmail.com> User-Agent: Mutt/1.4.2.2i X-Virus-Checked: Checked by ClamAV on apache.org Ross Gardler wrote: > David Crossley wrote: > >Gav.... wrote: > >> > >> In site-to-xhtml.xsl we have tests which to me say :- > >> > >> when: > >> if test = x then do z > >> otherwise: > >> if test = y then do z > >> > >> In other words, the below code snippet confuses me > >> Why not combine it to say > >> > >> if test = x or test = y then do z > >> > >> Or is there more to it than I have glimpsed at so far? > > > >Would you please give me more clues as to which parts > >that you cannot understand. > > :-) It took me a while to figure out what Gavin meant... > > In Gavins psuedo code above > > "when" represents > > "otherwise" represents the following > > "if test = x" represents > > "if test = y" represents > > "z" represents everything inside the above statements > > The bit of XSL this refers to is copied below. Remember that we are allowing the pattern to be either anchored at beginning of the URI or contained anywhere within the URI. We also need to match the pattern for the URI being processed. We also need to only place the message if it is configured to be on the face of the page. Other similar sections of code deal with placing it in the left-hand panel, and with placing a message in the title. Here is the pseudo-code ... ------------- If MOTD is configured For each option If @starts-with is true Then If URI has the pattern anchored at beginning Then If location is face-of-page Place the motd message If there is a link Then create a link from "More" If @starts-with is not true Then If URI contains the pattern Then do the same as above End of foreach option ------------- I don't see anything wrong with that, nor can i see how to do it better. -David > >> > >> > >> > >> > >> > >> > >>
> >> > >> > >> ( > >> > >> > >> > >> More > >> ) > >> > >>
> >>
> >>
> >>
> >> > >> > >> > >>
> >> > >> > >> ( > >> > >> > >> > >> More > >> ) > >> > >>
> >>
> >>
> >>
> >>
> >>
> >>
> >> > > > > > > > -- > -- > Ross Gardler > > OSS Watch - awareness and understanding of open source software > development and use in education > http://www.oss-watch.ac.uk