[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: client side style sheets?

Subject: Re: client side style sheets?
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Thu, 1 Feb 2001 14:37:43 +0000
dataurl select
Hi Paul,

> 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.

I was wondering whether there might be a way of doing this that
used document() to pull in the relevant data from the server.  You
could have stylesheets that operated on themselves, and used either a
parameter or something hard-coded into a separate document to identify
the source that they need.

For example, if your user defined an XML document on their client
with:

--- data.xml ---
<?xml version="1.0"?>
<xdbpage source="http://server.com/someresource.xml" />
---

They could then have a number of stylesheets all of the general form:

--- display.xsl ---
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="display.xsl"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:variable name="dataURL"
              select="document('data.xml')/xdbpage/@source" />
<xsl:variable name="data"
              select="document($dataURL)" />
                
<xsl:template match="/">
   <xsl:apply-templates select="$data/*" />
</xsl:template>

<!-- rest of the stylesheet formats the data from the server -->
                
</xsl:stylesheet>
---

Opening the stylesheet that they wanted to use to view the data would
cause the stylesheet to run on itself (the xml-stylesheet processing
instructions can be hardcoded on the stylesheet). The stylesheet would
then use the information in the data.xml file to identify which data
should be retrieved and formatted, fetch it from the server, and then
transform it.

Does that make sense?  Does it do what you were after?

Jeni

---
Jeni Tennison
http://www.jenitennison.com/



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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.