Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
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
 
Old November 5th, 2010, 02:28 PM
Authorized User
 
Join Date: Apr 2008
Posts: 70
Thanks: 17
Thanked 1 Time in 1 Post
Send a message via Yahoo to iceandrews
Default Metadata and Self Identifying Templates

I've got a transformation that's getting very large. Unfortunately, because of orchestration constraints that are out of my control, I'm unable to use <xsl:include> to logically separate my code sections. But I have the need to logically and programmatically identify each template.

For example, I have 3 groups of templates types: templates that filter data, templates that check data, and templates that enrich data. I'd like to be able to assign each template a unique, categorizing ID that can be located via another transformation. If other words, filtering templates would be ID'd based on their category, rule name and version number. (Filter.RuleName.X) and so on with other categories, (Checks.RuleName.X / Enrich.RuleName.X) where X is a version number.

Using this type of label for each template, I can also increment the versions of each template. So if I make changes to a particular template, I can up the version number X. Once each template is ID'd and version-ed, I could do all kinds of things that I want to do.

Aside from a comment node on/in each template is there any other mechanism within XSLT to self identify a template? I'm using XSLT 2.0 and Saxon 8.9. I've looked through instructions and saxon extensions, but can't seem to find anything that meets my needs. Any suggestions?
 
Old November 6th, 2010, 06:00 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

XSLT allows you to add any attributes you want to elements such as xsl:template provided they are in your own namespace.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
The Following User Says Thank You to mhkay For This Useful Post:
iceandrews (November 9th, 2010)
 
Old November 9th, 2010, 03:22 PM
Authorized User
 
Join Date: Apr 2008
Posts: 70
Thanks: 17
Thanked 1 Time in 1 Post
Send a message via Yahoo to iceandrews
Default

Bingo! That should work perfectly fine. I didn't even think about adding an attribute in a separate namespace.

thank you.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Identifying a PGP file bnraju1 BOOK: Beginning Cryptography with Java 4 July 13th, 2007 04:05 PM
IDENTIFYING 10TH ROW IN A XSL SOMANATHAN10 XSLT 0 February 13th, 2007 07:04 AM
IDENTIFYING THE PORTS abdul_owiusa C# 3 August 7th, 2004 04:11 AM
Uniquely Identifying Delegates p_nut33 Pro VB.NET 2002/2003 0 May 3rd, 2004 09:54 AM
Identifying a selected datagrid column burdickdave ASP.NET 1.x and 2.0 Application Design 0 July 30th, 2003 02:19 PM





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