xsl-list
[Top] [All Lists]

Re: [xsl] best practices for using XSLT modes

2019-12-04 13:17:02
For sure. But you can also use fn:transform() to replace modes in some
cases, and turn mode management into file management :)

Liam

Yes, this is almost exactly the same as what Elliot shared with us -- but
omitting the modes could make it more unreadable.

Also, fn:transform() is only available in XPath 3.1, its specification is
overwhelmingly complex, and it seems to be
significantly implementation-dependent.

So, not quite convenient for developers who work with XSLT versions that
don't implement XPath 3.1 (All XSLT 2.0 and 1.0 applications are in this
group) or who want to achieve vendor-independence and maximum
clarity/testability.

Certainly, for XQuery **3** code this is the main way to invoke an XSLT
transformation, so they are in a worse position than their XSLT-developers
colleagues.

Cheers,
Dimitre

On Wed, Dec 4, 2019 at 11:00 AM Liam R. E. Quin 
liam(_at_)fromoldbooks(_dot_)org <
xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> wrote:

On Wed, 2019-12-04 at 16:59 +0000, Dimitre Novatchev
dnovatchev(_at_)gmail(_dot_)com wrote:
Without using modes I wonder if it would be possible at all to do
this processing in a single transformation -- and even if this is
somehow (crazy) possible, the code would be a torture to read,
understand and maintain.

For sure. But you can also use fn:transform() to replace modes in some
cases, and turn mode management into file management :)

Liam

--
Liam Quin, https://www.delightfulcomputing.com/
Available for XML/Document/Information Architecture/XSLT/
XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.
Barefoot Web-slave, antique illustrations:  http://www.fromoldbooks.org


--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--
<Prev in Thread] Current Thread [Next in Thread>