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

Best way to use global params in templates to cover po

Subject: Best way to use global params in templates to cover potentialcom binations?
From: "Kathy Burke" <Kathy_Burke@xxxxxxxxx>
Date: Mon, 29 Sep 2003 13:34:25 -0400
kathy ggg
First, I have done a bunch of reading on params, but haven't quite seen what
I need to understand how to accomplish what I hope I'm describing below.

Within an xml doc, I have an element named <link> with attributes for
Customer and Assembly. A document may or may not use these attributes (if
blank, means use for all customers and/or assemblies). For example, in one
doc I there could be multiple <link> elements within a <para> (<para> is the
parent element) such as:

<link Customer="XYZ" urlf="graphic1.gif">Show picture one.</link>
<link Customer="ABC" Assembly="1234" url="graphic2.gif">Show picture
two.</link>
<link Customer="GGG" url="graphic3.gif">Show picture three.</link>

>From within my app, I pass the two values as parameters (e.g.,
Customer='ABC', Assembly='1234') to the xsl stylesheet. (believe it or not,
I actually KNOW how to do this!).

To date, I've only used a simple template, not requiring the use of these
parameters as filters:

	<xsl:template match="link">
	      <a target='_blank" href="{@url}"><xsl:apply-templates/></a>
	</xsl:template>

In English, I need to cover in xsl all potential combinations of Customer
and Assembly (exists or not exists), for example:

1. If the Customer attribute does NOT exist in <link>, show the link {@url}
regardless of the param value for customer XYZ.
2. If the Customer attribute DOES exist, show the link ONLY if the attribute
matches the param value XYZ.
3. Also, various combinations of Customer AND Assembly attributes exist,
etc.

Hope this explanation is clear enough.

I'm confused (big surprise!) on how to combine these requirements and the
syntax to do so. Any suggestions, or pointers in the right direction, are
greatly appreciated.

Thanks, Kathy


 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.