cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johns...@netscape.net
Subject RE: ESQL Query
Date Mon, 30 Sep 2002 17:30:09 GMT
You can do this with a standard xsl stylesheet and xsl:call-template. Something like this

<xsl:template match="member">
<TABLE>
<xsl:apply-templates/>
</TABLE>
</xsl:template>

<xsl:template match="profilHairColor">
<TR><TD>Hair Color</TD><TD><!-- xsl:call-template goes here with
. as arg --></TD></TR>
</xsl:template>

You could also put the values in an external xml file and use the document() function.

<xsl:template match="profilHairColor">
<xsl:variable name="id" select="."/>
<TD><TD>Hair Color</TD><TD><xsl:value-of select="document('lookup.xml')/Lookup/HairColor[@id=$id]"/></TD></TR>
</xsl:template>

where lookup.xml is something like this

<Lookup>
 <HairColor id="4">Brown</HairColor>
 <HairColor id="5">etc...
</Lookup>

I'm sure there are plenty of other ways to do this as wel, but both of these methods will
work.

John Lambert <johnlambert_fr@yahoo.com> wrote:

>
>Hello,
>
>After an ESQL query, I obtain the resulats in a file XML, with amongst other things syntax
below:  
>
>< member > 
>< profilHairColor>4</profilHairColor > 
>< profilEyesColor>2</profilEyesColor > 
>< profilOccupation>8</profilOccupation > 
></member >
>
>
>I wish to make correspond in the final result (HTML) the values of the various fields
with their interpretation (for profilHairColor, 4 = brown hair)
>
>What is the best solution to do this ? 
>
>- do I Have to use a logisheet especially for this operation ?
>
>- do I have to create another xml file with all values interpretation, and then to merge
them ?
>
>
>Thanks for your help.
>
>JL
>
> 
>
>
>
>---------------------------------
>Do you Yahoo!?
>New DSL Internet Access from SBC & Yahoo!
>

__________________________________________________________________
The NEW Netscape 7.0 browser is now available. Upgrade now! http://channels.netscape.com/ns/browsers/download.jsp


Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message