Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #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?


Reply With Quote
  #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.


Reply With Quote
  #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 :)


Reply With Quote
  #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".


Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 11:36 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.