Skip to content

pagexml

Dr. Christian Lück edited this page Apr 26, 2024 · 6 revisions

PageXML

Transformations for converting PageXML to TEI are located in the xsl/pagexml folder.

Usage

See comment in the xsl/pagexml/pagecontent2tei.xsl file!

Deriving

If you want to have your own PageXML to TEI transformation on top of xsl/pagexml/pagecontent2tei.xsl, then xsl:use-package is what you need.

E.g., you want to implement your own logic to provide project-specific meta data, then override the template named p2t:tei-header like so:

<!-- Convert PageXML to TEI, adapted to the HSDE project

USAGE:
see usage notes of package named https://scdh.zivgitlabpages.uni-muenster.de/tei-processing/x2tei-transformations/xsl/pagexml/pagecontent2tei.xsl

-->
<xsl:package
  name="https://scdh.zivgitlabpages.uni-muenster.de/strobach-hsde/hsde-transformations/xsl/pagexml/pagexml2tei.xsl"
  package-version="1.0.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.tei-c.org/ns/1.0"
  xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns:p2t="http://scdh.wwu.de/transform/pagexml2tei#"
  xmlns:pc="http://schema.primaresearch.org/PAGE/gts/pagecontent/2013-07-15"
  xpath-default-namespace="http://schema.primaresearch.org/PAGE/gts/pagecontent/2013-07-15"
  exclude-result-prefixes="#all" version="3.0" default-mode="p2t:source">

  <!-- use (import) the pagecontent2tei.xsl package from x 2 TEI Transformations -->
  <xsl:use-package
    name="https://scdh.zivgitlabpages.uni-muenster.de/tei-processing/x2tei-transformations/xsl/pagexml/pagecontent2tei.xsl"
    package-version="1.0.0">

    <!-- accept components from the used package-->
    <xsl:accept component="mode" names="p2t:source" visibility="final"/>
    <xsl:accept component="template" names="p2t:*" visibility="final"/>

    <!-- override components from the used package -->
    <xsl:override>

      <!-- Override the named template for the header.
        This must have exactly the same signature (parameters) as the overriden component -->
      <xsl:template name="p2t:tei-header">
        <xsl:param name="pages" as="node()*"/>

        <!-- WHATEVER you need TO DO in the HEADER -->

      </xsl:template>

    </xsl:override>
  </xsl:use-package>


  <!-- new components defined in this package (vs. components
    overriding components from used packages) must be
    direct child of xsl:package, but not of xsl:use-package -->


</xsl:package>

See also

Clone this wiki locally