xsl-list
[Top] [All Lists]

Re: Display unique values?

2006-01-23 14:39:32
George, 

Excellent! That is certainly much cleaner than my
original, and it works, which is always a plus. Thanks
very much!

- Alan

--- George Cristian Bina <george(_at_)oxygenxml(_dot_)com> wrote:

Hi Alan,

Your stylesheet looks complicated, how about:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
   <xsl:output version="1.0" encoding="UTF-8"
indent="no" 
omit-xml-declaration="no"
     media-type="text/html"/>

   <xsl:template match="/">
     <html><table>
       <thead><tr>
         <td>Event</td><td>Device</td>
       </tr></thead>
       <tbody>
         <xsl:apply-templates/>
       </tbody>
     </table></html>
   </xsl:template>

   <xsl:template match="Event">
     <tr>
       <td><xsl:value-of select="ID"/></td>
       <td>
         <xsl:for-each 

select="EventDevicesArchive/EventDevice/Device[not(text()=../preceding-sibling::EventDevice/Device/text())]">
             <xsl:value-of select="."/>
             <xsl:if test="position()!=last()">
               <xsl:text>, </xsl:text>
             </xsl:if>
         </xsl:for-each>
       </td>
     </tr>
   </xsl:template>
</xsl:stylesheet>

Hope that helps,
George

---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT
Editor/Debugger
http://www.oxygenxml.com


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>