This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re:


Hi Bryan
The following is what you can do. This is intended to be simple...
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:output method="text" omit-xml-declaration="yes"/>
<xsl:template match="elemA">
<xsl:for-each select="elemB/elemC[text() ='bar']">
<xsl:if test="position()=1">
<xsl:value-of select="."/>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Hope this helps
Vasu


From: Bryan Tulloch <b.tulloch@solicitec.com>
Reply-To: xsl-list@lists.mulberrytech.com
To: "'xsl-list@lists.mulberrytech.com'" <xsl-list@lists.mulberrytech.com>
Date: Mon, 16 Sep 2002 16:22:13 +0100

Hi,


I have an XML file with this structure:

<elemA>
<elemB>
<elemC></elemC>
<elemC></elemC>
etc...
</elemB>
<elemB>
<elemC></elemC>
<elemC></elemC>
etc...
</elemB>
etc...
</elemA>

I am writing an XSL file to search it. I want to be able to search all of
the <elemC> nodes for the occurrence of a searchstring - and, if an <elemC>
node matches the searchstring, to output the value of the first <elemC> node
of the <elemB> node that contains the matching <elemC> node. I hope that
makes sense! I haven't been able yet to get the XSL to process each of the
<elemC> nodes of each of the <elemB> nodes systematically.

Any help much appreciated.

Bryan T
Solicitec has been nominated for 4 awards in the 2002 LOTIES (In Brief
magazine's legal office technology innovation awards) for Best legal office
technology supplier, Best legal office technology newcomer (for
Visualfiles), Best fee-earner support system (for SolCase), Best legal
office automation system (for SolCase).

Your vote counts! So please, <a
href="http://www.inbrief.co.uk/nomination.asp";>click here</a> and vote for
us.

Email Disclaimer

This Mail has been scanned for Viruses using the most up to date McAfee
Virus Definitions.

The information in this email is confidential and is intended solely for the
addressee. Access to this email by anyone else is unauthorised. If you are
not the intended recipient, any use, disclosure, copying, distribution or
retention of any part of it is prohibited and may be unlawful. If you have
received this communication in error please notify us by email or by
telephone 0113 2262000 and then delete the email and any copies of it. The
contents of this message may contain personal views that are not the views
of Solicitec, unless specifically stated.

XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. http://www.hotmail.com


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]