voyanttools / trombone

GNU General Public License v3.0
3 stars 2 forks source link

Importing a TEI corpus doesn't work with the TEI P5 namespace #29

Closed Conal-Tuohy closed 1 year ago

Conal-Tuohy commented 1 year ago

The XPath below presupposes that the TEI element is in no namespace, but this is only true for very old TEI files (since 2002, TEI elements including the TEI element have been defined to be in the namespace http://www.tei-c.org/ns/1.0).

https://github.com/voyanttools/trombone/blob/b4120480f6810d4073b8eab0eb9ac1b312dbea55/src/main/resources/org/voyanttools/trombone/input-formats/teicorpus.xml#L4

The XPath could be changed to be compatible with both modern and old-style TEI by using the same idiom as the other XPath expressions in the same file, e.g.

//*[local-name()='TEI']
ajmacdonald commented 1 year ago

Thanks for finding this! https://github.com/voyanttools/trombone/commit/4311558365d582fbfc8d58c40d2a1095c189d040