I have the following RestXQ method and I want the browser the is calling this URL to force it to a ‘save as…’ dialog with the filename $schema || ‘.xsd’

 

declare
    %rest:GET
    %rest:path("/schema/{$schema}/{$version}")
    %rest:produces("application/xml", "text/xml")
    %output:method('xml')
    %output:omit-xml-declaration("no")
    %output:indent("yes")
function eim:get-version($schema as xs:string, $version as xs:string) {
   
let $path := $config:data-root || '/' || $schema || '/versions/' || $version || '/' || $schema || '.xsd'
   
return (<rest:response>
    
<output:serialization-parameters>
      
<output:media-type value='application/xml'/>
    
</output:serialization-parameters>
  
</rest:response>, doc($path))
};

 

 

Am I trying to get RestXQ to do something that it cannot?

 

Thanks,

Loren