--- On Sun, 4/5/09, Michael A. Peters <mpeters@xxxxxxx> wrote: > From: Michael A. Peters <mpeters@xxxxxxx> > Subject: Better way to this ?? Query database to xml > To: "General discussion about the RPM package manager" <rpm-list@xxxxxxxxxxxxx> > Date: Sunday, April 5, 2009, 1:40 PM > The ugly string > > rpm -qa --qf '<package name="%{name}">\n \ > <epoch>%{epoch}</epoch>\n \ > <version>%{version}</version>\n \ > <release>%{release}</release>\n \ > <arch>%{arch}</arch> \ > <summary>%{summary}</summary>\n > <vendor>%{vendor}</vendor>\n</package>\n' > > The issue - it can produce malformed xml because vendor > string can and does sometimes contain < and > > > I'm thinking there probably is a better to do it with > python straight from the database? Maybe even something > already exists for this? There is a --xml flag for rpm. Or another option something like this (to make string even more ugly :) rpm -qa --qf '@MY_SMALL@package name="%{name}"@MY_BIG@\n ...' | sed -e 's/</</g' -e 's/>/>g' -e 's/@MY_SMALL@/</g' -e 's/@MY_BIG@/>/g' Valery. > _______________________________________________ > Rpm-list mailing list > Rpm-list@xxxxxxxxxxxxx > http://lists.rpm.org/mailman/listinfo/rpm-list > _______________________________________________ Rpm-list mailing list Rpm-list@xxxxxxxxxxxxx http://lists.rpm.org/mailman/listinfo/rpm-list