Is there an XML-manipulation tool for Linux?
Dear All,
I have received an XML document that I need to process and then output in a user-readable format. Does anyone know of a Linux XML-manipulation tool that I can use with shell script? Regards, QuietLeni |
Depending on how complex the XML code is, and just how much info you want to extract, there are several options.
The simplest method is, of course, to use a shell regular expression to grab the text between whatever XML tags you wish to display or save, and perhaps parse out and handle or delete any embedded tags in that text. I use that method to convert XML RSS feeds to plain text. On the other end of the scale, some folks have created bash extensions for the expat XML library, a web search should show you examples. Some of them are overly complex and arcane, in my opinion, but take that with a grain of salt, it is only an opinion. |
Perl has several XML modules eg http://search.cpan.org/~mirod/XML-Twig-3.32/Twig.pm, http://search.cpan.org/~grantm/XML-S.../XML/Simple.pm
|
Quote:
|
Hi!
If it is well-behaved XML - IE well formed, you should be able to simply open/view it with your webbrowser. Double-click the file, I bet the browser will start up and display the text... My reasoning? If it is prinable XML, it has to have an accompanying DTD file that dictates how the browser (or indeed any XMLcapable piece of software) has to display the data... If not, then the XML could "belong" to some receicing software. As with many settings, software saves these a XML, without the DTD, as the data needs no displaying... Grtz! Thor |
All times are GMT -5. The time now is 12:45 AM. |