[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: How to manipulate XML based on attribute?
> 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|