cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robin Green" <>
Subject Re: Looking up values
Date Wed, 25 Oct 2000 12:54:44 GMT
Steve Holden <> wrote:
>I want channel web sites into the correct parts of an xml document. I will
>use a parameter in the url such as a 3 number code to push them to the
>correct data. So an example might be 'myPage.xml?001' that gets passed, so
>when this 001 gets passed it will then lookup the corresponding String for
>that value, let's say 001 = "LONDON". I can create a switch statement which
>will handle this but i'm wondering if there's a native way to do this? Also
>how would a put this code somewhere else as there will be 250-300 values to
>look up.

You can have XML like this

<record id="001">
  your data here
<record id="002">
  your data here

and then use xsl to select the right record like this

<xsl:param name="recnum"/>
<xsl:template match="page">
  <xsl:copy-of select="[@id=$recnum]"/>

That way there's no need for any Java code at all.

Get Your Private, Free E-mail from MSN Hotmail at

Share information about yourself, create your own public profile at

View raw message