Methods

XML Documentation

With the help of Dr. B, we used regular expressions in search + replace operations over the XML Casablanca script to establish the main structure of our XML. In order to complete this as efficiently as possible, we splitting the xml into three portions by number of scenes for each member to finish documenting. Once split, we individually used search + replace to add in "who=" attributes within the speaker elements. We had to manually move and tag instances of physical acting cues (dir elements) and tag emotional acting dues(descr elements).

Note: There were some inconsistencies between the files that we had to quality check and adjust. For example, there were instances of montages within the middle section of the script that didn't exist in the other files.

            <body>
    <scene n="0">
        <camera>FADE IN: LONG SHOT — REVOLVING GLOBE</camera>
        <setting> A revolving globe. When it stops revolving it turns briefly into a contour map
            of Europe, then into a flat map. Superimposed over this map are scenes of refugees
            fleeing from all sections of Europe by foot, wagon, auto, and boat, and all
            converging upon one point on the tip of Africa -- Casablanca. Arrows on the map
            illustrate the routes taken as the voice of a NARRATOR describes the
            migration.</setting>
        
        <sp>
            <speaker who="narr">NARRATOR</speaker>
            <diag>With the coming of the Second World War, many eyes in imprisoned Europe turned
                hopefully, or desperately, toward the freedom of the Americas. Lisbon became the
                great embarkation point. But not everybody could get to Lisbon directly, and so,
                a tortuous, roundabout refugee trail sprang up. Paris to Marseilles, across the
                Mediterranean to Oran, then by train, or auto, or foot, across the rim of Africa
                to Casablanca in French Morocco. Here, the fortunate ones, through money, or
                influence, or luck, might obtain exit visas and scurry to Lisbon, and from
                Lisbon to the New World. But the others wait in Casablanca -- and wait -- and
                wait -- and wait. The narrator's voice fade away...</diag>
        </sp>
    </scene>
        

Metadata

After we finished documenting the script, we added in the metadata and included a section for the movie metadata, and one for the script metadata. For both sections we included various aspects, such as the different people and locations involved for the movie metadata, and the script scenes and publishers for the script metadata.

            <metadata>
    <movie>
        <title>Casablanca</title>
        <director>Michael Curtiz</director>
        <wrldPrem>Nov. 26 1942</wrldPrem>
        <loc>WB studios, Burbank, CA</loc>
        <loc>Van Nuys Airport, LA</loc>
        <producer>Hal B. Wallis</producer>
        <producer>Warner Bros</producer>
        <writer>Howard Koch</writer>
        <writer>Julius J. Epstein</writer>
        <writer>Philip G. Epstein</writer>
        <basedOn>Everybody Comes to Rick’s (stage play); written by Murray Burnett and Joan
            Alison</basedOn>
        <composer>Max Steiner</composer>
        <starring>Humphrey Bogart</starring>
        <starring>Ingrid Bergman</starring>
        <starring>Paul Henreid</starring>
        <starring>Conrad Veidt</starring>
        <starring>Claude Rains</starring>
        <cinematography>Arthur Edeson</cinematography>
        <editor>Owen Marks</editor>
    </movie>
    <script>
        <numScenes>77</numScenes>
        <url>https://app.studiobinder.com/company/580e85847e7982164664e844/collab/5eac35a683f7a90bfc3fc810/projects/5de590454f452c09a98e975b/document/5de5904f1fe52b06c2f4bd79/%5Bobject%20Object%5D?utm_source=blog&utm_medium=sb-app-link&utm_campaign=script&utm_term=casablanca-script-breakdown&utm_content=full-script-pdf-download</url>
        <generatedBy>Brent Dunham</generatedBy>
        <date>Dec. 2</date>
        <publisher>StudioBinder Inc.</publisher>
        <website> https://www.studiobinder.com/</website>
    </script>
</metadata>
        
        

Schema

Our next step was constructing the schema and associating it each xml files. We had to validate it across each file, and adjust some files further accordingly. Our schema is located on a different page. You can locate the image here.

XSLT

Using our XML documentation, we plucked specific data and tags to create and display tables of information. Our XSLT file accomplishes this by using the @mode attribute set to toc for table of contents and then outputting to an empty html file. The functioning tables can be found in the reading view page linked here.

            <?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:math="http://www.w3.org/2005/xpath-functions/math" xmlns="http://www.w3.org/1999/xhtml"
    exclude-result-prefixes="xs math" version="3.0">

    <xsl:output method="xhtml" html-version="5" omit-xml-declaration="yes" include-content-type="no"
        indent="yes"/>


    <xsl:variable name="casaColl" as="document-node()+" select="collection('xml/?select=*.xml')"/>


    <xsl:variable name="speakers" as="xs:string+"
        select="$casaColl//speaker/@who ! normalize-space() ! upper-case(.) => distinct-values() => sort()"/>


    <xsl:template match="/">
        <html>
            <head>
                <title>
                    <xsl:apply-templates select="descendant::title"/>
                </title>
                <link rel="stylesheet" type="text/css" href="style.css"/>
            </head>



            <body class="xslBod">
                <!-- NAV BAR-->
                <div class="navBar">
                    <a href="index.html" class="btnFade">Home</a>
                    <a href="script.html" class="btnFade">Script PDF</a>
                    <a href="schema.html" class="btnFade">Schema</a>
                    <a href="methods.html" class="btnFade">Methods</a>
                    <a href="output.html" class="btnFade">Reading View</a>
                    <a href="versions.html" class="btnFade">Endings</a>
                    <a href="https://github.com/jvs7215/Casablanca-Project" class="btnFade">Github</a>
                </div>

                <h1>
                    <xsl:apply-templates select="descendant::title"/>
                </h1>
                
                
                
                
                <!-- Here is a Table of Contents Overview -->
                <table>
                    <tr>
                        <th>Character Codes</th>
                        <th>Character Names</th>
                        <th>Count of Appearances</th>
                        <th>First scene in which they speak</th>
                    </tr>

                    <xsl:for-each select="$speakers">
                        <xsl:variable name="currentSpeaker" as="element()+"
                            select="$casaColl//speaker[@who ! normalize-space() ! upper-case(.) = current()]"/>

                        <tr>
                            <td>
                                <xsl:value-of select="current()"/>
                            </td>


                            <td>

                                <xsl:value-of
                                    select="$currentSpeaker ! normalize-space() => distinct-values()"
                                />
                            </td>
                            <td>
                                <xsl:value-of select="$currentSpeaker => count()"/>
                            </td>
                            <td>
                                <!-- The first scene in which that character speaks -->
                                <xsl:variable name="firstSceneNumber" as="xs:double" select="
                                        ($casaColl//scene[descendant::speaker/@who !
                                        normalize-space() ! upper-case(.) = current()]/@n ! number(.)) => min()"/>

                                <a href="#scene-{$firstSceneNumber}">

                                    <xsl:text>Scene </xsl:text>
                                    <xsl:value-of select="$firstSceneNumber"/>
                                </a>


                            </td>
                        </tr>
                    </xsl:for-each>

                </table>
                
                <table>
                    <tr>
                        <td><h2>Locations</h2></td>
                        <td><h2>Number of Appearances</h2></td>
                        <td><h2>First Scene Appearance</h2></td>
                    </tr>
                    <tr>
                        <td>Rick's Café</td>
                        <td>39</td>
                        <td>Scene 12</td>
                    </tr>
                    <tr>
                        <td>Police Station</td>
                        <td>1</td>
                        <td>Scene 2</td>
                    </tr>
                    <tr>
                        <td>Old Moorish Section of the City</td>
                        <td>1</td>
                        <td>Scene 1</td>
                    </tr>
                    <tr>
                        <td>A Street in the Old Moorish Section</td>
                        <td>1</td>
                        <td>Scene 3</td>
                    </tr>
                    <tr>
                        <td>Palais De Justice</td>
                        <td>3</td>
                        <td>Scene 4</td>
                    </tr>
                    <tr>
                        <td>Sidewalk Café</td>
                        <td>1</td>
                        <td>Scene 5</td>
                    </tr>
                    <tr>
                        <td>Airfield</td>
                        <td>1</td>
                        <td>Scene 11</td>
                    </tr>
                    <tr>
                        <td>Rick's Paris Apartment</td>
                        <td>1</td>
                        <td>Scene 25</td>
                    </tr>
                    <tr>
                        <td>Paris Café</td>
                        <td>3</td>
                        <td>Scene 26</td>
                    </tr>
                    <tr>
                        <td>Ilsa's Paris Apartment</td>
                        <td>1</td>
                        <td>Scene 27</td>
                    </tr>
                    <tr>
                        <td>La Belle Aurore</td>
                        <td>1</td>
                        <td>Scene 30</td>
                    </tr>
                    <tr>
                        <td>Gare De Lyon</td>
                        <td>1</td>
                        <td>Scene 31</td>
                    </tr>
                    <tr>
                        <td>Renault's Office</td>
                        <td>4</td>
                        <td>Scene 35</td>
                    </tr>
                    <tr>
                        <td>Prefecture Lobby</td>
                        <td>1</td>
                        <td>Scene 36</td>
                    </tr>
                    <tr>
                        <td>The Blue Parrot</td>
                        <td>5</td>
                        <td>Scene 39</td>
                    </tr>
                    <tr>
                        <td>Black Market</td>
                        <td>3</td>
                        <td>Scene 38</td>
                    </tr>
                    <tr>
                        <td>Hotel Hallway</td>
                        <td>1</td>
                        <td>Scene 54</td>
                    </tr>
                    <tr>
                        <td>Hotel Room</td>
                        <td>1</td>
                        <td>Scene 55</td>
                    </tr>
                    <tr>
                        <td>German Consulate</td>
                        <td>1</td>
                        <td>Scene 73</td>
                    </tr>
                    <tr>
                        <td>Airport</td>
                        <td>4</td>
                        <td>Scene 74</td>
                    </tr>
                    <tr>
                        <td>Airport Hangar</td>
                        <td>2</td>
                        <td>Scene 75</td>
                    </tr>
                </table>

                <!-- BELOW is the Reading View processing -->
                
                
                <section class="reading">
                    <xsl:apply-templates select="$casaColl//scene"/>
                </section>

            </body>
            <div class="footer">
                <!--creative commons license-->
                <p xmlns:cc="http://creativecommons.org/ns#" xmlns:dct="http://purl.org/dc/terms/"
                        ><a property="dct:title" rel="cc:attributionURL"
                        href="https://jvs7215.github.io/Casablanca-Project/">Casablanca Project</a>
                    by <span property="cc:attributionName"><a href="https://github.com/jvs7215"
                            target="_blank" rel="noopener noreferrer">Jessica Salemme</a>, <a
                            href="https://github.com/sjm7342" target="_blank"
                            rel="noopener noreferrer">Sean Martin</a>, <a
                            href="https://github.com/Cal16king" target="_blank"
                            rel="noopener noreferrer">Caleb King</a></span> is licensed under <a
                        href="https://creativecommons.org/licenses/by-nc/4.0/?ref=chooser-v1"
                        target="_blank" rel="license noopener noreferrer"
                        style="display:inline-block;">CC BY-NC 4.0<img
                            style="height:22px!important;margin-left:3px;vertical-align:text-bottom;"
                            src="https://mirrors.creativecommons.org/presskit/icons/cc.svg?ref=chooser-v1"
                            alt=""/><img
                            style="height:22px!important;margin-left:3px;vertical-align:text-bottom;"
                            src="https://mirrors.creativecommons.org/presskit/icons/by.svg?ref=chooser-v1"
                            alt=""/><img
                            style="height:22px!important;margin-left:3px;vertical-align:text-bottom;"
                            src="https://mirrors.creativecommons.org/presskit/icons/nc.svg?ref=chooser-v1"
                            alt=""/></a></p>
            </div>
        </html>
    </xsl:template>


    <!-- BELOW HERE are the Reading View templates -->
    <xsl:template match="scene">
        <section id="scene-{@n}" class="scene sceneMargin">
            <xsl:apply-templates/>
        </section>
    </xsl:template>
    
    <xsl:template match="camera">
        <div class="camera">
            <xsl:apply-templates/>
        </div>
    </xsl:template>

    <xsl:template match="setting">
        <div class="setting">
            <xsl:apply-templates/>
        </div>
    </xsl:template>
    <xsl:template match="sp">
        <xsl:apply-templates/>
    </xsl:template>
    <xsl:template match="speaker">
        <span class="speaker {@who}">
            <xsl:apply-templates/>
        </span>
    </xsl:template>

    <xsl:template match="diag">
        <span class="diag">
            <xsl:apply-templates/>
        </span>
    </xsl:template>

    <!-- ebb: added one more for directions / descriptions -->
    <xsl:template match="sp/descr | dir">
        <span class="dir">
            <xsl:apply-templates/>
        </span>
    </xsl:template>


</xsl:stylesheet>

        

HTML

As you can see form our website, our use of html helped us create and launch a website with the help of Github Pages. Each site page was fabricated and stylized by our project team to recreate a similar thematic to our script. We hope you enjoy looking around!