xsl:include/@mode
Added by Anonymous over 15 years ago
Legacy ID: #6708648 Legacy Poster: Andriy Gerasika (andriy_gerasika)
Hello, Michael, can you please have a look at below two articles and comment about the approach: http://www.gerixsoft.com/blog/xslt/xml-pipeline-xslt http://www.gerixsoft.com/blog/xslt/xsl-include-mode What I am looking for, is official approval and possibility for inclusion into official distribution. Thank You, Andriy Gerasika
Replies (5)
Please register to reply
RE: xsl:include/@mode - Added by Anonymous over 15 years ago
Legacy ID: #6708945 Legacy Poster: Michael Kay (mhkay)
Inherently I agree that linking modes to modules is a good idea, and in fact we are planning something along these lines in XSLT 2.1. The primary mechanism we are planning is to define the default mode for a module within the module itself (perhaps on the xsl:stylesheet element), not on the xsl:include/import of that module; though we've been considering that idea too. If you're devising extensions to the XSLT language, I would suggest sticking to the rules for making extensions conformant. In the first place, this means that any new attributes should be in a namespace. It also means in theory that the new attribute should not change the behaviour of the stylesheet except to the extent that the behaviour is implementation-defined in the spec; that's rather hard to achieve for this case and I think it's a rather draconian restriction, but I do try and stick to it with extensions that are shipped with the Saxon product. At present I think my preference on this one is to wait and see what the XSLT 2.1 specification ends up looking like, rather than anticipating it. The other thing you mustn't forget is that writing the documentation and test cases for a Saxon extension is often much more work than writing the code.
RE: xsl:include/@mode - Added by Anonymous over 15 years ago
Legacy ID: #6712365 Legacy Poster: Andriy Gerasika (andriy_gerasika)
ok. In case you'll change your mind, I can redo the patch as xsl:include/@saxon:mode or xsl:stylesheet/@saxon:mode. I am willing to do this, since it will simplify things a lot at my day job (lots, lots of mode stuff:)) Thanks for your reply.
RE: xsl:include/@mode - Added by Anonymous over 15 years ago
Legacy ID: #6712677 Legacy Poster: Michael Kay (mhkay)
Given the importance of standards conformance, I think that as a user, you might find that a better solution is something like this: <xsl:include href="modulex.xsl?mode=somemode"/> where the URIResolver that interprets the href attribute then performs a transformation on the contents of modulex.xsl to change all modeless xsl:template and xsl:apply-templates elements to set the specified mode. The advantages of this are (a) your stylesheet is standards-conformant (you are exploiting a "hook" where the spec deliberately allows extensions to the standard behaviour), and (b) you're using standard product, with no need to maintain a special patch - in fact the URIResolver API itself is product independent. Michael Kay http://www.saxonica.com/
RE: xsl:include/@mode - Added by Anonymous over 15 years ago
Legacy ID: #6779463 Legacy Poster: Andriy Gerasika (andriy_gerasika)
excellent idea. This will work ok for me. Thanks
RE: xsl:include/@mode - Added by Anonymous about 15 years ago
Legacy ID: #7720882 Legacy Poster: Andriy Gerasika (andriy_gerasika)
Hello, I have implemented ?mode in xsl:include, source code is available at http://www.gerixsoft.com/blog/xslt/xsl-include-mode-new Many thanks for the hint
Please register to reply