on 05-05-2008 2:05 PM
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.
The xmlstarlet program was designed to both read and transform xml from the shell prompt. It's available at
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I guess it's quite complicated to parse XML using shell scripts (bash etc.)
If you want to parse XML using a scripting language I suppose you use an adequate library or module available for that scripting language. I prefer PERL.
There is a lot of stuff available for PERL (see search.cpan.org and type XML as value for your search in order to find some modules)
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Karthik,
WELCOME TO SDN
please check this link
http://www.unix.com/shell-programming-scripting/63821-xml-parsing-through-shell-scritps.html
Best regards,
raam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Shell scripts by themselves may not be adequate for this. You should look in to using AWK, it's better suited for pattern processing.
-RK
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.