Skip to Content
0
Former Member
Jan 05, 2012 at 09:58 AM

xslt requierement

13 Views

Hi Friends,

We have a tricky requirement as follows:


<input>
	<item>
		<code>A</code>
		<value>1000</value>
		<mode>A1000</mode>
	</item>
	<item>
		<code>A</code>
		<value>2000</value>
		<mode>A2000</mode>
	</item>
	<item>
		<code>B</code>
		<type>Btype</type>
	</item>
	<item>
		<code>C</code>
		<value>3000</value>
		<mode>C3000</mode>
		<type>Ctype</type>
	</item>
</input>

needed output structure;


<output>
	<CodeA>
		<item>
			<name>A</name>
			<value>1000</value>
			<mode>A1000</mode>
		</item>
		<item>
			<name>A</name>
			<value>2000</value>
			<mode>A2000</mode>
		</item>
	</CodeA>
	<CodeB>
		<item>
			<name>B</name>
			<type>Btype</type>
		</item>
	</CodeB>
	<CodeC>
		<item>
			<name>C</name>
			<value>3000</value>
			<mode>C3000</mode>
			<type>Ctype</type>
		</item>
	</CodeC>
</output>

Can anyone please guide me?

Thanks,

Peter