Previous Stack questions indicate that in certain implementations of XQuery, returning attributes directly from a path expression (e.g. `$doc//@name') fails to display results and yields runtime errors:
Can't select XML attributes with Oxygen XQuery implementation; Oxygen XPath emits result
XQuery unable to select attribute
While attribute values can be returned using the string()
or data()
functions, I'm still confused as to why this limitation exists at all. The former link suggests that it is indeed the OXygen IDE itself, independent of the XQuery processor. However, when I try to return attributes directly I get the following runtime error message:
error: Failed to invoke method retrieveFirstChunk in class org.exist.xmlrpc.RpcConnection: org.xml.sax.SAXException:
Error SENR0001: attribute 'notBefore' has no parent element
Since this error message is from the processor, could the type of processor play a role? I'm using eXist-db as my data source and processor.