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

RE: How to manipulate XML based on attribute?

Subject: RE: How to manipulate XML based on attribute?
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Thu, 20 Jul 2000 09:36:13 +0100
to manipulate
> The vip attribute could occur on any element ...
> Wherever the vip attribute appears, I want to embed the 
> result of whatever I
> do with that element in <em></em> tags in the resultant HTML. 

An interesting little challenge to do this elegantly. The problem is that
there's no direct way of applying more than one template rule to an element.
But I think you can do something along the following lines:

a.xsl
<xsl:import href="b.xsl"/>
<xsl:template match="*[@vip]" priority="2">
  <em><xsl:apply-imports/></em>
</xsl:template>
<xsl:template match="*" priority="1">
  <xsl:apply-imports/>
</xsl:template>

b.xsl:
All the other template rules for your elements.

It's a little odd that you need two stylesheet modules: this is because
xsl:apply-imports will only look for rules with lower import precedence, not
for rules with lower priority.

I think this is the first problem I have ever seen on this list to which
xsl:apply-imports is the answer.

Mike Kay


 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.