forked from kermitt2/pdfalto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalto2txt.xsl
35 lines (26 loc) · 1013 Bytes
/
alto2txt.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:alto="http://www.loc.gov/standards/alto/ns-v3#">
<xsl:output encoding="UTF-8" method="text" omit-xml-declaration="yes" indent="no"/>
<xsl:template match="alto:SP">
<xsl:text> </xsl:text>
</xsl:template>
<xsl:template match="alto:TextLine">
<xsl:text>
</xsl:text>
<xsl:apply-templates />
</xsl:template>
<xsl:template match="alto:TextBlock">
<xsl:text>
</xsl:text>
<xsl:apply-templates />
</xsl:template>
<xsl:template match="alto:Page">
<xsl:text>
</xsl:text>
<xsl:apply-templates />
</xsl:template>
<xsl:template match="alto:String">
<xsl:value-of disable-output-escaping="yes" select="@CONTENT"/>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:apply-templates select="@*|node()" />
</xsl:template>
</xsl:stylesheet>