xml to delimited text/spreadsheet script?

I don’t suppose anyone has a script already that automatically pulls apart the opensuse xml package lists and reformats into a delimited text / spreadsheet format ?

something like:

from:

<package type=“rpm”>
<name>anjuta-lang</name>
<arch>noarch</arch>
<version epoch=“0” ver=“3.2.1” rel=“1.2”/>
<checksum type=“sha256” pkgid=“YES”>73edc6ea595c0e1cb96c79e4a941055b257b01c6feb79aa91888533cd66b3cb7</checksum>
<summary>Languages for package anjuta</summary>
<description>Provides translations to the package anjuta</description>
<packager>http://bugs.opensuse.org</packager>
<url>http://anjuta.sourceforge.net/</url>
<time file=“1319960406” build=“1319960214”/>
<size package=“1619186” installed=“10182539” archive=“10331192”/>
<location href=“noarch/anjuta-lang-3.2.1-1.2.noarch.rpm”/>
<format>
<rpm:license>GPLv2+</rpm:license>
<rpm:vendor>openSUSE</rpm:vendor>
<rpm:group>System/Localization</rpm:group>
<rpm:buildhost>build24</rpm:buildhost>
<rpm:sourcerpm>anjuta-3.2.1-1.2.src.rpm</rpm:sourcerpm>
<rpm:header-range start=“872” end=“131639”/>
<rpm:provides>
<rpm:entry name=“anjuta-lang-all” flags=“EQ” epoch=“0” ver=“3.2.1”/>
<rpm:entry name=“anjuta-lang” flags=“EQ” epoch=“0” ver=“3.2.1” rel=“1.2”/>
</rpm:provides>
<rpm:requires>
<rpm:entry name=“anjuta” flags=“EQ” epoch=“0” ver=“3.2.1”/>
</rpm:requires>
<rpm:supplements>
<rpm:entry name=“packageand(bundle-lang-other:anjuta)”/>
</rpm:supplements>

</format>
</package>

into:

name|arch|version-rel|summary| …

thanks

This site is able to spew out some info
Convert CSV Text to XML / HTML Online
http://paste.opensuse.org/images/59698649.png

thanks vazhavandan for the quick reply,

I have a sourceforge program that does the same, the problem seems to be that those available on the net are all “xxxx to xml”. I was hoping there was an internally created one that worked the other way. Especially as the current packagelist is some 76meg in size when uncompressed, and here in Australia data is not cheap, especially when on satellite as I am!

If you know some java then you can customise and extend my program

refer :- Tutorial, Introduction to XML and XML with Xerces for Java (updated for jdk 1.5 and xerces 2.7.1) <== this has been customised

parser class :- SUSE Paste

parser data holder :- SUSE Paste

package xml :- SUSE Paste

sample output :- SUSE Paste

pastes will expires in 3 months

On 2013-02-13, scsijon <scsijon@no-mx.forums.opensuse.org> wrote:
>
> thanks vazhavandan for the quick reply,
>
> I have a sourceforge program that does the same, the problem seems to
> be that those available on the net are all “xxxx to xml”. I was hoping
> there was an internally created one that worked the other way.

A Python alternative that can eat xml so you can convert to whatever
format you like: http://pypi.python.org/pypi/elementtree/

scsijon, you can try to import the xml file into a native xml database (e.g. sedna) and then use an xquery to pull out whatever you like and write to a file. This way needs some effort, but it gives you full control.