Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: XML XSLT Grouping
<?xml version="1.0"?>
<ZaSlanje>
	<dokument>
		<DatumSlanja>2006-08-31T12:14:10</DatumSlanja>
		<Obrazac>PA</Obrazac>
		<MaticniBroj>99999999</MaticniBroj>
		<RedniBroj>05</RedniBroj>
		<Racun>
			<BrojRacuna>5427</BrojRacuna>
			<Valuta>
				<OznakaValute>AUD</OznakaValute>
				<IznosVal>23.80</IznosVal>
			</Valuta>
			<Valuta>
				<OznakaValute>USD</OznakaValute>
				<IznosVal>88975.65</IznosVal>
			</Valuta>
		</Racun>
		<Racun>
			<BrojRacuna>5482</BrojRacuna>
			<Valuta>
				<OznakaValute>CAD</OznakaValute>
				<IznosVal>2923.74</IznosVal>
			</Valuta>
			<Valuta>
				<OznakaValute>CHF</OznakaValute>
				<IznosVal>500.28</IznosVal>
			</Valuta>
		</Racun>
		<Racun>
			<BrojRacuna>5525</BrojRacuna>
			<Valuta>
				<OznakaValute>CHF</OznakaValute>
				<IznosVal>19184.03</IznosVal>
			</Valuta>
			<Valuta>
				<OznakaValute>EUR</OznakaValute>
				<IznosVal>1014312.64</IznosVal>
			</Valuta>
		</Racun>
	</dokument>
</ZaSlanje>
Posted 31-Aug-12 3:53am
Comments
Kuthuparakkal at 31-Aug-12 9:18am
   
need more info ?
What' source, what's target etc.. any coding etc. hit improve question and make itt clear.. what have you tried so far, where are you stuck..
blartrisa at 31-Aug-12 9:45am
   
Well, I've got problem with grouping. With next transf. I get the xml below. Can't group by BrojRacuna value...

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	<xsl:template match="/DOC">
		<doc>
		<xsl:for-each select="SlogPA">
		      <racun>
			
 
			        <xsl:value-of select="BrojRacuna" />
			</brojracuna>
	                             <valuta>
			 <oznakavalute>
                                                         <xsl:value-of select=" OznakaValute " />
                                                 </oznakavalute> 
                          <iznosval>
                     <xsl:value-of select=" IznosVal " />
                      </iznosval> 
	</valuta>
	</racun>
	</xsl:for-each>
</doc>
</xsl:template>
</xsl:stylesheet>
 

 
  
- <zaslanje>
- <dokument>
 <datumslanja>18.08.2012</datumslanja>
 <obrazac>PA</obrazac>
 <maticnibroj>07654812</maticnibroj>
 <rednibroj>3</rednibroj>
- <racun>
 
5427</brojracuna>
- <valuta>
 <oznakavalute>EUR</oznakavalute>
 <iznosval>143324</iznosval>
 </valuta>
 </racun>
- <racun>
 
5427</brojracuna>
- <valuta>
 <oznakavalute>USD</oznakavalute>
 <iznosval>25354</iznosval>
 </valuta>
 </racun>
- <racun>
 
5427</brojracuna>
- <valuta>
 <oznakavalute>CHF</oznakavalute>
 <iznosval>92616</iznosval>
 </valuta>
 </racun>
- <racun>
 
5482</brojracuna>
- <valuta>
 <oznakavalute>EUR</oznakavalute>
 <iznosval>210586</iznosval>
 </valuta>
 </racun>
- <racun>
 
5482</brojracuna>
- <valuta>
 <oznakavalute>USD</oznakavalute>
 <iznosval>-328556</iznosval>
 </valuta>
 </racun>
- <racun>
 
5482</brojracuna>
- <valuta>
 <oznakavalute>CHF</oznakavalute>
 <iznosval>-446526</iznosval>
 </valuta>
 </racun>
 </dokument>
 </zaslanje>
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 304
1 Maciej Los 285
2 Sergey Alexandrovich Kryukov 255
3 Shweta N Mishra 216
4 PIEBALDconsult 174
0 OriginalGriff 7,660
1 Sergey Alexandrovich Kryukov 7,072
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,760


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 31 Aug 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100