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

RE: XML/XSL and ASP/IIS

Subject: RE: XML/XSL and ASP/IIS
From: Mike Dierken <mike@xxxxxxxxxxxxxxx>
Date: Thu, 3 Jun 1999 07:42:25 -0700
asp xml class .net
Passing parameters to an XSL stylesheet (or any XML file) is something that
pops up now and then.
The approach that I've taken is to use entity references inside the XML/XSL
file, and extend the 'DOM builder' class to adjust the value of the entities
when the DTD portion of the XML file is parsed, but before the body of the
XML file is parsed.

An example XML file would look like:

<!DOCTYPE layout [
 <!ENTITY baseResourcePath "/layouts/theme1/" >
 <!ENTITY username "Mr. Bigglesworth" >
]>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
  <xsl:template match="/">
    <HTML>
    Welcome &username;!<br />
    <img src='&baseResourcePath;welcome.gif' />
    </HTML>
  </xsl:template>
</xsl:stylesheet>


Since I use a Java XML processor that supports SAX events, it was pretty
easy to extend the base Document class to accept a list of name/value pairs
(a Hashtable) and adjust the entity values when the 'on DTD Parsed' event
occurred.

I wrote an article with sample Java code for the DataChannel XML Parser -
http://xdev.datachannel.com/press/lounge.html 
Let me know what you think.

Mike D
DataChannel


 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.