What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 19328 |  Welcome, Guest!   Register  Login
 Home > Forums > XML > Group by in xslt from xml file ...
Nagababu

Group by in xslt from xml file

Replies: 0 | Posted by: Nagababu on 7/27/2011 | Category: XML Forums | Views: 1089 | Status: [Member] | Points: 10  


Hi,

I have added my xml file and expected output below.
I would like to know how to write an xslt file with output as xml type.
My requirement is to group the xml data based on the "NameDocumentCategor" and to bind the final xml file to a treeview.

-----------------------------------------------

XMl file

-----------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<people>
<Category>
<NameDocumentCategory>JPEG</NameDocumentCategory>
<FileNetId>1</FileNetId>
<IndexDate>Dec 2011</IndexDate>
<ChildNode>12/05/2011 -- &lt;a href="#" onclick="window.print();"&gt;NameImageType1&lt;/a&gt;JPEG</ChildNode>
<IndexType>NameImageDatetype1</IndexType>
</Category>
<Category>
<NameDocumentCategory>PDF</NameDocumentCategory>
<FileNetId>2</FileNetId>
<IndexDate>Dec 2011</IndexDate>
<ChildNode>12/07/2011 -- &lt;a href="#" onclick="window.print();"&gt;NameImageType2&lt;/a&gt;PDF</ChildNode>
<IndexType>NameImageDatetype2</IndexType>
</Category>
<Category>
<NameDocumentCategory>PDF</NameDocumentCategory>
<FileNetId>4</FileNetId>
<IndexDate>Mar 2011</IndexDate>
<ChildNode>03/02/2011 -- &lt;a href="#" onclick="window.print();"&gt;NameImageType2&lt;/a&gt;PDF</ChildNode>
<IndexType>NameImageDatetype2</IndexType>
</Category>
<Category>
<NameDocumentCategory>MDF</NameDocumentCategory>
<FileNetId>3</FileNetId>
<IndexDate>Dec 2011</IndexDate>
<ChildNode>12/09/2011 -- &lt;a href="#" onclick="window.print();"&gt;NameImageType4&lt;/a&gt;MDF</ChildNode>
<IndexType>NameImageDateType3</IndexType>
</Category>
</people>
-----------------------------------------------------------------

Expected output:

----------------------------------------------

PDF

3/2/2011 12:00:00 AM_NameImageType2
12/7/2011 12:00:00 AM_NameImageType2

JPEG

12/5/2011 12:00:00 AM_NameImageType1

MDF

12/9/2011 12:00:00 AM_NameImageType4
--------------------------------------------------------------

Thanks,
Nagababu.


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

  No reply found.


Reply - Please login to reply


Click here to login & reply

Found interesting? Add this to:


 Latest Posts

Write New Post | More ...

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/24/2013 7:12:48 PM