Perl

Moderators: Jonathan
Number of threads: 1259
Number of posts: 3644

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

Report
Help with Parsing a XML file using XML::TWIG Posted by kshahborr1 on 12 Jun 2012 at 5:12 PM
Hi,

I have a XML file which looks like :

-<FileDump>

<Version>1.2.3</Version>

-<Message>

<MsgID>12345</MsgID>

<MsgTime>2012-05-12</MsgTime>

<MsgLang>Cd ABCDEF</MsgLang>

-<Sender>

-<UserInfo>

<Surname>john</Surname>

<Initial>Peter</Initial>

<Email>Peter.john@abc.com</Email>

</UserInfo>

</Sender>

<Source Delivery Type="TO">

-<UserInfo>

<Surname>Doe</Surname>

<Initial>John</Initial>

<Email>john.Doe@abc.com</Email>

</UserInfo>

</Source>

<Source Delivery Type="BCC">

-<UserInfo>

<Surname>Doeeee</Surname>
<Initial>Johnee</Initial>

<Email>johnee.Doeeee@abc.com</Email>

</UserInfo>

</Source>

</Message>

-<Message>

<MsgID>998765</MsgID>

<MsgTime>2012-05-15</MsgTime>

<MsgLang>Cd PQRST</MsgLang>

-<Sender>

-<UserInfo>

<Surname>appa</Surname>

<Initial>Ketan</Initial>

<Email>ketan.appa@abc.com</Email>

</UserInfo>

</Sender>

<Source Delivery Type="TO">

-<UserInfo>

<Surname>duck</Surname>

<Initial>donald</Initial>

<Email>donald.Duck@abc.com</Email>

</UserInfo>

</Source>

</Message>
</FileDump>

From this file I would like the output in ":" delimeter



MsgID:MsgTime:Surname:Initial:Email:Source


I am a beginner for using XML::Twig.

Appreiate any assistance you can provide.

Regards

Kaushal



 

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.