Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: Need to combine duplicate tags in the file

From: "Michael Kay" <mike@--------.--->
To: "'Vandna Sharma'" <sharmav@---------.--->, <xmlschema-dev@--.--->
Date: 4/5/2007 10:17:00 AM
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@w... 
> [mailto:xmlschema-dev-request@w...] On Behalf Of Vandna Sharma
> Sent: 04 April 2007 18:43
> To: xmlschema-dev@w...
> 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
> 
> 
> 


From mike@s... Thu Apr 05 08:41:23 2007
Received: from maggie.w3.org ([193.51.208.68])
	by frink.w3.org with esmtp (Exim 4.50)
	id 1HZNX0-0004CB-UG
	for 


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent