概要

TEI/XMLを対象としたエディタの一つとして、LEAF-WRITERがあります。

https://leaf-writer.leaf-vre.org/

以下のように説明されています。

The XML & RDF online editor of the Linked Editing Academic Framework

GitLabのリポジトリは以下です。

https://gitlab.com/calincs/cwrc/leaf-writer/leaf-writer

このツールの特徴の一つとして、以下が説明されています。

continuous XML validation

このvalidationには以下のAPIが使用されているようでした。

https://validator.services.cwrc.ca/

また、ライブラリは以下のようです。

https://www.npmjs.com/package/@cwrc/leafwriter-validator

今回は、上記のAPIを試してみます。

試す

以下のページが表示されます。

https://validator.services.cwrc.ca/

Try ItのPOSTで以下を試しています。

Schema URL: https://raw.githubusercontent.com/nakamura196/test2021/main/tei_excel.rng
Schema Type: RNG_XML
Document Content:

<<<<???sT/xxxcETmmmhI<<Elllet/t/I--mxetet>vmmami<ex<eeootlHf/itb/xrddyneifH>obtseepsal<<<ied<>ille=det/p/s/laypdon"eDituposed>>pynhhshret<ib<uu<oDeI>>=rr=t>slttlpbrpuer"ee"tceili>lc>rs>a1ffhp>StecPieIccm.==t:tlSaucDne>0""t/mettbaefD<"hhp/t>miltsoentt:w>Ttoiicrsaett/wi>nco>mcmnpp/wtSana>ec::p.lttSt>o/utemitiSd/re<tomoaiwwli/>ntntnww.-t>ogwwociIar=..c.tnbu"ttlolfoUeecreouNTii.g>rtaF--o/mk-ccrnata8..gsthm"oo//ieu?rrd1or>ggs.nsa//d0<o<rrl"/u/ee/>prnlls>caeecemaah<esse/>eemp.//a>xxtmmrll/ntt"ee?ii>//ccuussttoomm//sscchheemmaa//rreellaaxxnngg//tteeii__aallll..rrnngg""ttyyppee==""aapppplliiccaattiioonn//xxmmll""schematypens="http://relaxng.org/ns/structure/1.0"?>

上記は、http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rngをスキーマとする場合にはエラーが生じませんが、使用可能なタグを限定したhttps://raw.githubusercontent.com/nakamura196/test2021/main/tei_excel.rngではエラーが生じるはずです。

こちらも参考にしてください。

結果、以下のように、エラーが返却されました。nameタグの使用に誤りがあるという理由も返却されています。

<?vxa<<mlsw/alita<<<<<wldarlcmepaivatnioelardetuinlsetnarisneusmhitso>g>mae>niinf>2ngn/goo-a2>etT>nnri<2>>E-=el/4enIr"s<l<la/e1u/i/emts.lsncmeeu0tteoe<xl">a>ln/tttute[>euml1nsn"e]c>>nm/oaebdmnoietdn">yg[=n1"o]Ut/TpFa[-l18l]"o/?wn>eadmea[n1y]w<h/epraet;h>expectedtheelementend-tag,textorelement"choice","date","label","lb","note","orig","pb","persName","placeName","reg","ruby","seg","space"or"title"</message>

まとめ

TEI/XMLのバリデーション機能の導入にあたり、参考になりましたら幸いです。