teacup/config/play-template.xml
2021-12-15 11:29:23 +00:00

26 lines
No EOL
2 KiB
XML

<!-- point to a collection to use information from the XML already stored there -->
<formTemplate collection="/SS/content" contentType="tei">
<!-- @xpath will be resolved against each item in the collection, to pre-populate the field -->
<item name="title" xpath="/*:TEI/*:teiHeader/*:fileDesc/*:titleStmt/*:title" title="Title"/>
<!-- @occurs specifies whether is the field is optional and/or repeatable: allowed values ?, +, * -->
<item name="author" xpath="/*:TEI/*:teiHeader/*:fileDesc/*:titleStmt/*:author" occurs="+" title="Author" readOnly="true"/> <!-- some shouldn't be editable -->
<item name="pubdate" xpath="/*:TEI/*:teiHeader/*:fileDesc/*:publicationStmt/*:date[@type='publication']" title="Original publication date" assert=". castable as xs:gYear"/>
<item name="edition" xpath="/*:TEI/*:teiHeader/*:fileDesc/*:editionStmt/*:edition" title="Edition"/>
<item name="xml-isbn" xpath="/*:TEI/*:teiHeader/*:fileDesc/*:publicationStmt/*:idno[@n='xml']" title="XML ISBN"/>
<item name="hb-isbn" xpath="/*:TEI/*:teiHeader/*:fileDesc/*:publicationStmt/*:idno[@n='paperback']" title="HB ISBN"/>
<!-- now some fields that didn't exist in the source: -->
<!-- use @assert to specify some datatyping or other bespoke validation: -->
<item name="date" title="First published online" assert=". castable as xs:gYear"/>
<!-- <item name="description" title="Description" readOnly="true" xpath="
let $isbns := /*:TEI[@xml:id = $bookId]/*:teiHeader/*:fileDesc/*:publicationStmt
/*:idno[@type='isbn']
let $desc := collection('SS/ONIX')/ONIXMessage/Product[ProductIdentifier[ProductIDType='15']/IDValue[
.=
$isbns
]]/OtherText[TextTypeCode='01']/Text
let $doc := parse-xml('&lt;p&gt;'||replace($desc, '&lt;br(/)?&gt;', '&#xA;')||'&lt;/p&gt;')
return xslt:transform($doc, 'xsl/desc2html.xsl')"/> -->
<item name="taxonomy" controlledList="SS-taxonomy.xml" title="Index terms" occurs="+"/>
</formTemplate>