xsl-list
[Top] [All Lists]

Re: [xsl] Need xsl help

2016-09-08 13:26:48
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
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--
<Prev in Thread] Current Thread [Next in Thread>