Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] Conditional Include statements

From: "C. M. Sperberg-McQueen" <cmsmcq@----------------->
To:
Date: 4/2/2009 11:54:00 PM
On 1 Apr 2009, at 23:32 , Vyacheslav Sedov wrote:



i can use doc(' ') to get stylesheet itself, then modify it, and at
last apply modified stylesheet to input document

why not?

You can indeed.  And (depending on how well you or the maintenance
programmer understands the structure of the modified stylesheet
that is actually processing the input) there may be no reason at
all why not.  Don't imagine I disapprove on principle.

But I do maintain that this is not the same kind of
self-modification that computer scientists played with and practical
programmers used (as Michael Kay said) in the 1950s and 1960s
(and in some cases later).  The differences may not be crucial
to what you want to do -- but they are crucial to the
maintainability and understandability of the program.
Dynamic generation of a program may be easy or hard to
understand, but it will almost always be simpler and easier
to understand and debug than self-modification in place.

One important difference: while debugging a system of the kind
you describe, you can write out the source code for the modified
stylesheet and study it.  The source you study is the same
source as the XSLT processor will be compiling and running.
That kind of inspection of the generated code is not possible
in the same way with programs that overwrite their binary form
in memory with different machine instructions, in binary.
That difference and others like it are, in turn, why I'm happy
for Saxon to have a transform() function, but would be less
happy to have it offer dynamic self-modification of a
running stylesheet (by, say, adding new templates).

Your mileage, of course, may vary.



--
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com
* http://cmsmcq.com/mib
* http://balisage.net
****************************************************************


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent