Sign up here and you can log into the forum!

XSL Support for templates

Support forum for the great ThumbGen software

Re: XSL Support for templates   

Postby Buhric » Sat Mar 12, 2011 12:00 am

to be able to use "special" charaters like ">" or "&" you might need to use the XML escape characters for those...
like "&" --> &
">" --> >

not sure what ":" would be.... if it has any...
Buhric
Global Moderator
 
Posts: 616
Joined: Thu Apr 15, 2010 2:49 pm

Re: XSL Support for templates   

Postby s1l3nc0r » Mon Mar 14, 2011 10:02 am

There doesn't seem to be anxml escape character for the : symbol

Would it be possible to set up the formula in a way that it accepts only the entire entered string ?
Maybe by changing the ' symbols to " ?
s1l3nc0r
WDTVer
 
Posts: 29
Joined: Tue Aug 24, 2010 5:02 am

Re: XSL Support for templates   

Postby Buhric » Fri Mar 18, 2011 9:49 pm

I really don't see where the script would fail....
It basicaly tries to find a string inside another string.... no matter what characters are used... it should work....

This got me curious....
can some one PM me a full template (XML + XLST) and all files related, and and example of what the issue is...
Buhric
Global Moderator
 
Posts: 616
Joined: Thu Apr 15, 2010 2:49 pm

Re: XSL Support for templates   

Postby farms9000 » Wed Apr 20, 2011 8:30 am

I don't know anything about xsl/xml. So before I start something that is not even possible I want to run it by you guys.

I have some DVD ISO files from tvshows and I'm creating the coverart with thumbgen. In my template I have added the episodelist and during processing I manualy delete all the episodes that are not on the disc from the episodelist. This way I get the epiodelist of the episodes that are on the disc.

Is it possible to automate this with XSL if I put the episode numbers in the filename. So for example I have a file like this "serietitle S01E02 (5-8).iso" Thumbgen will then create a template based on the information of episode 2 from season 1. Then the XSL should delete all the episodetitles and numbers except episodes 5 to 8 from %EPISODENAMESLIST% and %EPISODELIST%. This way the episodelist only consists of the episodes on the disc.

If this is possible is it complex? or could a noob do it.

thanks
farms9000
n00b
 
Posts: 3
Joined: Wed Apr 20, 2011 8:15 am

Re: XSL Support for templates   

Postby Buhric » Wed Apr 20, 2011 6:48 pm

yep its doable with XLST,
a Noob would be able to do it, if he know a bit javascript or c#
its just a matter of extracting a string from withing a bigger string...
Buhric
Global Moderator
 
Posts: 616
Joined: Thu Apr 15, 2010 2:49 pm

Re: XSL Support for templates   

Postby farms9000 » Thu Apr 21, 2011 6:45 am

Thanks for the confirmation. I think it's going to be my project for this weekend. (or is somebody here eager to do it ;) )

one question though. I think I can work out how to delete the episodenumbers because I can compare them with the numbers from the filename but how would you delete the correct episodenames?
I was thinking of counting the comma's but then you get a problem when a episode title contains a comma (thumgen also has problems with this).

Thanks
farms9000
n00b
 
Posts: 3
Joined: Wed Apr 20, 2011 8:15 am

Re: XSL Support for templates   

Postby Buhric » Fri Apr 22, 2011 5:40 pm

I would not delete them, just show the relevant one....
start by spliting the huge string containing that all the names into an array
and use the episode # as the array space to display.....

like all the TGMD file will contain all the names and episodes, but the sheet will only display the relevant ones....
Buhric
Global Moderator
 
Posts: 616
Joined: Thu Apr 15, 2010 2:49 pm

Re: XSL Support for templates   

Postby jhspyhard » Sat Apr 23, 2011 9:14 am

Hey guys...

I am implementing my moviesheet templates XSLT using embedded C# code. I want to use a C# MessageBox using the following code in order to help me debug my code:
Code: Select all
System.Windows.Forms.MessageBox.Show(path);

When Thumbgen runs the code, I receive the following popup error:
Code: Select all
"The type or namespace name 'Windows' does not exist in the namespace 'System' (are you missing an assembly reference?)"
I have been trolling forums trying to figure out how to get this to work inside of thumbgen. I found people who were using Visual Studios solved the issue by using "Add Reference" in the context menu -> Tab "Net" -> "System.Windows.Forms". However, I was unable to figure out how to do this manually inside of my XSLT file using my Notepad++ IDE . Can anyone point me to a website that can tell me how to do this, or give me a quick example on what I should do in order to be able to access whichever DLL that I need and how to import it?

Thanks!
Jim
-- Jim --

Check out my ThumbGen Template Blog.
Last Updated: 06/06/2011
JHSMovieSheets is currently at Version 0.9.3a

D-Link DIR-655 (Gigabit switch)
NetGear ReadyNAS Pioneer Pro 5.6 TB + Redundancy; (2x Gigabit NICs)
WD TV Live Plus (WDLXTV 0.4.3.1)
.M2TS (HD) / .MPG (SD)
User avatar
jhspyhard
Donor
 
Posts: 45
Joined: Sun Sep 05, 2010 5:13 am
Location: Fairfax, VA

Re: XSL Support for templates   

Postby Buhric » Sat Apr 23, 2011 11:05 am

hi jhspyhard

here's an other way to do what you are seeking... a bit more "complicated" but has the same results...
copy the following into your XSLT fiel

Code: Select all
   <xsl:template match="//Elements">
      <xsl:copy>
        <TextElementHidden Name="Debug">
          <xsl:attribute name="Text">
            <xsl:value-of select="string(CALL_YOUR_FUNCTION_FROM_HERE)"/>
          </xsl:attribute>
        </TextElementHidden>
         <xsl:apply-templates select="@*|node()"/>
      </xsl:copy>
   </xsl:template>

So now you just need to change the "CALL_YOUR_FUNCTION_FROM_HERE" to whatever the function you want to call.

Then user ThumbGen "QuickSheet" option, Select the template, the movie/folder and the .TGMD file
and click on preview.... then close the image
and open the "Rendered XML (debug)" TAB and look for a TextElement named Debug, it will contain your string...
Buhric
Global Moderator
 
Posts: 616
Joined: Thu Apr 15, 2010 2:49 pm

Re: XSL Support for templates   

Postby jhspyhard » Sat Apr 23, 2011 1:06 pm

Buhric wrote:here's an other way to do what you are seeking... a bit more "complicated" but has the same results...

Hey Buhric - thank you for your quick response. I gave this a try and while it isn't QUITE what I was trying to do, I made it work though. For what you were suggesting, the value of the parameters I wanted to view during runtime have to be returned by the function. I ended up short circuiting my function in a few places with an extra 'return' to get the values I needed inside of the Debug element. Thank you for your help there.

Do you know of any other ways that you can examine your C# method's internal parameters at runtime without having to return the value to your XSLT? This is a little different from the development I am used to, because I don't have (or don't know how to get to) an application console. Usually, I would put some sort of DEBUG output statement in my code to verify the values while the code is being executed, but not have to short circuit the method in order to get to those values.

Thanks again!
-- Jim --

Check out my ThumbGen Template Blog.
Last Updated: 06/06/2011
JHSMovieSheets is currently at Version 0.9.3a

D-Link DIR-655 (Gigabit switch)
NetGear ReadyNAS Pioneer Pro 5.6 TB + Redundancy; (2x Gigabit NICs)
WD TV Live Plus (WDLXTV 0.4.3.1)
.M2TS (HD) / .MPG (SD)
User avatar
jhspyhard
Donor
 
Posts: 45
Joined: Sun Sep 05, 2010 5:13 am
Location: Fairfax, VA

PreviousNext

Return to ThumbGen

Who is online

Users browsing this forum: No registered users and 0 guests