Skip to content

Commit

Permalink
work on shawi_trial and add declaration in Urfa-011, -012 and -027
Browse files Browse the repository at this point in the history
  • Loading branch information
VeronikaEngler committed Jul 5, 2024
1 parent cf8f983 commit 0b6cd49
Show file tree
Hide file tree
Showing 9 changed files with 3,907 additions and 23 deletions.
1 change: 1 addition & 0 deletions 010_manannot/Urfa-011_Cemetry-Harran-2010.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../082_scripts_xsl/tei_2_html__shawi.xsl"?>
<?xslt inPathSegment="\010_manannot\" outPathSegment="\106_html\"?>
<?processor name="saxon" removePreserveFromXML="true" removePreserveFromXSLT="true"?>
Expand Down
1 change: 1 addition & 0 deletions 010_manannot/Urfa-012_Lentils-Harran-2010.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../082_scripts_xsl/tei_2_html__shawi.xsl"?>
<?xslt inPathSegment="\010_manannot\" outPathSegment="\106_html\"?>
<?processor name="saxon" removePreserveFromXML="true" removePreserveFromXSLT="true"?>
Expand Down
1 change: 1 addition & 0 deletions 010_manannot/Urfa-027_Cultivation-Harran-2010.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../082_scripts_xsl/tei_2_html__shawi.xsl"?>
<?xslt inPathSegment="\010_manannot\" outPathSegment="\106_html\"?>
<?processor name="saxon" removePreserveFromXML="true" removePreserveFromXSLT="true"?>
Expand Down
1,549 changes: 1,549 additions & 0 deletions 010_manannot/backup/Urfa-011_Cemetry-Harran-2010__2024_07_05_12_00_18.xml

Large diffs are not rendered by default.

1,313 changes: 1,313 additions & 0 deletions 010_manannot/backup/Urfa-012_Lentils-Harran-2010__2024_07_05_12_00_34.xml

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<xsl:stylesheet xml:space="preserve"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:tei="http://www.tei-c.org/ns/1.0"
version="2.0"
exclude-result-prefixes="xsl tei">
<xsl:output method="html" indent="no" encoding="UTF-8"/>
<xsl:strip-space elements="tei:body tei:TEI tei:row tei:cell tei:teiHeader tei:text tei:u tei:hi tei:ref tei:p tei:fileDesc tei:titleStmt tei:publicationStmt tei:editionStmt tei:revisionDesc tei:sourceDesc tei:div"/>

<!-- Variable to hold the title -->
<xsl:variable name="title" select="//tei:titleStmt/tei:title"/>

<!-- Variable to count all 'ana' attributes in the document -->
<xsl:variable name="anaCount" select="count(//tei:*[@ana])"/>
<xsl:variable name="wCount" select="count(//tei:w)"/>

<!-- Template to apply at the root level -->
<xsl:template match="/">
<html>
<head>
<title>
<xsl:value-of select="$title"/>
</title>
<!-- Embed CSS styles directly in the head section -->
<style type="text/css">
p {
color: blue; /* Sets the text color to blue */
background-color: green; /* Sets the background color to green */
padding: 10px; /* Adds space around the text */
margin: 10px 0; /* Adds space above and below the paragraph */
}
</style>
</head>
<body>
<h1><xsl:value-of select="$title"/></h1>
<p>Total 'ana' attributes found: <xsl:value-of select="$anaCount"/></p>
<p>Total 'w' elements found: <xsl:value-of select="$wCount"/></p>
<!-- Processing the body of the TEI document -->
<xsl:apply-templates select="tei:text/tei:body"/>
</body>
</html>
</xsl:template>

<!-- Identity template for basic copying of content -->
<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*"/>
</xsl:copy>
</xsl:template>

<!-- Specific template for paragraphs -->
<xsl:template match="tei:p">
<p>
<xsl:apply-templates/>
</p>
</xsl:template>

</xsl:stylesheet>
68 changes: 55 additions & 13 deletions 082_scripts_xsl/tei_2_html__shawi_trial.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,18 @@
<xsl:output method="html" indent="no" encoding="UTF-8"/>
<xsl:strip-space elements="tei:body tei:TEI tei:row tei:cell tei:teiHeader tei:text tei:u tei:hi tei:ref tei:p tei:fileDesc tei:titleStmt tei:publicationStmt tei:editionStmt tei:revisionDesc tei:sourceDesc tei:div"/>

<!-- Parameter for external document path -->
<xsl:param name="pathToExternalDoc">../010_manannot/shawi_standoff.xml</xsl:param>
<!-- Load the external XML document using the parameter -->
<xsl:variable name="externalDoc" select="doc('../010_manannot/shawi_standoff.xml')" as="document-node()"/>

<!-- Key to access elements by ID quickly within the external document -->
<xsl:key name="element-by-id" match="*[@id]" use="@id"/>

<!-- Variable to hold the title -->
<xsl:variable name="title" select="//tei:titleStmt/tei:title"/>

<!-- Variable to count all 'ana' attributes in the document -->
<!-- Variable to count all 'ana' attributes in the document -->
<xsl:variable name="anaCount" select="count(//tei:*[@ana])"/>
<xsl:variable name="wCount" select="count(//tei:w)"/>

Expand All @@ -21,25 +29,60 @@
<title>
<xsl:value-of select="$title"/>
</title>
<!-- Embed CSS styles directly in the head section -->
<style type="text/css">
p {
color: blue; /* Sets the text color to blue */
background-color: green; /* Sets the background color to green */
padding: 10px; /* Adds space around the text */
margin: 10px 0; /* Adds space above and below the paragraph */
}
</style>
.countResult {
color: blue;
background-color: green;
padding: 10px;
margin: 10px 0;
}
.missing {
color: red;
}
</style>

</head>
<body>


<h1><xsl:value-of select="$title"/></h1>
<p>Total 'ana' attributes found: <xsl:value-of select="$anaCount"/></p>
<p>Total 'w' elements found: <xsl:value-of select="$wCount"/></p>

<p class="countResult">Total 'ana' attributes found: <xsl:value-of select="$anaCount"/></p>
<p class="countResult">Total 'w' elements found: <xsl:value-of select="$wCount"/></p>

<!-- Example of using external document content -->
<p>Content from external document: <xsl:value-of select="$externalDoc//someElement"/></p>
<!-- Processing the body of the TEI document -->
<xsl:apply-templates select="tei:text/tei:body"/>
</body>
</html>
</xsl:template>

<xsl:template match="/tei:TEI">
<html>
<head>
<title>
<xsl:value-of select="$title"/>
</title>
</head>
<body>

<xsl:apply-templates select=".//tei:body"/>
</body>
</html>
</xsl:template>

<xsl:template match="tei:w[@ana]">
<span>
<xsl:attribute name="class">
<!-- Prüft, ob das externe Dokument ein Element mit der ID hat, die in @ana ohne das vorangestellte # angegeben ist -->
<xsl:if test="not($externalDoc//*[@id = substring(current()/@ana, 2)])">missing</xsl:if>
</xsl:attribute>
<xsl:value-of select="."/>
</span>
</xsl:template>



<!-- Identity template for basic copying of content -->
<xsl:template match="node() | @*">
Expand All @@ -54,5 +97,4 @@
<xsl:apply-templates/>
</p>
</xsl:template>

</xsl:stylesheet>
29 changes: 19 additions & 10 deletions 106_html/Urfa-011_Cemetry-Harran-2010.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,29 @@
<title>
URFA-011 SHAWI Corpus
</title>

<style type="text/css">
p {
color: blue; /* Sets the text color to blue */
background-color: green; /* Sets the background color to green */
padding: 10px; /* Adds space around the text */
margin: 10px 0; /* Adds space above and below the paragraph */
}
</style>
.countResult {
color: blue;
background-color: green;
padding: 10px;
margin: 10px 0;
}
.missing {
color: red;
}
</style>

</head>
<body>


<h1>URFA-011 SHAWI Corpus</h1>
<p>Total 'ana' attributes found: 979</p>
<p>Total 'w' elements found: 979</p>

<p class="countResult">Total 'ana' attributes found: 979</p>
<p class="countResult">Total 'w' elements found: 979</p>


<p>Content from external document: </p>


</body>
Expand Down

0 comments on commit 0b6cd49

Please sign in to comment.