cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antonio Menchero Fernández <amenc...@aqs.es>
Subject Re: XSL-Help
Date Thu, 30 Mar 2000 14:49:00 GMT
In the template for elements /XML/ACCOUNTLIST/ACCOUNT you could write the 
following:

<xsl:template match="ACCOUNT">
         ....
         ...
         <xsl:variable name="localtype" select="TYPE"/>
         <DESCRIPTION><xsl:value-of 
select="/XML/MAPPINGS/ACCOUNT[TYPE=$localtype]/DESCRIPTION" /></DESCRIPTION>
         ...
</xsl:template>


Luck!


At 15.21 29/3/00 +0200, you wrote:
>Hi!
>
>We are beginners when it comes to XSL - and would like to do the following:
>
>We have an XML stream which looks like this:
>
><XML>
>         <MAPPINGS>
>                 <ACCOUNT>
>                         <TYPE>15</TYPE>
>                         <DESCRIPTION>This is short</DESCRIPTION>
>                 </ACCOUNT>
>                 <ACCOUNT>
>                         <TYPE>16</TYPE>
>                         <DESCRIPTION>Shorter</DESCRIPTION>
>                 </ACCOUNT>
>         </MAPPINGS>
>         <ACCOUNTLIST>
>                 <ACCOUNT>
>                         <NUMBER>123456789<NUMBER>
>                         <TYPE>15</TYPE>
>                         <DESCRIPTION>This is a long description</DESCRIPTION>
>                 </ACCOUNT>
>                 <ACCOUNT>
>                         <NUMBER>11111111<NUMBER>
>                         <TYPE>16</TYPE>
>                         <DESCRIPTION>This is a longer 
> description</DESCRIPTION>
>                 </ACCOUNT>
>         </ACCOUNTLIST>
>         <MAPPINGS>
></XML>
>
>In the output each ACCOUNT in ACCOUNTLIST should have its DESCRIPTION
>replaced with a DESCRIPTION from the corresponding ACCOUNT in the MAPPINGS
>section (depending on the type). i.e. replace the long description with the
>short one.
>
>How can this be achieved using XSL and cocoon?
>
>Thanks
>
>Matthew
>
>--
>=================================================================
>Matthew Langham, S&N AG, Klingenderstrasse 5, D-33100 Paderborn
>Tel: +49-5251-1581-30   [mlangham@sundn.de - http://www.sundn.de]
>=================================================================
>
>
>------------------------------------------------------------------------------------------
>...this mail was scanned for viruses by mailserver...
>
>---------------------------------------------------------------------
>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