Saxon can crash with the message "unknown type
annotation 0 in data model". The cause is in
Navigator.java, method copy(), which has a call to
out.startElement() and a call to out.attribute()
supplying a second argument (typeCode) of zero, which
should be -1.
It's a little difficult to explain exactly what
circumstances cause the error. This copy routine is
used in three situations: where the source node is a
DOM wrapper, a JDOM wrapper, or an Orphan node
(typically a parentless attribute). Parentless
attributes are most likely to arise from computed
attribute constructors in XQuery. The error only cause
a crash if there is a subsequent attempt to obtain the
typed value of the copied node.
Source code fixed, test case added (qxmp129).