This XSLT converts an ALTO xml document to an annotation lists for use with a IIIF manifests. To link to an annotation list from a manifest add the following in the related canvas:
"otherContent": [
{
"@id": "http://dams.llgc.org.uk/iiif/2066058/annotation/list.json",
"@type": "sc:AnnotationList"
}
]
Note this XSLT produces word level annotations. If you prefer line level annotations see the comment in the XSLT.
The required parameters are:
1
.You can also optionally supply:
within
field to all of the annotations pointing to the manifest. This is useful as the canvas URI isn’t necessarily resolvable so being able to get the manifest that contains the canvas allows users of the annotation to display the image as well as the annotation. If the viewer is starting from the Manifest (e.g. with Mirador) this within isn’t used.To run this from the command line you can run:
xsltproc --stringparam annoURI "http://localhost:8887/altoAnnotations.json" --stringparam xRatio 1 --stringparam yRatio 1 --stringparam canvasURI "http://07ae9a4f-5e65-4ecd-9796-7f682e7e0b37" annotationListNoArt.xsl /Users/gmr/Downloads/CAVA_TS_1371_5097_0008_002_alto.xml > altoAnnotations.json