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

RE: Is it possible to dynamically select portions of an XML

Subject: RE: Is it possible to dynamically select portions of an XML page?
From: Mike Dierken <mike@xxxxxxxxxxxxxxx>
Date: Fri, 14 May 1999 08:56:12 -0700
xml in a querystring
When I've run into this issue, I use dynamic entity references.
I have a simple servlet which takes URL query terms and uses their
name/value pairs to 'adjust' the entity declarations in an internal DTD of
the .XSL file.
It's like passing parameters to the stylesheet.

<!DOCTYPE sample [
 <!ENTITY title "book1" >
]>
<xsl:for-each select="BOOKSTORE/BOOK">
	<xsl:if test=".TITLE='&title;'">
	<!-- show the book details-->
	</xsl:if>
	<!-- else don;t -->
</xsl:for-each>

Here is an article explaining it in a little more detail and with sample
Java code.
http://xdev.datachannel.com/press/lounge.html

Mike D
DataChannel

-----Original Message-----
From: Ben Robb [mailto:Ben@xxxxxxxxxx]
Sent: Friday, May 14, 1999 3:48 AM
To: 'xsl-list@xxxxxxxxxxxxxxxx'
Subject: Is it possible to dynamically select portions of an XML page?


Hi,

I have a large XML page, and I want to show only a small part of it via my
XSL sheet.

I put in something like:

	<xsl:for-each select="BOOKSTORE/BOOK">

		<xsl:if test=".TITLE='book1'">
		<!-- show the book details-->

		</xsl:if>

		<!-- else don;t -->
	</xsl:for-each>

and it works fine. Now for the slightly tricky bit. I want the "if"
statement to be dynamic. I can pass the ASP page I am displaying the XML in
a querystring. So is there a nice way to pass the querystring to the
stylesheet and have it act on it?

something like (but not, since you can;t use % symbols)

<xsl:if test=".TITLE='<%=Request.QueryString("title")%>'">


Or is there another workaround?

Hope this is clear.

Rgs,

Ben Robb
cScape Strategic Internet Solutions


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


 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.