IT Community - Software Programming, Web Development and Technical Support

How to generate nodes of XML in the required format?

This is a discussion on How to generate nodes of XML in the required format? within the ASP and ASP.NET Programming forums, part of the Web Development category; Hi, I am getting XML file in the following format, <ViewCategory > <Menu Id="21" MenuName=&...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > ASP and ASP.NET Programming

Register FAQ Members List Calendar Mark Forums Read
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 02-13-2008, 05:08 AM
poornima poornima is offline
D-Web Sr.Programmer
 
Join Date: Dec 2007
Posts: 189
poornima is on a distinguished road
Smile How to generate nodes of XML in the required format?

Hi,
I am getting XML file in the following format,
<ViewCategory >
<Menu Id="21" MenuName="Test1" cId="2" CategoryName="Book"/>
<Menu Id="21" MenuName="Test1" cId="3" CategoryName="Computer"/>
<Menu Id="22" MenuName="Test2" cId="4" CategoryName="Book1"/>
<Menu Id="21" MenuName="Test2" cId="5" CategoryName="Computer1"/>
</ViewCategory>

How to convert into the following format?

<Menu Id="21" MenuName="Test1">
<Category cId="2" CategoryName="Book" />
<Category cId="3" CategoryName="Computer" />
</Menu>
<Menu Id="22" MenuName="Test2">
<Category cId="4" CategoryName="Book"1 />
<Category cId="5" CategoryName="Computer1" />
</Menu>
</ViewCategory>
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 02-14-2008, 08:31 PM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo to kingmaker
Default Re: How to generate nodes of XML in the required format?

Using For XML Explicit u can create customized XML Format
__________________
The KINGMAKER
Makes Every Thing Possible

Stuffs (My Blog)
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-14-2008, 09:17 PM
poornima poornima is offline
D-Web Sr.Programmer
 
Join Date: Dec 2007
Posts: 189
poornima is on a distinguished road
Smile Re: How to generate nodes of XML in the required format?

Hi,
Thanks.Could you provide sample code tat uses For Explicit here
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/asp-asp-net-programming/5245-how-generate-nodes-xml-required-format.html
Posted By For Type Date
DiscussWeb IT Community - Technical Support and Technology Discussions This thread Refback 02-13-2008 05:18 AM

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Read xml nodes using XPathNavigator? oxygen C# Programming 3 02-22-2008 10:29 PM
How do I generate a random number from php? itbarota PHP Programming 2 09-25-2007 08:57 AM
Explain why encapsulation is required? vigneshgets C and C++ Programming 1 08-01-2007 03:10 AM
How do I generate a random number from php? kingmaker PHP Programming 2 07-24-2007 02:56 AM
Is it required ? Maneel Game Development 4 03-14-2007 09:11 PM


All times are GMT -7. The time now is 05:54 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0