[xsl] Re: Question about Section 2.7 "Packages and Modules" of the XSLT 3.0 second Last Call

Subject: [xsl] Re: Question about Section 2.7 "Packages and Modules" of the XSLT 3.0 second Last Call
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 13 Oct 2014 08:57:13 -0000
Let's suppose you have a utility library package wordwrap.xsl that does
wordwrap and hyphenation.

Let's suppose you have a customization of this called french-wordwrap.xsl that
does French hyphenation, and another called german-wordwrap.xsl that does
German hyphenation. By "customization" here I mean a package that does
xsl:use-package to incorporate wordwrap.xsl, and then uses xsl:override to
modify some of its functions, templates, or variables, or to fix the value of
stylesheet parameters.

Now suppose you have an application that wants to use both french-wordwrap.xsl
and german-wordwrap.xsl, for formatting different parts of the same document.
You can do so, simplly by doing an xsl:use-package on both these packages. The
two packages don't interfere with each other provide they don't expose any
conflicting components (e.g. public functions with the same name). If they do
expose conflicting components, you can solve the problem either by reducing
the number of components you accept from these libraries using xsl:accept, or
if necessary by wrapping french-wordwrap.xsl and german-wordwrap.xsl in
another layer of package that effectively exposes their public functionality
under different names.

Michael Kay
Saxonica
mike@xxxxxxxxxxxx
+44 (0) 118 946 5893




On 12 Oct 2014, at 19:22, Dimitre Novatchev <dnovatchev@xxxxxxxxx> wrote:

> Hi,
>
> I am reading the freshly published second Last Call of XSLT 3.0  --
> Section 2.7 "Packages and Modules":
> http://www.w3.org/TR/2014/WD-xslt-30-20141002/#packages-and-modules
>
> The bulleted list that details the ways packages (unlike modules)
> achieve the goal of allowing separate compilation, has this bullet:
>
>  Allow multiple specializations of library components to coexist in
> the same application.
>
> It isn't immediately clear to me what exactly what is meant by
> "multiple specializations of library components" and what
> elements/attributes need to be used in order to define such multiple
> specializations of library components. Where in the following sections
> is this detailed?
>
> I would greatly appreciate if someone, such as the Editor -- Dr. Kay
> himself -- could explain what this bullet means.
>
>
> --
> Cheers,
> Dimitre Novatchev

Current Thread