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

Re: More <xsl:when> questions!

Subject: Re: More <xsl:when> questions!
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 6 Apr 2000 17:52:11 +0100 (BST)
xsl when test examples
NO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I think someone else should answer, 'cause I've explained this everyway
I can think of and still your examples have the same feature.

<xsl:template match="packet" >
	<xsl:if  test="../packet/para/title">

This does _not_ test if the current packet has a title, it says go up
and then look down to see if _any_ packet has a title, so this will
give the same result for all packets (if they are siblings of each
other)

you want

	<xsl:if  test="para/title">




	<xsl:when test="contains(/para/text/@text.role,'normal')">(Where I

This query looks for a para element immediately below the document root
so will always return an empty node set, and thus an empty string.

you want 
<xsl:when test="contains(para/text/@text.role,'normal')">(Where I



		 	(<xsl:value-of select="//para/@secur.classif"/>)

This query always, for every packet, returns the value of the first
secur.classif attribute in the whole document.

you want

		 	(<xsl:value-of select="para/@secur.classif"/>)

or perhaps

		 	(<xsl:value-of select=".//para/@secur.classif"/>)
if there are para elements not immediately children of packet.


	<xsl:value-of select="para/text"/>
ah finally a query that is looking inside the current packet element.
This one looks right.

David


 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.