0

I am currently working on a digital edition of a certain work. I have every double-page (so f28v and f29r inside on document)

   <xsl:template match="tei:pb">
    <xsl:element name="div">
    <xsl:attribute name="class">
        <xsl:text>test;</xsl:text>
    </xsl:attribute>
        <xsl:element name="div">
            <xsl:attribute name="style">
                <xsl:text>text-align:right;</xsl:text>
            </xsl:attribute>
            <xsl:text>[Bl.</xsl:text>
            <xsl:value-of select="@n"/>
            <xsl:text>]</xsl:text>
        </xsl:element>
    </xsl:element>

I want the class "test" to be the container for the following page that is indicated by the <pb/>. My current xslt adds the class "test" only to the div created from the <pb/>

The class "test" will either be replaced by bootstrap's or semanticUI's version of the grid, which will then be formatted using CSS to look pretty.

(I come from Javascript/Web-developing with Javascrippt and nodeJS, so XSLT is fairly new to me)

Martin Honnen
  • 160,499
  • 6
  • 90
  • 110
  • In what? The browser or in print? And by pages please define... do you mean the exact page of one next to the other so what is a page? – Kevin Brown Sep 26 '19 at 05:02
  • I have an xml-file for each double page of the book I am editing. (like 28v above 29r., as mentioned before) roughly like the pastebin (https://pastebin.com/tT5zxiCJ) so I want the first pb to indicate "create a div with class 'test' inside of which you nest the divs for each page. For now it is about XML-To-HTML. Not trolling: How does a page need defining? It is the thing inside a book with letters on it, add two or more and you get pages, the plural. they either are counted as pages (page numbers) or folio-wise (f28v, f29r.) v=the backpart, while r=front matter of a page –  Sep 26 '19 at 07:05
  • A page in pdf is defined... not clear what that is in html unless you are defining it as there is no page element and therefore is arbitrary. – Kevin Brown Sep 26 '19 at 15:38
  • So in a group (bootstrap row) you would have two page blocks (bootstrap div *-col) each one like 8 and 8 units or maybe three with some gutter between. – Kevin Brown Sep 26 '19 at 15:52
  • page-issue : oh, I see, I was strictly speaking about book-pages that should be transformed to and subsequently be displayed "page like" .... second comment: yeah! I think I need to nest my XSLT a little differently, but not sure HOW :-D probably just put the between the two –  Sep 26 '19 at 16:50
  • Well without seeing the whole content it s hard. Certainly your codepen does not match your XSL above which would say there is a attribute named "n" on the tei:pb element. Maybe post more of your XMl and XSL you have tried. If you only have a bunch of elements and they are always in two's, you can always use selection criteria like "{something} mod 2" but we have no idea. help us help you. Show use the real XML and XSL you have tried/ – Kevin Brown Sep 27 '19 at 00:00
  • alright :-) sorry it took so long. I have composed an example file from one of the problematic files... I am a little weary about sharing, yet, as it is very WIP-like :-D . Furthermore you find the "official" xslt-file that I am using so far :-) example: https://pastebin.com/CMa1zGBs xslt: https://pastebin.com/LW5LxdWG I hope you can shed some light on my troubles (or anyone else for that matter :-D) –  Sep 27 '19 at 12:02

0 Answers0