User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 427,066 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,314 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser: Programming Forums
Views: 656 | Replies: 2
Reply
Join Date: May 2008
Posts: 1
Reputation: karthikvela is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
karthikvela karthikvela is offline Offline
Newbie Poster

XML parsing through shell scritps

  #1  
May 5th, 2008
Hi,
Am new to scripting.
Am trying to figure out whether can i use bash scripting to parse an xml file.
Parsing is not just pulling out information according to the pattern but its more of a generic parsing. I should identify the xml hierarchy and pull of information. It's not a basic parsing stuff. So what you tech guys suggest for this. Will the basic bash scripts be suffice or should i go for expat xml parser or perl parsing or whatever??

Pls suggest some tools and throw some light in this.
Any help is appreciated.
Thanks in advance.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2005
Posts: 3,639
Reputation: Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of Salem has much to be proud of 
Rep Power: 22
Solved Threads: 418
Colleague
Salem's Avatar
Salem Salem is offline Offline
void main'ers are DOOMed

Re: XML parsing through shell scritps

  #2  
May 5th, 2008
Well perl already comes with a module which uses the expat parser, and I find it to be dead easy to work with.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
Do not PM me for help; You'll be ignored, or told to learn to read.
Do not ask me if I'm muslim - I'm not. Nor do I care about yours or anyone else's mysticism. Religion is a matrix, take the RED PILL.
Reply With Quote  
Join Date: Oct 2007
Posts: 275
Reputation: eggi is on a distinguished road 
Rep Power: 1
Solved Threads: 26
eggi eggi is offline Offline
Posting Whiz in Training

Re: XML parsing through shell scritps

  #3  
May 5th, 2008
If you want to make yourself crazy, but learn alot about regexp in the meantime, use a bash script with sed and awk to extrapolate all the info. Basically, you're just looking to match and extract, so it can be done.

Per the post above, you could save yourself a gray hair or two using Perl's mod support for it. Depends on what you want to get out of the experience, I suppose.

, Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
Having trouble passing cert exams? Check out How To Pass Any Computer Certification Test!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Shell Scripting Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the Shell Scripting Forum

All times are GMT -4. The time now is 4:15 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC