variable1 is not a managed document
Attempt to execute a DLS function on an unmanaged document.
Use dls:document-manage to place the document under management.
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.