#202 Unknown type annotation 0

Michael Kay

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).


  • Michael Kay
    Michael Kay

    Logged In: YES

    Reopened: only one occurrence of this problem was fixed in
    7.9.1, and a number of other occurrences have been found in
    8.0. Most commonly it occurs when a DOMSource is used, it
    has also been reported in respect of a tree constructed
    using the sql:query extension.