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

RE: Xsl problem (template matching)

Subject: RE: Xsl problem (template matching)
From: Jim Michael <JMichael@xxxxxxx>
Date: Mon, 20 Dec 1999 08:42:03 -0500
bhavesh bhanushali
In order for your template to match under all nodes, would you not have to
use // as in:

<xsl:template match="//display-type">
	<!--rules here -->
</xsl:template>

If your display-type node sits directly beneath another node you are using a
template match for, then the // isn't necessary. Or is the above approach
poor form? I can think of instances where the // might be useful for
extracting deeply nested nodes of interest. Thanks.

Cheers,

Jim

> Don't worry, that's how XSL works. You can declare template 
> rules so that
> they will only fire if elements are in particular contexts, 
> or so that do
> they do so all the time.
> 
> For example:
> 
> <xsl:template match="display-type">
> <!--rules here -->
> </xsl:template>
> 
> will fire for all display-type elements in your document, whereas:
> 
> <xsl:template match="display-type[@value='bullets']">
> <!--rules here -->
> </xsl:template>
> 
> and
> 
> <xsl:template match="example/display-type">
> <!--rules here -->
> </xsl:template>
> 
> will only fire in particular contexts.
> 
> I hope that helps. Do take a look at the XPath spec @ 
http://w3.org/TR/xpath

Richard

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxx]On Behalf Of bhavesh bhanushali
Sent: Saturday, December 18, 1999 12:16 AM
To: xsl-list@xxxxxxxxxxxxxxxx
Subject: Xsl problem (template matching)


Hi

I am newbie in xsl.
My problem is:-
I want to apply a particular template where ever that particular node exist
i.e independent of its parent elements.


for e.g
<example>
<name>xxxy</name>
<display-type value="bullets">
<training>xyz</training>
</display-type>
<section>aaaa</section>
<display-type value="bullets">
<topic>Hello</topic>
</display-type>
</example>

I want to match (display-type) node and use the same template whereever it
is present.
I hope u understand. Can Anyone suggest the solution.
Thanks in Advance

With Regards
Bhavesh

______________________________________________
FREE Personalized Email at Mail.com
Sign up at http://www.mail.com?sr=mc.mk.mcm.tag001


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


 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.