W3C home > Mailing lists > Public > xmlschema-dev@w3.org > April 2007

RE: Need to combine duplicate tags in the file

From: Michael Kay <mike@saxonica.com>
Date: Thu, 5 Apr 2007 09:16:47 +0100
To: "'Vandna Sharma'" <sharmav@Excelergy.com>, <xmlschema-dev@w3.org>
Message-ID: <008201c7775a$c1739d10$6401a8c0@turtle>

You seem to have posted an XSLT question to an XML Schema list.

Try the xsl-list at www.mulberrytech.com

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: xmlschema-dev-request@w3.org 
> [mailto:xmlschema-dev-request@w3.org] On Behalf Of Vandna Sharma
> Sent: 04 April 2007 18:43
> To: xmlschema-dev@w3.org
> Subject: Need to combine duplicate tags in the file
> 
> 
> I am trying to combine the meter number when there is any 
> duplicate meter number in the file.  Can some please help.
> 
> <xsl:variable name="MeterNumber">
> 							
> <xsl:value-of select="count(Record[@Name='6000']/Meter_Number)"/>
> 								
>  </xsl:variable>
> 							
> 				<xsl:choose>
> 					<xsl:when 
> test="Record[@Name='6000']">	
> 						<ServiceInformation>
> 							
> 							
> <xsl:when test="$MeterNumber= 1">
> 							
> <xsl:for-each select="Record[@Name='6000']/Meter_Number">
> 								
> <Service>
> 								
> 	<MeterInformation>
> 									
> 								
> 			
> 
> 
> 
> XML FILE
> 
> <Record Name="1000" RecNum="1">
> 			<Rec_Indicator>1000</Rec_Indicator>
> 			<Doc_Id>1009271927</Doc_Id>
> 			<Record Name="2000" RecNum="2">
> 				<Rec_Indicator>2000</Rec_Indicator>
> 				
> <Sender_Trans_Id>C63433</Sender_Trans_Id>
> 				<Record Name="3000" RecNum="3">
> 					
> <Rec_Indicator>3000</Rec_Indicator>
> 					
> <Sender_Trans_Id>C63433</Sender_Trans_Id>
> 					<Id_Code>8S</Id_Code>
> 					<DUNS_Number>100</DUNS_Number>
> 					<Name>DELIVERY</Name>
> 				</Record>
> 				<Record Name="3000" RecNum="4">
> 					
> <Rec_Indicator>3000</Rec_Indicator>
> 					
> <Sender_Trans_Id>C63433</Sender_Trans_Id>
> 					</Record>
> 				<Record Name="3000" RecNum="5">
> 					
> <Rec_Indicator>3000</Rec_Indicator>
> 					
> <Sender_Trans_Id>C63433</Sender_Trans_Id>
> 					<Id_Code>SJ</Id_Code>
> 					
> <DUNS_Number>343341</DUNS_Number>
> 					<Name>ENERGY</Name>
> 				</Record>
> 				<Record Name="4000" RecNum="6">
> 					
> <Rec_Indicator>4000</Rec_Indicator>
> 					
> <Postal_Code>7214618</Postal_Code>
> 				</Record>
> 				<Record Name="5000" RecNum="7">
> 					
> <Rec_Indicator>5000</Rec_Indicator>
> 					
> <Premise_Type_Code>01</Premise_Type_Code>
> 				</Record>
> 				<Record Name="6000" RecNum="8">
> 					
> <Rec_Indicator>6000</Rec_Indicator>
> 					
> <Meter_Number>057676727GE</Meter_Number>
> 					</Record>
> 				<Record Name="6000" RecNum="8">
> 					
> <Rec_Indicator>6000</Rec_Indicator>
> 					
> <Meter_Number>057676727GE</Meter_Number>
> 					</Record>
> 				<Record Name="6000" RecNum="8">
> 					
> <Rec_Indicator>6000</Rec_Indicator>
> 					
> <Meter_Number>123590890HE</Meter_Number>
> 					</Record>
> 			</Record>
> 			<Record Name="9900" RecNum="9">
> 				<Rec_Indicator>9900</Rec_Indicator>
> 				<Doc_Id>1009271927</Doc_Id>
> 				
> <Records_Generated>5862</Records_Generated>
> 			</Record>
> 		</Record>
> 
> 
> 
> Thanks
> Vandna
> 
> 
> 
Received on Thursday, 5 April 2007 08:16:54 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:59 GMT