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

Re: Need xsl help

Subject: Re: Need xsl help
From: "David Carlisle d.p.carlisle@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 8 Sep 2016 18:26:43 -0000
Re:  Need xsl help
This doesn't seem to match your description, but it produces the expected
output, it just takes the first Contact with each unique Nid value

<xsl:stylesheet version="2.0" xmlns:xsl="
http://www.w3.org/1999/XSL/Transform">
 <xsl:output method="xml" indent="yes" omit-xml-declaration="no"/>
 <xsl:strip-space elements="*"/>
 <xsl:template match="objects">
  <xsl:for-each-group select="Contact" group-by="Nid">
   <xsl:copy-of select="."/>
  </xsl:for-each-group>
 </xsl:template>
</xsl:stylesheet>


$ saxon9 nid2.xml nid2.xsl
<?xml version="1.0" encoding="UTF-8"?>
<Contact>
   <Id>003j000001DQMkcAAH</Id>
   <Updateeddate>2016-09-08T10:31:24.000Z</Updateeddate>
   <Nid>892828740</Nid>
</Contact>
<Contact>
   <Id>003j000001DQMlXAAX</Id>
   <Updateeddate>2016-09-08T10:22:47.000Z</Updateeddate>
   <Nid>879284114</Nid>
</Contact>
<Contact>
   <Id>003j000001DQMlYAAX</Id>
   <Updateeddate>2016-09-08T10:22:47.000Z</Updateeddate>
   <Nid>882692370</Nid>
</Contact>


David

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.