[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] minimally overriding functions in XSLT 2.0
Dear List Members, I've searched the FAQ and the archive but did not find this specific topic discussed. The general issue here is customizing the behavior of stylesheets while avoiding as much as possible code duplication. The way I typically customize the behavior of a stylesheet that I should not alter (for whatever reason) is to create a new stylesheet which imports the base stylesheet, and then I override what I need. Minimally overriding the functionality of templates imported from the base stylesheet is trivial: it amounts to detecting the condition I care about, producing the right output for this case, and calling <xsl:apply-imports/> for all cases where the base stylesheet does the right thing. (And it can be even simpler than this.) There does not seem to be an equivalent way to achieve this when it comes to overriding functions. I can override a function defined in the base stylesheet but there is no mechanism that I can see that would allow the overriding function to call the overridden function. So I have to copy most of the overridden function into the overriding function if I want to preserve functionality for most but not all cases that the overridden function already handles. So I can override, but not "minimally". Maybe there's something I've missed somewhere in the XSLT specs? I believe the issue is with XSLT 2.0 itself but in case it matters I'm using teitodocx, which in turn uses Saxon-HE 9.4.0.4J from Saxonica to do the XSLT processing. Thank you, Louis
|
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
|