xsl-list
[Top] [All Lists]

Re: i want no double xml records to be viewed

2003-07-21 03:25:23

Hi Nico,

I assume you just started using XSL, because you're using
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl";>
which is a nasty dialect from Microsoft. A beginners error most of us make
I think. At least I did.
As Jarno said: You should't use it!!!
Furthermore there is a faq about unique grouping:
http://www.jenitennison.com/xslt/grouping

Here is a little help from me (I stole it from the site above ;-)) Thank
Jeni for it!):

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform"; xmlns:fo="
http://www.w3.org/1999/XSL/Format";>
  <xsl:key name="records-by-ppn" match="record" use="ppn"/>

  <xsl:template match="root">
    <xsl:for-each select="record[count(. | key('records-by-ppn',ppn)[1]) =
1]">
      <xsl:sort select="ppn"/>

    PPN: <xsl:value-of select="ppn"/>
    Titel: <xsl:value-of select="titel"/>
    </xsl:for-each>
  </xsl:template>

</xsl:stylesheet>

I don't know what your root-element was, so I called it "root"...

Success!!!

Greetings René
   {@   @}
        ^
      \_/

"You don't need eyes to see, you need vision!"

TJIP PCL
Steenovenweg 3
5708 HN  Helmond
The Netherlands
tel: +31(0) 492 502 222
fax: +31(0) 492 502 299
e-mail: R(_dot_)deVries(_at_)tjip(_dot_)com
internet: www.tjip.com

***************************DISCLAIMER********************************
Deze e-mail is uitsluitend bestemd voor de geadresseerde(n).
Verstrekking aan en gebruik door anderen is niet toegestaan.
TJIP PCL sluit iedere aansprakelijkheid uit die voortvloeit uit
elektronische verzending.

This e-mail is intended exclusively for the addressee(s), and may
not be passed on to, or made available for use by any person
other than the addressee(s). TJIP PCL rules out any and every liability
resulting from any electronic transmission.


                                                                                
                                                        
                    "Nico Noordhoek"                                            
                                                        
                    <noordhoek(_at_)kitlv(_dot_)nl>               To:     
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com                                
          
                    Sent by:                           cc:                      
                                                        
                    owner-xsl-list(_at_)lists(_dot_)mulber        Subject:     
[xsl] i want no double xml records to be viewed                     
                    rytech.com                                                  
                                                        
                                                                                
                                                        
                                                                                
                                                        
                    21-07-2003 08:38                                            
                                                        
                    Please respond to xsl-list                                  
                                                        
                                                                                
                                                        
                                                                                
                                                        




Hello,
Please take a look at my problem.

I have xml-records with a tag that have the same  content, like
this tag:
<PPN>12345</PPN>, I want just one record to be  shown in
my ie-explorer, is it possible to add a  line in my stylesheet to
prevent this?

Nico Noordhoek



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



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