logo       

Re: XMLTV Editor?: msg#00018

Subject: Re: XMLTV Editor?
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


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
python.cheetah/...    linux.altlinux....    qnx.openqnx.dev...    horde.cvs/2002-...    os.openbsd.misc...    web.zope.cvs/20...    fsf.proofreader...    emulators.wine....    kde.promotion/2...    yellowdog.gener...    creativecommons...    user-groups.lin...    xfree86.fonts/2...    ietf.ips/2006-1...    jakarta.velocit...    redhat.fedora.c...    text.xml.cocoon...    security.ossim....    games.mud.devel...    bacula.user/200...    video.videodb.d...    netbsd.devel.ww...    apache.webservi...    db.mysql.c++/20...    music.equipment...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe