Welcome to the Invelos forums. Please read the forum rules before posting.

Read access to our public forums is open to everyone. To post messages, a free registration is required.

If you have an Invelos account, sign in to post.

    Invelos Forums->DVD Profiler: Desktop Technical Support Page: 1  Previous   Next
How to find all cast and crew with BY assigned
Author Message
DVD Profiler Unlimited Registrantgoodguy
Sita Sings the Blues
Registered: March 14, 2007
Reputation: Superior Rating
Germany Posts: 1,029
Posted:
PM this userDirect link to this postReply with quote
Based on a question asked by richierich in this thread, I created the following little XSLT script that transforms an exported XML collection file into an HTML report of all cast/crew with BY assigned.

  • Save the code below as HasBY.xslt.

  • Export your collection into an XML file.

  • Open the XML file with a text editor and insert a <xml-stylesheet> tag referring HasBY.xslt right before the <Collection> root tag.

  • Open the modified collection file with IE.


  • Please note that this is just a quick-shot. There is no fancy, formatting, no elimination of duplicates, just some dull result tables. If someone wants to refine it, feel free to do so.

    File HasBY.xslt:
    Quote:

    <?xml version="1.0" encoding="UTF-8"?>
    <!--
      Copyright (c) 2007 Matthias Wolf, Germany AKA goodguy
      http://www.geocities.com/goodguy_dvdpro/
    -->

    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      >

    <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>

    <xsl:template match="/">
      <html>
        <head>
          <title>Cast and Crew with BY</title>
        </head>
        <body>
          <h1>Cast and Crew with BY</h1>
          <h3>Cast</h3>
          <table border="1">
            <tr>
              <th>ID</th><th>Title</th><th>FirstName</th><th>MiddleName</th><th>LastName</th><th>BY</th>
            </tr>
            <xsl:apply-templates select="/Collection/DVD/Actors/Actor[@BirthYear != 0]">
              <xsl:sort select="@LastName"></xsl:sort>
              <xsl:sort select="@BirthYear"></xsl:sort>
              <xsl:sort select="@FirstName"></xsl:sort>
              <xsl:sort select="@MiddleName"></xsl:sort>
              <xsl:sort select="../../Title"></xsl:sort>
            </xsl:apply-templates>
          </table>
          <h3>Crew</h3>
          <table border="1">
            <tr>
              <th>ID</th><th>Title</th><th>FirstName</th><th>MiddleName</th><th>LastName</th><th>BY</th>
            </tr>
            <xsl:apply-templates select="/Collection/DVD/Credits/Credit[@BirthYear != 0]">
              <xsl:sort select="@LastName"></xsl:sort>
              <xsl:sort select="@BirthYear"></xsl:sort>
              <xsl:sort select="@FirstName"></xsl:sort>
              <xsl:sort select="@MiddleName"></xsl:sort>
              <xsl:sort select="../../Title"></xsl:sort>
            </xsl:apply-templates>
          </table>
        </body>
      </html>
    </xsl:template>

    <xsl:template match="Actors/Actor[@BirthYear != 0] | Credits/Credit[@BirthYear != 0]">
      <tr>
        <td><xsl:value-of select="../../ID"/></td>
        <td><xsl:value-of select="../../Title"/></td>
        <td><xsl:value-of select="@FirstName"/></td>
        <td><xsl:value-of select="@MiddleName"/></td>
        <td><xsl:value-of select="@LastName"/></td>
        <td><xsl:value-of select="@BirthYear"/></td>
      </tr>
    </xsl:template>

    </xsl:stylesheet>


    Insert this line into the exported XML collection file, right before the <Collection> tag. Replace the sample path with your real file path:
    Quote:

    <?xml-stylesheet type="text/xsl" href="C:\Sample\HasBY.xslt"?>
    Matthias
     Last edited: by goodguy
    DVD Profiler Desktop and Mobile Registrantpauls42
    Reg: 31/01/2003
    Registered: March 13, 2007
    United Kingdom Posts: 2,692
    Posted:
    PM this userEmail this userVisit this user's homepageView this user's DVD collectionDirect link to this postReply with quote
    thanks for this. Should be very useful
    Paul
    DVD Profiler Unlimited RegistrantStar Contributorhayley taylor
    Past Contributor
    Registered: March 14, 2007
    Reputation: High Rating
    United Kingdom Posts: 1,022
    Posted:
    PM this userVisit this user's homepageDirect link to this postReply with quote
    thanks Matt, will be very useful 
        Invelos Forums->DVD Profiler: Desktop Technical Support Page: 1  Previous   Next