I stumbled on this partially-documented feature while experimenting with XSL and XML processing. Quite frequently, I'll want to pipe my XML through several stylesheets and view the result in a browser. This is an iterative process, so dealing with intermediate files is time consuming and confusing.
You can pipe output from stdout through a pipe to Safari with the open command. This example shows xalan transforming a file for a browser, and piping this into Safari:
xalan literal.xml html.xsl | open -a /Applications/Safari.app -f
The manpage for open doesn't say you can use the -a {application} option with the -f parameter. The -f parameter says that the open command will open the default text editor from stdin. But using -a {application} in conjunction with -f opens the application with the first command line parameter as stdin. In this case, the pipe from xalan output becomes stdin for Safari, which happily displays the page.
open -a /Applications/Safari.app -f
Safari will wait for you to enter a properly formatted HTML page; here's a simple example:
<html>
<head></head>
<body>Test</body>
</html>
You finish by typing Control-D, and at that point, Safari will then display the page you enter.
Mac OS X Hints
http://hints.macworld.com/article.php?story=20051122200920326