Attempting to use current element but none exists.

#6048   Run-time catchable error

Attempting to use current element but none exists.

Explanation

There is only a current element between the start tag and end tag of the document element. It is an error to attempt to access the components of an element outside of the document element.