[xsl] client side style sheets?

Subject: [xsl] client side style sheets?
From: Paul Bleisch <pbleisch@xxxxxxxxxxxxxxxx>
Date: Mon, 29 Jan 2001 22:00:02 -0600
I am attempting to build a system in which a server generates 
XML data to which the client side then applies an XSLT. I'd 
like to use IE + MSXML3 as the client and have the client-
side XSLT generate HTML.  The server is a very tiny embedded
HTTP server that dispatches to "response objects" that generate
the XML output.

The problem I've run into is that I can't seem to find a nice
way to associate (from the client) the transform with the 
source data (generated on the server).

So far I've tried:

a) Give up and have the server insert a stylesheet processing
   command into the server output.

b) Have the client specify the XSLT to use with a URL query
   string parameter (i.e. someurl?xslt=foo.xsl ).

c) Create an xslt that transforms a document of the following
   form to the desired output:

   <xdbpage source="http://server.com/someresource.xml"; 
            display="file://path/to/xslt/display.xsl" />

   Then the generic XSLT (display.xsl) would then use 
   document() to pull in the XML (in @source) and apply 
   the xslt (in @display):

  <xsl:template match="xdbpage">
    <xsl:processing-instruction name="xml-stylesheet">
	 href="<xsl:value-of select="@display" />"
    <xsl:apply-templates select="document(@source)/*" />

  Users can then create these very simple XML files and 
  simply open them in IE (assuming MSXML3 is installed 
  in replace mode).

I don't like a) because it really defeats the purpose of this
tool (remote debugging where the embedded web server simply 
delivers data and the user defines how to view it).  
b) is very painful because it requires modifying all of the 
XML generation code on the serverside to output the correct 
stylesheet reference.  The way the server side is architected 
(and written right now) would make this difficult.  

I've tried c) but cannot get display.xsl to correctly transform
the source document.  It is retrieving the source document
(I can insert a breakpoint in the web server request code.)
but the output is only the generated style sheet reference.
and no actual XML output.  I think that this is actually what
display.xsl I have above is supposed to do, but I cannot find
a way to change both the input node tree *and* the current

Two questions...

1) Are there standard/easy ways to allow users to apply/associate
   XSL transforms to/with XML data from some server source?

2) How do I correctly do c) above?



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread