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 » Sun Apr 24, 2011 5:16 pm

I beleive that in order for it to work the way you want,
It needs to be supported by Thumbgen....
Buhric
Global Moderator
 
Posts: 616
Joined: Thu Apr 15, 2010 2:49 pm

Re: XSL Support for templates   

Postby thumbgen » Mon Apr 25, 2011 1:04 am

Use some third-party XML/XSL debugger to do that (Altova XMLSpy, Editix, etc). Do the "programming" of the scripts there and then use them inside TG.
Get ThumbGen!
If you like ThumbGen then buy me a coffee Image
User avatar
thumbgen
Developer
 
Posts: 1094
Joined: Mon Apr 05, 2010 10:04 pm

Re: XSL Support for templates   

Postby jhspyhard » Mon May 02, 2011 12:47 pm

I found out how to do what I was originally looking to do, and wanted to post it here so others can use it if they so choose. This allows you to import an assembly not available in the Thumbgen runtime by default, into your XSLT/C# program and then pop-up a box containing whatever string you want to display by calling the debugOutput() method.

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!--
JHS Common Sheet Scripts [Full Screen (1280x720)]
Dynamic XLST component
Created by: JHSpyHard
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:msxsl="urn:schemas-microsoft-com:xslt"
   xmlns:myjs="urn:custom-javascript"
   exclude-result-prefixes="msxsl myjs">
   
   <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
   <msxsl:script implements-prefix="myjs" language="CSharp">
   
   <!-- Other Assembly Imports -->
   <msxsl:assembly name="System.Windows.Forms" />
   <msxsl:assembly name="mscorlib" />
   
   <![CDATA[

   /**
   * debugOutput() pops up a MessageBox during runtime/compilation time, displaying the string
   * that is passed in as a parameter. The method name from which debugOuput() was called is
   * displayed as the title of the pop-up which is appended with the code line number from where debugOutput
   * was called.
   * @param output - The string to be printed to the screen.
   */
   public void debugOutput(string output)
   {
      // Get Diagnostic Objects
      System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame(1,true);
      
      // Get Calling Method Name
      string methodName = stackFrame.GetMethod().Name;

      // Get debugOutput's Calling Line Number.
      string lineNumber = stackFrame.GetFileLineNumber().ToString();

      // Attach Line numbers to the end of the method name and return the output.
      System.Windows.Forms.MessageBox.Show(output,methodName+"(): ln "+lineNumber);
   }
   
   ]]>
   </msxsl:script>
</xsl:stylesheet>
-- Jim --

Check out my ThumbGen Template Blog.
Last Updated: 01/01/2017
JHSMovieSheets is currently at Version 0.9.5.1

D-Link DIR-655 (Gigabit switch)
NetGear ReadyNAS Pioneer Pro 13 TB + Redundancy; (2x Gigabit NICs)
WD TV Live Plus (WDLXTV 0.4.7.3)
.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 ozzii » Sun Jul 17, 2011 2:18 am

Hi,
Can someone help me with this:
http://thumbgen.lighthouseapp.com/projects/57477-thumbgen/tickets/180

I think TG doesn't have so much time right now :oops:

Please a little help from the community.
ozzii
DLX'er
 
Posts: 143
Joined: Mon Apr 26, 2010 5:09 am

Re: XSL Support for templates   

Postby ozzii » Sun Aug 14, 2011 1:32 am

a little up for the community :oops:
ozzii
DLX'er
 
Posts: 143
Joined: Mon Apr 26, 2010 5:09 am

Re: XSL Support for templates   

Postby Buhric » Sun Aug 14, 2011 7:06 am

HI ozzi,

I took a look at your template... and I can not reproduce the error you mention.
take a.MKV with a sub
add an external sub (.srt)
With this the small "SUB" rectangle on the bottom right should not appear...
and if you remove the external sub, the "SUB" rectangle shows up....


Well I can say that in my case the "SUB" would always show up if the movie add an internal sub
no matter if there was an external or not...

If I selected a movie that had no Internal sub, the the "SUB" would only show up if a external sub was added
Buhric
Global Moderator
 
Posts: 616
Joined: Thu Apr 15, 2010 2:49 pm

Re: XSL Support for templates   

Postby ozzii » Sun Aug 14, 2011 7:50 am

Hi, Buhric

Here is what I have:

Image
Image

You can see that I have 2 internal sub in the mkv but doesn't have the sub rectangle.
If I had an external srt, same...
If I had an external idx/sub; same... no rectangle.
ozzii
DLX'er
 
Posts: 143
Joined: Mon Apr 26, 2010 5:09 am

Re: XSL Support for templates   

Postby ozzii » Sun Aug 14, 2011 7:56 am

Redone some more test.
A movie with one embedded subtitle show me the rectangle.
If I had an external sub to the same movie, the rectangle is gone.
If I had a movie without internal sub and an external one, it's ok, the rectangle is showed.
ozzii
DLX'er
 
Posts: 143
Joined: Mon Apr 26, 2010 5:09 am

Re: XSL Support for templates   

Postby Buhric » Sun Aug 14, 2011 2:47 pm

I think I might have found your problem.....

I used a .MKV that as 4 internal subs, and I got the same issue, the "SUB" did not show up

I too a closer look at your .XSLT
I notice that you use
Code: Select all
string[] _values = input.Split('/');
to split the %ALLSUBTITLES% token
but if you look at the token, values are separated with comas "," and not slashes "/"

If you change you code to
Code: Select all
string[] _values = input.Split(',');
it should work.
It did for me..
Buhric
Global Moderator
 
Posts: 616
Joined: Thu Apr 15, 2010 2:49 pm

Re: XSL Support for templates   

Postby ozzii » Sun Aug 14, 2011 10:15 pm

I will check this ASAP and keep you informed...
Thanks for your trying...
ozzii
DLX'er
 
Posts: 143
Joined: Mon Apr 26, 2010 5:09 am

PreviousNext

Return to ThumbGen

Who is online

Users browsing this forum: No registered users and 2 guests