[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: How do I compare all similar type nodes?

Subject: Re: How do I compare all similar type nodes?
From: Ahmad J Reeves <ahmad@xxxxxxxxxxxxxx>
Date: Tue, 18 Dec 2001 12:23:21 +0000
Re:  How do I compare all similar type nodes?
Perfecto mundo

not far off in idea to my gobbldegook!

Cheers Chris

A.

Chris Bayes wrote:
> 
> Ok you want
>         <xsl:for-each select="LOG/DIRECT/TARGET_CHARACTER_ID[not(. =
> preceding::TARGET_CHARACTER_ID)]">
>                 <xsl:sort select="." data-type="number"
> order="ascending" />
>                 <xsl:value-of select="position()" />. <xsl:value-of
> select="." />
>         </xsl:for-each>
> 
> Ciao Chris
> 
> XML/XSL Portal
> http://www.bayes.co.uk/xml
> 
> > -----Original Message-----
> > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of
> > Ahmad J Reeves
> > Sent: 18 December 2001 09:18
> > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > Subject: Re:  How do I compare all similar type nodes?
> >
> >
> > Hi,
> >
> > Yes it appears to work with your xml document but not
> > with the one I have.I thought my doc may be corrupt
> > in some way so I tested it against another. So for example if
> > I take a new document that has five elements, (see below) and
> > change the target character id's to say 100, 100, 200, 200,
> > 500, my output should be 100,200,500
> >
> > but the output generated is
> >
> > 1. 200 2. 200 3. 500
> >
> > So it misses the first element and still doesnt remove the
> > duplicate for some very strange reason.
> >
> > A.
> >
> > <?xml version="1.0" ?>
> > <LOG>
> >       <DIRECT>
> >       <COMMUNICATION_TYPE> PAGETELL </COMMUNICATION_TYPE>
> >       <Invoc_serial> 27 </Invoc_serial>
> >       <Serial> 3087908 </Serial>
> >       <USAGE> TELL </USAGE>
> >       <MESSAGE_TYPE> EMOTE </MESSAGE_TYPE>
> >       <CHARACTER_ID> 44639 </CHARACTER_ID>
> >       <CHARACTER_STATUS> 3 </CHARACTER_STATUS>
> >       <LOCATION_ID> 45040 </LOCATION_ID>
> >       <TARGET_CHARACTER_ID> 100 </TARGET_CHARACTER_ID>
> >       <TARGET_CHARACTER_STATUS> 6 </TARGET_CHARACTER_STATUS>
> >       <TARGET_CHARACTER_LOCATION_ID> 23222
> > </TARGET_CHARACTER_LOCATION_ID>
> >       <MESSAGE> grins...I think it's the proxy servers called
> > Kevin and Perry that need kicking! </MESSAGE>
> >       <TIME> 'Mon, 26 Nov 2001 15:40:29 +0000' </TIME>
> >       </DIRECT>
> >
> >       <DIRECT>
> >       <COMMUNICATION_TYPE> PAGETELL </COMMUNICATION_TYPE>
> >       <Invoc_serial> 27 </Invoc_serial>
> >       <Serial> 3045454908 </Serial>
> >       <USAGE> TELL </USAGE>
> >       <MESSAGE_TYPE> EMOTE </MESSAGE_TYPE>
> >       <CHARACTER_ID> 44639 </CHARACTER_ID>
> >       <CHARACTER_STATUS> 3 </CHARACTER_STATUS>
> >       <LOCATION_ID> 100 </LOCATION_ID>
> >       <TARGET_CHARACTER_ID> 223232 </TARGET_CHARACTER_ID>
> >       <TARGET_CHARACTER_STATUS> 6 </TARGET_CHARACTER_STATUS>
> >       <TARGET_CHARACTER_LOCATION_ID> 23222
> > </TARGET_CHARACTER_LOCATION_ID>
> >       <MESSAGE> grins...I think it's the proxy servers called
> > Kevin and Perry that need kicking! </MESSAGE>
> >       <TIME> 'Mon, 26 Nov 2001 15:40:29 +0000' </TIME>
> >       </DIRECT>
> >
> > <DIRECT>
> >       <COMMUNICATION_TYPE> PAGETELL </COMMUNICATION_TYPE>
> >       <Invoc_serial> 27 </Invoc_serial>
> >       <Serial> 3024234 </Serial>
> >       <USAGE> TELL </USAGE>
> >       <MESSAGE_TYPE> EMOTE </MESSAGE_TYPE>
> >       <CHARACTER_ID> 44639 </CHARACTER_ID>
> >       <CHARACTER_STATUS> 3 </CHARACTER_STATUS>
> >       <LOCATION_ID> 45099 </LOCATION_ID>
> >       <TARGET_CHARACTER_ID> 200 </TARGET_CHARACTER_ID>
> >       <TARGET_CHARACTER_STATUS> 6 </TARGET_CHARACTER_STATUS>
> >       <TARGET_CHARACTER_LOCATION_ID> 23222
> > </TARGET_CHARACTER_LOCATION_ID>
> >       <MESSAGE> grins...I think it's the proxy servers called
> > Kevin and Perry that need kicking! </MESSAGE>
> >       <TIME> 'Mon, 26 Nov 2001 15:40:29 +0000' </TIME>
> >       </DIRECT>
> >
> > <DIRECT>
> >       <COMMUNICATION_TYPE> PAGETELL </COMMUNICATION_TYPE>
> >       <Invoc_serial> 27 </Invoc_serial>
> >       <Serial> 30878788 </Serial>
> >       <USAGE> TELL </USAGE>
> >       <MESSAGE_TYPE> EMOTE </MESSAGE_TYPE>
> >       <CHARACTER_ID> 44639 </CHARACTER_ID>
> >       <CHARACTER_STATUS> 3 </CHARACTER_STATUS>
> >       <LOCATION_ID> 45099 </LOCATION_ID>
> >       <TARGET_CHARACTER_ID> 200 </TARGET_CHARACTER_ID>
> >       <TARGET_CHARACTER_STATUS> 6 </TARGET_CHARACTER_STATUS>
> >       <TARGET_CHARACTER_LOCATION_ID> 23222
> > </TARGET_CHARACTER_LOCATION_ID>
> >       <MESSAGE> grins...I think it's the proxy servers called
> > Kevin and Perry that need kicking! </MESSAGE>
> >       <TIME> 'Mon, 26 Nov 2001 15:40:29 +0000' </TIME>
> >       </DIRECT>
> >
> > <DIRECT>
> >       <COMMUNICATION_TYPE> PAGETELL </COMMUNICATION_TYPE>
> >       <Invoc_serial> 27 </Invoc_serial>
> >       <Serial> 301212121 </Serial>
> >       <USAGE> TELL </USAGE>
> >       <MESSAGE_TYPE> EMOTE </MESSAGE_TYPE>
> >       <CHARACTER_ID> 44639 </CHARACTER_ID>
> >       <CHARACTER_STATUS> 3 </CHARACTER_STATUS>
> >       <LOCATION_ID> 45099 </LOCATION_ID>
> >       <TARGET_CHARACTER_ID> 500 </TARGET_CHARACTER_ID>
> >       <TARGET_CHARACTER_STATUS> 6 </TARGET_CHARACTER_STATUS>
> >       <TARGET_CHARACTER_LOCATION_ID> 23222
> > </TARGET_CHARACTER_LOCATION_ID>
> >       <MESSAGE> grins...I think it's the proxy servers called
> > Kevin and Perry that need kicking! </MESSAGE>
> >       <TIME> 'Mon, 26 Nov 2001 15:40:29 +0000' </TIME>
> >       </DIRECT>
> > </LOG>
> >
> >
> >
> >
> >
> > -----Original Message-----
> > From: Chris Bayes <chris@xxxxxxxxxxx>
> > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> > Date: Tuesday, December 18, 2001 12:40 AM
> > Subject: RE:  How do I compare all similar type nodes?
> >
> >
> > >Well in that case you aren't telling us something.
> > >This stylesheet
> > ><?xml version="1.0" encoding="UTF-8"?>
> > ><xsl:stylesheet version="1.0"
> > >xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> > >>
> > > <xsl:output method="html"/>
> > > <xsl:template match ="/">
> > > <html>
> > >    <body>
> > > <xsl:for-each select="LOG/DIRECT/TARGET_CHARACTER_ID[. !=
> > >preceding::TARGET_CHARACTER_ID]">
> > > <xsl:sort select="." data-type="number"
> > >order="ascending" />
> > > <xsl:value-of select="position()" />. <xsl:value-of select="." />
> > > </xsl:for-each>
> > > </body>
> > >  </html>
> > > </xsl:template>
> > ></xsl:stylesheet>
> > >
> > >With this xml
> > >
> > ><?xml version="1.0" ?>
> > ><LOG>
> > >      <DIRECT>
> > >      <COMMUNICATION_TYPE> PAGETELL </COMMUNICATION_TYPE>
> > >      <Invoc_serial> 27 </Invoc_serial>
> > >      <Serial> 3087908 </Serial>
> > >      <USAGE> TELL </USAGE>
> > >      <MESSAGE_TYPE> EMOTE </MESSAGE_TYPE>
> > >      <CHARACTER_ID> 44639 </CHARACTER_ID>
> > >      <CHARACTER_STATUS> 3 </CHARACTER_STATUS>
> > >      <LOCATION_ID> 45040 </LOCATION_ID>
> > >      <TARGET_CHARACTER_ID> 2346456 </TARGET_CHARACTER_ID>
> > >      <TARGET_CHARACTER_STATUS> 6 </TARGET_CHARACTER_STATUS>
> > >      <TARGET_CHARACTER_LOCATION_ID> 23222
> > ></TARGET_CHARACTER_LOCATION_ID>
> > >      <MESSAGE>hello</MESSAGE>
> > >      <TIME> 'Mon, 26 Nov 2001 15:40:29 +0000' </TIME>
> > >      </DIRECT>
> > >      <DIRECT>
> > >      <COMMUNICATION_TYPE> PAGETELL </COMMUNICATION_TYPE>
> > >      <Invoc_serial> 27 </Invoc_serial>
> > >      <Serial> 3087908 </Serial>
> > >      <USAGE> TELL </USAGE>
> > >      <MESSAGE_TYPE> EMOTE </MESSAGE_TYPE>
> > >      <CHARACTER_ID> 44639 </CHARACTER_ID>
> > >      <CHARACTER_STATUS> 3 </CHARACTER_STATUS>
> > >      <LOCATION_ID> 45040 </LOCATION_ID>
> > >      <TARGET_CHARACTER_ID> 72346456 </TARGET_CHARACTER_ID>
> > >      <TARGET_CHARACTER_STATUS> 6 </TARGET_CHARACTER_STATUS>
> > >      <TARGET_CHARACTER_LOCATION_ID> 23222
> > ></TARGET_CHARACTER_LOCATION_ID>
> > >      <MESSAGE>hello</MESSAGE>
> > >      <TIME> 'Mon, 26 Nov 2001 15:40:29 +0000' </TIME>
> > >      </DIRECT>
> > >            <DIRECT>
> > >      <COMMUNICATION_TYPE> PAGETELL </COMMUNICATION_TYPE>
> > >      <Invoc_serial> 27 </Invoc_serial>
> > >      <Serial> 3087908 </Serial>
> > >      <USAGE> TELL </USAGE>
> > >      <MESSAGE_TYPE> EMOTE </MESSAGE_TYPE>
> > >      <CHARACTER_ID> 44639 </CHARACTER_ID>
> > >      <CHARACTER_STATUS> 3 </CHARACTER_STATUS>
> > >      <LOCATION_ID> 45040 </LOCATION_ID>
> > >      <TARGET_CHARACTER_ID> 2346456 </TARGET_CHARACTER_ID>
> > >      <TARGET_CHARACTER_STATUS> 6 </TARGET_CHARACTER_STATUS>
> > >      <TARGET_CHARACTER_LOCATION_ID> 23222
> > ></TARGET_CHARACTER_LOCATION_ID>
> > >      <MESSAGE>hello</MESSAGE>
> > >      <TIME> 'Mon, 26 Nov 2001 15:40:29 +0000' </TIME>
> > >      </DIRECT>
> > >      <DIRECT>
> > >      <COMMUNICATION_TYPE> PAGETELL </COMMUNICATION_TYPE>
> > >      <Invoc_serial> 27 </Invoc_serial>
> > >      <Serial> 3087908 </Serial>
> > >      <USAGE> TELL </USAGE>
> > >      <MESSAGE_TYPE> EMOTE </MESSAGE_TYPE>
> > >      <CHARACTER_ID> 44639 </CHARACTER_ID>
> > >      <CHARACTER_STATUS> 3 </CHARACTER_STATUS>
> > >      <LOCATION_ID> 45040 </LOCATION_ID>
> > >      <TARGET_CHARACTER_ID> 346456 </TARGET_CHARACTER_ID>
> > >      <TARGET_CHARACTER_STATUS> 6 </TARGET_CHARACTER_STATUS>
> > >      <TARGET_CHARACTER_LOCATION_ID> 3222
> > ></TARGET_CHARACTER_LOCATION_ID>
> > >      <MESSAGE>hello</MESSAGE>
> > >      <TIME> 'Mon, 26 Nov 2001 15:40:29 +0000' </TIME>
> > >      </DIRECT>
> > >      <DIRECT>
> > >      <COMMUNICATION_TYPE> PAGETELL </COMMUNICATION_TYPE>
> > >      <Invoc_serial> 27 </Invoc_serial>
> > >      <Serial> 3087908 </Serial>
> > >      <USAGE> TELL </USAGE>
> > >      <MESSAGE_TYPE> EMOTE </MESSAGE_TYPE>
> > >      <CHARACTER_ID> 44639 </CHARACTER_ID>
> > >      <CHARACTER_STATUS> 3 </CHARACTER_STATUS>
> > >      <LOCATION_ID> 45040 </LOCATION_ID>
> > >      <TARGET_CHARACTER_ID> 1346456 </TARGET_CHARACTER_ID>
> > >      <TARGET_CHARACTER_STATUS> 6 </TARGET_CHARACTER_STATUS>
> > >      <TARGET_CHARACTER_LOCATION_ID> 3222
> > ></TARGET_CHARACTER_LOCATION_ID>
> > >      <MESSAGE>hello</MESSAGE>
> > >      <TIME> 'Mon, 26 Nov 2001 15:40:29 +0000' </TIME>
> > >      </DIRECT>
> > >      <DIRECT>
> > >      <COMMUNICATION_TYPE> PAGETELL </COMMUNICATION_TYPE>
> > >      <Invoc_serial> 27 </Invoc_serial>
> > >      <Serial> 3087908 </Serial>
> > >      <USAGE> TELL </USAGE>
> > >      <MESSAGE_TYPE> EMOTE </MESSAGE_TYPE>
> > >      <CHARACTER_ID> 44639 </CHARACTER_ID>
> > >      <CHARACTER_STATUS> 3 </CHARACTER_STATUS>
> > >      <LOCATION_ID> 45040 </LOCATION_ID>
> > >      <TARGET_CHARACTER_ID> 10346456 </TARGET_CHARACTER_ID>
> > >      <TARGET_CHARACTER_STATUS> 6 </TARGET_CHARACTER_STATUS>
> > >      <TARGET_CHARACTER_LOCATION_ID> 3222
> > ></TARGET_CHARACTER_LOCATION_ID>
> > >      <MESSAGE>hello</MESSAGE>
> > >      <TIME> 'Mon, 26 Nov 2001 15:40:29 +0000' </TIME>
> > >      </DIRECT>
> > ></LOG>
> > >
> > >Produces
> > >
> > ><html>
> > ><body>1.  346456 2.  1346456 3.  2346456 4.  10346456 5.  72346456
> > ></body> </html>
> > >
> > >I might be full of the christmas cheer but it looks ok to me.
> > >
> > >Ciao Chris
> > >
> > >XML/XSL Portal
> > >http://www.bayes.co.uk/xml
> > >
> > >
> > > XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> > >
> >
> >
> >  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> >
> >
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

-- 
-----------------------------------------------------
Ahmad J. Reeves BSc(Hons), MSc(Dist). Phd Student
Information, Media, and Communication Research Group,
Dept of Computer Science,Queen Mary,University of London, 
E1 4NS Tel +44 (0)20 7882 5257
http://www.dcs.qmw.ac.uk/imc/
-----------------------------------------------------

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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.