Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
| Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old November 29th, 2007, 06:31 PM
Authorized User
 
Join Date: Jul 2007
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default anyway to call a template with a lower precedence?

Let's say I have a named template I name "foo". The style sheet that "foo" is in then imports a stylesheet that also has a template named "foo". Is there anyway for the importer style sheet's foo to call the lower precedence imported style sheet's foo?


  #2 (permalink)  
Old November 29th, 2007, 07:59 PM
Friend of Wrox
Points: 1,676, Level: 16
Points: 1,676, Level: 16 Points: 1,676, Level: 16 Points: 1,676, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2006
Location: , , .
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

I believe you can use a namespace to do what you are trying.


  #3 (permalink)  
Old November 29th, 2007, 11:05 PM
Authorized User
 
Join Date: Jul 2007
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The case I have includes three style sheets.

1) a main style sheet that generates a web page that calls template named foo() in style sheet (2)

2) this style sheet may or may not include a foo(), but this style sheet always imports style sheet (3) that always includes a foo()

3) style sheet (3) always includes foo()

This is for an application framework problem I'm working on. The idea is that external developers can optionally add a foo() to style sheet (2) that will then be directly called by style sheet (1) instead of the foo() in style sheet (3): override the name.

However, I'm thinking it would also be nice to let the developer call the original named style sheet in template (3) from the foo() in style sheet (2) if they really want to. This is sort of like apply-imports, but the developer can directly call a specific named template rather than telling the XSLT to find a matching template. Of course if there is some way to get the same thing to happen with apply-imports, I would love to know how :)


  #4 (permalink)  
Old November 30th, 2007, 12:13 PM
Authorized User
 
Join Date: Jul 2007
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I found one potential solution using "simulating higher order functions".




Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about template precedence asc BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition ISBN: 978-0-470-19274-0 3 December 1st, 2008 08:14 AM
Difference between call-template ,apply-templates vikkiefd XSLT 4 March 12th, 2008 05:09 AM
Using Parameter to call another template mikevn123 XSLT 1 October 27th, 2006 03:08 PM
how to use call-template result in a test? briforge XSLT 6 February 13th, 2006 06:54 PM
import / call / template match Kabe XSLT 3 February 26th, 2004 11:31 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.