Orbeon, get-request-attribute and "Content is not allowed in prolog"
Not one of my favourite problems as it is sometimes difficult to figure out what is the actual cause. In general, the “content is not allowed in prolog” indicates there is some content in the XML file or stream before the <?xml ...>
declaration.
The error can easily happen if Orbeon thinks something is XML when it’s not. I’ve run into this problem a couple of times with the xxforms:get-request-attribute
function. By default, Orbeon seems to think the attribute probably contains XML data, tries to parse it, and then runs into the problem if it is not actually XML.
Luckily, this is easy to fix. Just pass in the content type in the second argument:
xxforms:get-request-attribute('MY_VAR', 'text/plain')