@rend and the war on text-bearing attributes

In discussing that the TEI attribute @rend from att.global although it allows you to type just about anything in it, doesn’t actually allow anything more that a set of single tokens. I recently explained to John, Paul, George, or Ringo … Continue reading

Posted in TEI, XML | Leave a comment

Is it Bill or Ben that is speaking of flowerpot men?

A friend asked a question about how to encode a dramatic speech that possibly should be considered two speeches. Owing to a printing mistake, the second speaker’s name was omitted, so some consider it a single speech by the first … Continue reading

Posted in TEI, XML | Leave a comment

grouping by group-adjacent=”boolean(self::lb)”

A project I was doing some work for had some input that looked like: <?xml version="1.0" encoding="UTF-8"?> <TEI xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns="http://www.tei-c.org/ns/1.0"> <teiHeader xmlns:xi="http://www.w3.org/2001/XInclude" type="text"> <fileDesc> <titleStmt> <title>A sample file</title> </titleStmt> <publicationStmt> <distributor>InfoDev</distributor> </publicationStmt> <sourceDesc> <p>VSARPJ project</p> </sourceDesc> </fileDesc> <profileDesc> <creation> <date/> … Continue reading

Posted in TEI, Uncategorized, XML, XSLT | Leave a comment

For Loops in XSLT2

A colleague asked me the other day about the proper way to do for-loops in XSLT2 or more specifically in XPath2. He knows all about xsl:for-each and xsl:for-each-group iteration over things, and of course recursively calling a template while passing … Continue reading

Posted in XSLT | Leave a comment

ENRICH

Until December 2009 I worked on the ENRICH project, and as it has now finished, I thought that I should reflect on some of what the project has done and the aspects we’ve been involved with here in Oxford. For … Continue reading

Posted in TEI, XML | 4 Comments

addingIDs

Rehdon asked me about giving @xml:id attributes to things, so I whipped up this quick XSLT stylesheet. Some people prefer to use generate-id() to get a truly random and unique ID without semantic baggage. In many cases, where IDs are … Continue reading

Posted in TEI, XSLT | 2 Comments

adding word-level markup

Rehdon and snail and others occasionally have asked me recently about marking up words inside another element where there may be markup (sometimes containing more than one word) inside this so I thought I’d write it up. So for example … Continue reading

Posted in XML, XSLT | 4 Comments

XSLT2 collection() with dynamic collections from directory listings

Something I didn’t know about XSLT2′s collection() function. I had previously used it in the form: <xsl:variable name="files" select="collection(docs.xml)"/> where docs.xml has a structure of: <?xml version="1.0"?> <collection> <doc href="blort1.xml"/> <doc href="blort2.xml"/> </collection> You can then address, via the variable, … Continue reading

Posted in XML, XSLT | Leave a comment

XIncluding portions of TEI Documents

‘Leoba’ another time asked me what to do when multiple files want to refer to the same textDesc, msDesc, listPerson or similar elements in their teiHeader. To me, this is the canonical example use-case for W3C XInclude. You can store … Continue reading

Posted in TEI, XML | Leave a comment

publicationStmt

‘Leoba’ asks me recently about publicationStmt, wondering: I have always thought that the publicationStmt in the TEI header is to describe the publication of the electronic text, that is the TEI file itself (and the description of fileDesc seems to … Continue reading

Posted in TEI, XML | Leave a comment