This example returns a
Mathematica notebook directly to the client.
<msp:evaluate>
MSPReturn[ Notebook[ Cell[ "Hello", "Title"]],
"application/mathematica"]
</msp:evaluate>
This example returns an XML fragment. These techniques can be useful for making informal web services for working with technologies such as Flash or JavaScript that have convenient tools for processing XML.
<msp:evaluate>
MSPReturn[ ExportString[XMLElement["arg1", {}, {"5 6"}], "XML"],
"text/xml"]
</msp:evaluate>
The three-argument form of
MSPReturn is useful when you wish to set the filename associated with the response.
<msp:evaluate>
MSPReturn[ Notebook[ Cell[ "Hello", "Title"]],
"application/mathematica", "mynotebook.nb"]
</msp:evaluate>
In this case the client might try to use a filename of
mynotebook.nb. It should also be noted that for some clients, such as Internet Explorer, setting the filename header can cause the display of two
Open or Save dialog boxes.