Subject: RE: Xsl problem (template matching)
From: "Richard Lander" <rlander@xxxxxxxxxxxxxxxxxxx>
Date: Sat, 18 Dec 1999 00:37:59 -0500
|
Hello,
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
|