Skip to content

Instantly share code, notes, and snippets.

View lguariento's full-sized avatar

Luca Guariento lguariento

  • University of Glasgow
  • Glasgow
View GitHub Profile
@lguariento
lguariento / app.xql
Last active August 13, 2018 12:53
Check if a node is empty in external file while transforming a document via xslt
xquery version "3.1";
import module namespace templates = "http://exist-db.org/xquery/templates";
declare namespace tei = "http://www.tei-c.org/ns/1.0";
declare option exist:serialize "method=html media-type=text/html";
declare function app:XMLtoHTML($node as node(), $model as map(*)) {
let $xml := doc('doc.xml')
@lguariento
lguariento / addnewperson.html
Last active May 31, 2018 09:11
Cardinality error
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Add a person</title>
</head>
<body>
<div class="templates:surround?with=templates/page.html&amp;at=content">
<div data-template="app:addPers"/>
import itertools
tasks = {
"25/10/2017": {
"Driving": None,
"Shopping": None
},
"26/10/2017": {
"Cleaning": None,
"Cooking": None,