Robert Eden wrote:
You can use tv_cat to combine the two files.
You can use tv_sort to sort by start date
hmmmm I don't see a tool to remove descriptions
xslt is perfect for this task. xslt is a language for describing xml
transformations. Download xsltproc from
http://xmlsoft.org/XSLT/index.html. There are other xslt-processors as
well, but xsltproc is the one I prefer.
Save the following to strip_descriptions.xslt:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="no" encoding="iso-8859-1"/>
<xsl:strip-space elements="*"/>
<xsl:template match="desc">
</xsl:template>
<xsl:template match="@*">
<xsl:copy/>
</xsl:template>
<xsl:template match="*">
<xsl:copy>
<xsl:apply-templates select='@*'/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Then run
xsltproc strip_descriptions.xslt < input.xml > output.xml
This takes an xmltv-file called input.xml, strips the descriptions and
sends the output to output.xml. It also strips all unnecessary
white-space to make output.xml as small as possible. output.xml will be
encoded in iso-8859-1 regardless of what input.xml was encoded in. To
change this, see the xsl:output statement in strip_descriptions.xslt.
Good luck!
/Mattias
I don't think tv_grep can do it, it just decides what records to
include.
"sed" could do it, but that doesn't help folks on windows.
Does anyone know of a easy way to cut descriptions? Maybe a new filter
should be written?
Robert
--- Holger Laux <holger.laux@xxxxxxxxxx> wrote:
I am looking for an editor, which would allow me to do the following
operations
comfortly:
- sort <program> entries by start date
- remove unwanted info such as <desc>
- join two files
Background:
I have two programs to retrieve the British channels from Radio Times
and the
German channels from TV Movie Clickfinder. The output data is then
processed to
be used in Whats On (a Palm program).
My problem is that Whats On accepts only one .PDB file, i.e. both
channel
listings have to be combined. I have tried to do that by hand, but
the resulting
XML file is about 5MB big - too much for my Palm to handle. I'd be
quite happy
with only the program title, date and time. Anything else can be
stripped out.
But how do I do that? The Replace function in text editors or MS Word
is
useless, since it does not allow me to define an instruction like
"Please remove
these two tags and anything between them from the whole document."
Any suggestions?
Many thanks,
Holger
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration
Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
xmltv-users mailing list
xmltv-users@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xmltv-users
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
xmltv-users mailing list
xmltv-users@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xmltv-users
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
|