XML Development

Moderators: None (Apply to moderate this forum)
Number of threads: 257
Number of posts: 456

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Help transforming XML Posted by pandev on 12 Nov 2008 at 12:41 AM
Hi, I would like to transform the following XML structure.

<Region>
<description>RegionDesc</description>
<Group>
<description>GroupDesc</description>
<id>1</id>
<Events>
<Event>
<eventID>100</eventID>
</Event>
<Event>
<eventID>200</eventID>
</Event>
</Events>
</Group>
<Group>
<description>GroupDesc</description>
<id>2</id>
<Events>
</Events>
</Group>
</Region>

I would like to be able to "flatten" the view so that the number of events are stored in an attribute. I'd also like to make the parent Region's description an attribute to each Group.

<Group>
<region>RegionDesc</region>
<description>GroupDesc</description>
<id>1</id>
<eventCount>2</eventCount>
</Group>
<Group>
<region>RegionDesc</region>
<description>GroupDesc</description>
<id>2</id>
<eventCount>0</eventCount>
</Group>

Any help would be greatly appreciated!!



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.