xproc / 1.0-specification

The 1.0 XProc specification and now abandoned drafts of a 2.0 XML specification
12 stars 6 forks source link

Consider adding URI/prefix alternatives for p:xslt’s initial-mode and template-name options #155

Open gimsieke opened 9 years ago

gimsieke commented 9 years ago

Elements, such as p:add-attribute or p:wrap-sequence, that potentially create new namespace bindings provide two alternative ways for providing an element, attribute, … name:

  1. QName
  2. prefix and namespace URI

We use a step, letex:xslt-mode, that accepts the initial mode dynamically. The mode names in our XSLT stylesheets are often prefixed. Right now, we have to declare the mode name bindings for every stylesheet that may be supplied to the in letex:xslt-mode’s step declaration. This makes it less versatile and universal than we would wish.

A solution may be if p:xslt accepted the additional non-required options template-name-prefix, template-name-uri, initial-mode-prefix, and initial-mode-uri.

Another solution may be to look into the provided stylesheet’s top-level element and to use the namespace bindings that are declared there (with precedence for bindings declared in the XProc document). I don’t know whether this approach is in line with the general concepts for namespace handling. It feels a bit ad-hoc.

ndw commented 9 years ago

We think that this problem can be addressed by changing the type of initial-mode (and other QName-typed attributes) to EQName, then the literal "Q{http://example.com/}name" can be used. That can be constructed dynamically without an in-scope namespace binding.

gimsieke commented 9 years ago

perfect