Provide an XML version of the stack trace #55
Labels
Enhancement
A change or improvement to an existing feature
Propose Closing with No Action
The WG should consider closing this issue with no action
XQFO
An issue related to Functions and Operators
While the string version of
fn:stack-trace()
is useful for debugging and including in log messages, being able to process that (from an XML representation) is also useful.Use Cases
current-function-name()
helper function -- e.g.fn:stack-trace("json")[1]?function-name
;fn:stack-trace
Like the current specification version of this function (with the same default semantics), but also supports XML and JSON formats. The "text" format returns an instance of
xs:string
in an implementation-defined format, the "xml" format returns an instance ofelement(fn:stack-trace)
, and the "json" format returns an instance ofarray(fn:stack-frame)
.Here,
fn:stack-frame
is defined as:The XML version has the same information as elements in the
fn:
namespace (e.g.fn:uri
).fn:format-stack-trace
If
$stack
is an instance ofelement(fn:stack-trace)
, it is converted into the desired output format. (If the output format is "xml", no processing is performed.)If
$stack
is an instance ofarray(fn:stack-frame)
, it is converted into the desired output format. (If the output format is "json", no processing is performed.)Otherwise, an
err:XPTY0004
error is raised.fn:parse-stack-trace
This function takes a stack trace in the implementation-defined format and parses it to XML or JSON. The "xml" format returns an instance of
element(fn:stack-trace)
, and the "json" format returns an instance ofarray(fn:stack-frame)
.If
$stack
is not in the correct format, an error (error code TBD) is raised.The text was updated successfully, but these errors were encountered: