[[PageOutline(1-4,,pullout)]] = XML Encoding = The scholars of the Harriot online project are working with an enhanced version of the ECHO XML schema which allows them to insert commentary and editorial remarks. These markings have in a second step to be converted to the regular ECHO schema, before it can be uploaded and displayed in the ECHO display environment. Also, the LaTeX shorthand for math has to be transformed into MathML. == Editing == Scholars working on the Edition at the moment use either Emacs or XeMeL, an Eclipse-based XML editor with SVN client. We recommend the use of text editors that offer autocompletion in connection with the Schema which facilitates the editing. Attached are two version of that schema: * an XSD version which can be used while editing texts in XeMeL. To make it work properly, the following line has to be added to the {{{echo}}}-Tag at the top of the document: {{{ xsi:schemaLocation="http://www.mpiwg-berlin.mpg.de/ns/echo/1.0/ harriot_xsd/echo.xsd " }}} * and an RNC version for use in e. g. Emacs More information is to found at [wiki:XMLDESpecs#ConnectiontotheECHOSchemaandAutocompletion the general page on XML editing]. As for formulas, it possible to use LaTeX markup. There is a script that converts that code into MathML ([https://it-dev.mpiwg-berlin.mpg.de/svn/digitizing-tools/scripts/mathml/ link]). == Upgrading XeMeL == As of 2015, the repository uses Subversion 1.7 which means that also local working copies have to be upgraded (by issuing {{{svn upgrade}}} on the command line). But also existing copies of XeMeL would need to be updated. A new version is located at http://ocropus.mpiwg-berlin.mpg.de/~kthoden/XeMeL.zip. If you want to update the copy yourself, you need to download http://subclipse.tigris.org/files/documents/906/49280/site-1.8.22.zip and http://www.svnkit.com/org.tmatesoft.svn_1.7.14.src.zip and extracted in the root folder of XeMeL (so that things are written in the {{{plugins}}} directory and so on). Also, in the preferences of XeMeL, the correct SVN interface has to be chosen: SVNKit (!PureJava). == Macros == For both Eclipse and Emacs, templates have been created to quickly insert Commentaries and Translations. As this will later be fed into the annotation system, date and username are also inserted. Unfortunately, in Eclipse the date format is dependant on your machine's language settings. Both template files are in the [source:/trunk/texts/Harriot/Documents/ SVN repository]. = Map Editing = The maps are edited with the free (but not open source) editor [http://www.yworks.com/en/products_yed_about.html yEd]. The symbols for the maps are stored in a [source:/trunk/texts/Harriot/Maps/paletteManuscripts.graphml palette], which makes sure that the right symbols are used. = Bibliography = Two bibliographies are kept, one for [source:/trunk/texts/Harriot/Documents/Bibliography.bib secondary literature], the other for [source:/trunk/texts/Harriot/Documents/Sources.bib source books] that Harriot used and referred to. Both of them are in the Biblatex format and a [http://echo.mpiwg-berlin.mpg.de/content/scientific_revolution/harriot/project_infos/harriot-bibliography HTML version] of them is included in the ECHO pages on this project. The conversion to HTML is done at the moment using [http://www.lri.fr/~filliatr/bibtex2html/ bibtex2html 1.96] with the following command: {{{ ./bibtex2html -o Export -nobibsource -unicode -a -i Sources.bib }}} = Storage of files = As of September 2012, the project's files are also part of the [source:/trunk/texts/Harriot MPIWG-MPDL Content Project's repository]. This will make updating the repository or local copies much easier. The respective branch can be checked out by directing a Subversion client to {{{https://it-dev.mpiwg-berlin.mpg.de/svn/mpdl-project-content/trunk/texts/Harriot}}}. The structure of the repository remains the same: * [source:/trunk/texts/Harriot/Maps Maps] contains schematic maps of how the folios might be structured thematically * [source:/trunk/texts/Harriot/Transcripts Transcripts] contains transcriptions in XML files * [source:/trunk/texts/Harriot/Documents Documents] contains miscellaneous documents, e. g. typing conventions = Conversion workflow = To facilitate the work of the scholars, they are free to use some shorthands for XML elements or type LaTeX style formula encoding. Before uploading, four scripts convert the XML into a version that can be uploaded via the [http://mpdl-proto.mpiwg-berlin.mpg.de/mpdl/doc/doc-operation-exist.xql uploading interface]: 1. [source:/trunk/schema/scripts/Harriot/cleanURL.py cleanURL.py] replaces ampersands in URLs and also removes the {{{xsi:schemaLocation}}} from the header 1. [source:/trunk/schema/scripts/Harriot/bibtex_linker.py bibtex_linker.py] uses input from the Biblatex files (see above) and the Python library [https://bibtexparser.readthedocs.org/en/latest/index.html bibtexparser] to create links in the XML to the online resources or, if there is none to the bibliography on ECHO. 1. [source:/digitizing-tools/scripts/mathml/mathml-wrapper.py mathml-wrapper.py] converts LaTeX math code into mathml. 1. [source:/trunk/schema/scripts/Harriot/adjustHarriot.xsl adjustHarriot.xsl] does the main work in converting the Harriot-specific markup into ECHO-conform elements. A shell function is quite convenient for dealing with all the scripts in a row and checking the XML for validity in between (adjust paths to your needs): {{{ #!zsh harriot() { export SCRIPTS="/Users/kthoden/ECHO_svn/schema/scripts/Harriot" export ECHO_SCRIPTS_DIR="/Users/kthoden/src/eclipse/projects/digitizing-tools/scripts" # echo comment echo ============= $* ============= if [[ -r $(echo "$*" | sed s/.xml/-adjusted.xml/ ) ]]; then echo Removing previous conversion file rm -v $(echo "$*" | sed s/.xml/-adjusted.xml/ ) fi echo Correcting URLs python $SCRIPTS/cleanURL.py $* && echo Checking for wellformed XML xmllint --noout 01_cleanedURL.xml && echo Adding bibliography items && python3 /Users/kthoden/ECHO_svn/schema/scripts/Harriot/bibtex_linker.py 01_cleanedURL.xml echo Then math out put && python /Users/kthoden/src/eclipse/projects/digitizing-tools/scripts/mathml/mathml-wrapper.py --outputTextFile=02_mathConverted.xml --console=/tmp/console.txt 01_cleanedURL-bib.xml && echo Doing more adjustments things with "$*" java -jar /Users/kthoden/ECHO_svn/schema/thirdparty/saxonhe9-2-1-1j/saxon9he.jar -xsl:$SCRIPTS/adjustHarriot.xsl -s:02_mathConverted.xml -o:$(echo $*| sed s/.xml/-adjusted.xml/g) && echo Removing temporary files rm -v 01_cleanedURL.xml 01_cleanedURL-bib.xml 02_mathConverted.xml && echo Is it valid? java -jar /Users/kthoden/ECHO_svn/schema/thirdparty/jing-20091111/bin/jing.jar -c /Users/kthoden/ECHO_svn/schema/schema/echo/echo.rnc $(echo $*| sed s/.xml/-adjusted.xml/g) echo Finis. echo ==================================== } }}} The resulting files carry an {{{-adjusted}}}-infix and will then have to be moved and renamed to [source:/trunk/texts/eXist/echo/en] (for the time being) to then ingested into the ECHO system. = Map conversion workflow = == Export to static maps == The maps can be exported to html and a [http://echo.mpiwg-berlin.mpg.de/content/scientific_revolution/harriot/maps/0_TOPICS.pt webpage] exists that displays all the maps and can be browsed. Export from yEd has to be done manually for each map (there is no mass exporter), but the settings remain stable per session. The required steps are: 1. Set the export directory (remains stable per session) 1. Export as HTML-Imagemap with the following settings 1. Clipping: Default (leave settings as they are) 1. Image: Choose PNG and Antialiasing 1. HTML: uncheck both boxes (open link in new window, export description as tooltip) and replace the existing template with the following code (adapted to ECHO's Zope environment): {{{