Re: [xsl] Applying Attributes with Grouping Method

Subject: Re: [xsl] Applying Attributes with Grouping Method
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 21 Mar 2007 12:48:35 GMT
> I'm tired of banging my head against the wall.

Keep doing it, you get used to it eventually!

> Now, I can get the name attributes grouped using the Muenchian Method
> in

you are using saxon8 so XSLT2 so you don't need Muenchian grouping,
once I'd made your input example well formed, it's just a call to

	<conn name="P21" part="W1123">
		<property name="s_des" val="Part_A"/>
	<conn name="P22" part="W1123">
		<property name="s_des" val="Part_A"/>
	<conn name="P23" part="W1123">
		<property name="s_des" val="Part_A"/>
	<conn name="J31" part="W1144">
		<property name="s_des" val="Part_B"/>
	<conn name="J32" part="W1145">
		<property name="s_des" val="Part_C"/>

<xsl:stylesheet version="2.0" xmlns:xsl="";>
  <xsl:output indent="yes"/>

  <xsl:template match="connection">
      <xsl:for-each-group select="conn" group-by="property[@name='s_des']/@val">
	<item part="{@part}" 


$ saxon8 connection.xml  connection.xsl 
<?xml version="1.0" encoding="UTF-8"?>
   <item part="W1123" uantity="3" val="Part_A" name="P21 P22 P23"/>
   <item part="W1144" uantity="1" val="Part_B" name="J31"/>
   <item part="W1145" uantity="1" val="Part_C" name="J32"/>


Current Thread