Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: help wtih xslt transforms

  1. #1
    Join Date
    Aug 2005
    Location
    Houston
    Posts
    4,395

    EPG Enhancement XSL Transform [UltraXMLTV-Alternative]

    Update: attached to this post is latest version, with all features..
    **** Edit limit# of actors/guests/etc at top of .xslt file [4 and 8 seem to be good choices to start with]

    I made a xslt transform that is an XMLTV epg enhancer..it adds actor/guest to description, and some other things..
    [if editing large xml, it blows doors off any other method unreal performance..
    for example, a single .vbs date transform using msxml took 3 minutes,
    while 12 transforms in a .xslt on same file took 8 seconds! those same transforms in pure vbs took 30 mins!!]

    To Run:
    msxsl.exe input.xml xmltv.xslt -o output.xml 2>>enhancer.log

    [input and output can be the same file, overwriting input with output]
    try it on your epg .xml and check out the output in notepad...i'm very happy with results..
    only takes about 10 secs to edit 2 weeks worth of 150 channels data!!!

    i've now deciphered most of xslt processing so can pretty much do anything i need with it...
    so make any suggestions, while i can still remember it all...LOL
    Works well on xp [probably win2k also w/msxml 4.0] thru win7 sp1, 64bit and 32bit equally well..no special permissions needed..

    Example of output:
    Code:
    <programme start="20120328020000 -0500" stop="20120328030000 -0500" channel="I8.28459889.microsoft.com" clumpidx="0/1">
              <title lang="en">Doctor Who</title>
              <sub-title>Cold Blood(509)</sub-title>
              <desc>(05-29-2010)Scientists discover something isn't right beneath the Earth's crust.
    
         Actors: Matt Smith, Karen Gillan, Arthur Darvill
         Guest: Neve McIntosh, Meera Syal
         Director: Ashley Way
    </desc>
    			<category lang="en">Drama</category>
    			<category lang="en">Episodic</category>
    			<category lang="en">Series</category>
    		<subtitles type="teletext"></subtitles>
    		<previously-shown start="20100529000000"></previously-shown>
    		<episode-num system="onscreen">509</episode-num>
    		<episode-num system="xmltv_ns">..1/2</episode-num>
    		<episode-num system="dd_progid">EP00750178.0082.1/2</episode-num>
    	</programme>
    UltraXMLEnhancer was just too unstable, but i'm spoiled with the extras, ever since I-XmlTV enahancer from the old days...lol

    Attached below is latest version: 0.8
    I will be rewriting it completely as to make it more structured and modular.. [hopefully it'll help with xml indents]

    EDIT for .8: Added Paid Programming alteration, replaces them with 'Ad' and erases description..
    Attached Files Attached Files
    Last edited by pBS; 2013-05-10 at 12:52 AM. Reason: fixed dd_progid episode #s
    1. C2D 1.6ghz XPPro, ATI HD4650lowprofile,Cat 8.11, Aver M780, KWorld PCI 120, MVP, GBpvr 1.4.7, Comm. Skin. VFD, Imon plugin w/SmartieLCD[custom]
    2. C2D 2.53, XPPro, ATI HD3450, Kworld 330U, Comm. Skin, GBpvr 1.4.7
    Author: Pvrx2 utils- Simple Archiver.bat, NTFSLinker [Junction gui]
    Universal Util: MCE Remote no-software trick and Shutdown Protector
    3. Zotac Mini ITX G41[$84] + ati 650pro pcie[$29], Celeron duo[$22] BDRom drive [$48]

  2. #2
    Join Date
    Dec 2005
    Location
    UK
    Posts
    1,551
    Thank you for this. The xslt does a super job with actors and all that.

    Congratulations on getting your head round xslt. I googled and read, and googled and read some more, and then gave up. There is a reason that I have never worked as a programmer!
    AMD A75, 4 Gig, 1000 Gig, Nvidia N210
    1 x Blackgold BGT3620 dual DVB-T2
    1 x kworld USB dual DVB-T (IT9135)
    2 x Hauppauge Nova-t PCI

  3. #3
    Join Date
    Dec 2004
    Location
    West Yorkshire, UK
    Posts
    4,497
    @pBS - I found a blog about formatting dates/times with xslt here.

    There's a template called FormatDate which looks like it will do what you want for your date strings. The xslt file is downloadable from a link further down that page.

  4. #4
    Join Date
    Aug 2005
    Location
    Houston
    Posts
    4,395
    sweet...thanx
    turns out that was just tryin to do too much with vbs, i've been using the xslt and vbs together cuz it's just easier to tweak little stuff, and it only takes 3 mins total!
    but i would like to get it to be all xslt...just not sure if there's any string manipulation available..didn't find a single example..

    i didn't think it could parse a improperly formatted input date string..thanx..

    now just o see if i can limit the number of actors...lol
    1. C2D 1.6ghz XPPro, ATI HD4650lowprofile,Cat 8.11, Aver M780, KWorld PCI 120, MVP, GBpvr 1.4.7, Comm. Skin. VFD, Imon plugin w/SmartieLCD[custom]
    2. C2D 2.53, XPPro, ATI HD3450, Kworld 330U, Comm. Skin, GBpvr 1.4.7
    Author: Pvrx2 utils- Simple Archiver.bat, NTFSLinker [Junction gui]
    Universal Util: MCE Remote no-software trick and Shutdown Protector
    3. Zotac Mini ITX G41[$84] + ati 650pro pcie[$29], Celeron duo[$22] BDRom drive [$48]

  5. #5
    Join Date
    Aug 2005
    Location
    Houston
    Posts
    4,395
    thank you thank you..i finally found out how to do string manipulations..even if/thens etc../weee!
    i've got the date fixed, even altering if the date's only a year, so 2007-2-12 or 2007 work without adding extra '--' [2007 = '2007' instead of '2007--' when month/days aren't there]

    sweet...now don't need vbs anymore...lol
    processing time is now 10 secs for 28 meg file!!!
    will upload adjustments as soon as i adjust the extra prog_id episode numbers....[currently only grabbing 'onscreen' ep num]

    [Ultra took 3 minutes to process same thing...:P]
    Last edited by pBS; 2012-03-31 at 01:32 AM.
    1. C2D 1.6ghz XPPro, ATI HD4650lowprofile,Cat 8.11, Aver M780, KWorld PCI 120, MVP, GBpvr 1.4.7, Comm. Skin. VFD, Imon plugin w/SmartieLCD[custom]
    2. C2D 2.53, XPPro, ATI HD3450, Kworld 330U, Comm. Skin, GBpvr 1.4.7
    Author: Pvrx2 utils- Simple Archiver.bat, NTFSLinker [Junction gui]
    Universal Util: MCE Remote no-software trick and Shutdown Protector
    3. Zotac Mini ITX G41[$84] + ati 650pro pcie[$29], Celeron duo[$22] BDRom drive [$48]

  6. #6
    Join Date
    Dec 2004
    Location
    West Yorkshire, UK
    Posts
    4,497
    processing time is now 10 secs for 28 meg file!!!
    That's impressive.

    I only looked briefly at xslt a few years back. I remember the processing was incredibly fast for a few of the example exercises I tried out but in the end it was a steep learning curve and I only had simple requirements for processing some basic XML at the time so didn't stick with it.

  7. #7
    Join Date
    Aug 2005
    Location
    Houston
    Posts
    4,395
    try this one on for size....dates and episode numbers included..


    Anything else i should add?

    i basically just mimicked the 'Zehd's picks' from UltraXMLTVEnhancer
    and it scrapes the episode numbers from either 'onscreen' or 'dd_progid', preferring the 'onscreen' if both are found...
    all extra info is copied as is...[categories,video,etc]
    i'll add the subtitle/caption stuff and anything else i can find later...

    UPDATE:[fixed: ignore episode numbers less than 1, added currency bullet instead of *]
    fixed indenting

    i'll probably release a separate template to limit actors,etc. so you can apply it also or not..
    but i've gotten to like all the extra info, even if it doesn't all fit on tvguide screen, it's all visible on the popups..
    Last edited by pBS; 2012-04-02 at 06:42 PM. Reason: updated: removed episode # less than 0 [movies] and fixed indenting
    1. C2D 1.6ghz XPPro, ATI HD4650lowprofile,Cat 8.11, Aver M780, KWorld PCI 120, MVP, GBpvr 1.4.7, Comm. Skin. VFD, Imon plugin w/SmartieLCD[custom]
    2. C2D 2.53, XPPro, ATI HD3450, Kworld 330U, Comm. Skin, GBpvr 1.4.7
    Author: Pvrx2 utils- Simple Archiver.bat, NTFSLinker [Junction gui]
    Universal Util: MCE Remote no-software trick and Shutdown Protector
    3. Zotac Mini ITX G41[$84] + ati 650pro pcie[$29], Celeron duo[$22] BDRom drive [$48]

  8. #8
    Join Date
    Aug 2005
    Location
    Houston
    Posts
    4,395
    finally got it to limit actors/guests/etc ...
    [the dang commas were a pain!]

    so now limited to 5 actors/guests per show...
    also altered date to be mm-dd-yyyy instead of yyyy-mm-dd..
    and added a tab before actors/etc for clarity..

    Please let me know if you have any requests...

    Edit1: added formatting for better reading, corrected limit of 4 to 5 actors..enhanced batch file..
    included xmltv.dtd file..
    Edit2: added previouslyshown and new tags, and subtitles...[as-is]
    So it doesn't strip any info except the tags it adds to descriptions.

    Edit3: Finally figured out how to order the credits tags!!
    now have actors,then guests, then the rest at the end..


    Last edited by pBS; 2012-04-02 at 06:41 PM. Reason: oops, was set to 4 not 5 actors
    1. C2D 1.6ghz XPPro, ATI HD4650lowprofile,Cat 8.11, Aver M780, KWorld PCI 120, MVP, GBpvr 1.4.7, Comm. Skin. VFD, Imon plugin w/SmartieLCD[custom]
    2. C2D 2.53, XPPro, ATI HD3450, Kworld 330U, Comm. Skin, GBpvr 1.4.7
    Author: Pvrx2 utils- Simple Archiver.bat, NTFSLinker [Junction gui]
    Universal Util: MCE Remote no-software trick and Shutdown Protector
    3. Zotac Mini ITX G41[$84] + ati 650pro pcie[$29], Celeron duo[$22] BDRom drive [$48]

  9. #9
    Join Date
    Aug 2005
    Location
    Houston
    Posts
    4,395

    Now easy adjustments of actor/guest limits!

    in addition to the reordering of credits, i added a variable you can set for the limits of actors/guests...
    just edit number at top of xmltv.xslt...[set to 5 by default]

    added episode-num back to xml data to enable gbpvr/npvr to skip previously-recorded episodes...

    pretty much complete this one.. let me know if any problems/suggestions...

    Enjoy!

    [current file attached to first post]
    Last edited by pBS; 2012-04-02 at 06:19 PM. Reason: added episode-num back to xml data for skip previous
    1. C2D 1.6ghz XPPro, ATI HD4650lowprofile,Cat 8.11, Aver M780, KWorld PCI 120, MVP, GBpvr 1.4.7, Comm. Skin. VFD, Imon plugin w/SmartieLCD[custom]
    2. C2D 2.53, XPPro, ATI HD3450, Kworld 330U, Comm. Skin, GBpvr 1.4.7
    Author: Pvrx2 utils- Simple Archiver.bat, NTFSLinker [Junction gui]
    Universal Util: MCE Remote no-software trick and Shutdown Protector
    3. Zotac Mini ITX G41[$84] + ati 650pro pcie[$29], Celeron duo[$22] BDRom drive [$48]

  10. #10
    Join Date
    Aug 2005
    Location
    Houston
    Posts
    4,395
    New! Paid Programming obliteration!
    Any show with 'paid programming' as a category, gets title replaced with 'Ad', and erases description so all those adverts are easy to spot with the eye..
    [and take up much less space in epg]
    it's the only change for .8 version..
    [updated in first post]
    Last edited by pBS; 2012-08-02 at 08:58 PM.
    1. C2D 1.6ghz XPPro, ATI HD4650lowprofile,Cat 8.11, Aver M780, KWorld PCI 120, MVP, GBpvr 1.4.7, Comm. Skin. VFD, Imon plugin w/SmartieLCD[custom]
    2. C2D 2.53, XPPro, ATI HD3450, Kworld 330U, Comm. Skin, GBpvr 1.4.7
    Author: Pvrx2 utils- Simple Archiver.bat, NTFSLinker [Junction gui]
    Universal Util: MCE Remote no-software trick and Shutdown Protector
    3. Zotac Mini ITX G41[$84] + ati 650pro pcie[$29], Celeron duo[$22] BDRom drive [$48]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •