Re: XProc Minutes 31 Jan 2008

Hi,

Looking at the minutes, the need for excluding namespaces became clearer 
to me:

Norman Walsh wrote:
> See http://www.w3.org/XML/XProc/2008/01/31-minutes
[snip]
>   Last Call Comments
> 
>    -> http://www.w3.org/XML/XProc/2007/09/lastcall/comments.html
> 
>    Comment 100: cherry picked items
> 
>    Should we add exclude-prefixes to serialization?
[snip]
>    Richard: I'm not sure I understand the issue.
>    ... In XSLT, exclude-result-prefixes is only about literal result elements
>    in the stylesheet.
> 
>    Norm: Ok, so is there anything comparable?
> 
>    Ricahrd: If the pipeline itself binds some prefixes, then they're in scope
>    for literal elements in it.
> 
>    Henry: Like an inline document.
> 
>    Some discussion of what the namespace bindings are for an inline document
> 
>    Alex: You could do this with a new step.
> 
>    Norm: I don't think we want to add this to serialization and I don't thnk
>    we need to do it for any other reason.
> 
>    Henry: Someone is free to create a simplify-namespace step and we can
>    adopt it for V.next if it's widely supported.
> 
>    Proposed: No, we aren't going to add anything for exclude-prefixes
> 
>    Accepted.

I agree that we don't want to add this to serialization; the equivalent 
in XSLT (exclude-result-prefixes) isn't a serialization option, it's 
about what namespaces are included when a literal result element is created.

I think it would be kind to provide a similar method to exclude 
namespaces from the document generated by <p:inline>. There are going to 
be a lot of namespaces floating around within a pipeline which won't be 
relevant in the documents you create.

Although we could punt to extension steps that others write, namespaces 
cause such problems generally, I think we should make namespace handling 
as straight-forward as possible.

---
Proposal 1:

When a document is created using <p:inline>, each element node in the 
document will have a copy of the namespace nodes from the original 
element in the pipeline document with the exception of certain excluded 
namespaces. These namespaces are:

(Version A: Least change)

   * The XProc namespace ...
   * Any namespace whose prefix is listed as an ignored namespace with 
an ignore-prefixes attribute

(Version B: Similar to XSLT)

   * The XProc namespace ...
   * Any namespace whose prefix is listed as an extension namespace with 
an extension-prefixes attribute
   * Any namespace whose prefix is listed as an excluded namespace with 
an exclude-inline-prefixes attribute

(Version C: Simplest)

   * All namespaces except those listed in the include-prefixes 
attribute on the <p:inline> element

Note that the resulting element node will always have a namespace node 
for its own namespace, and for the namespaces of its ancestors in the 
resulting document, even if these namespaces would otherwise be excluded.

---

Version A doesn't require any changes to the syntax, just a bit of 
rewording as above in the description of <p:inline>.

Version B renames ignore-prefixes to extension-prefixes (which I think 
better describes what it does) and introduces a new 
exclude-inline-prefixes attribute.

Version C adds an attribute to <p:inline> that works by *including* the 
listed namespaces rather than excluding them

I think C is probably best.

Cheers,

Jeni
-- 
Jeni Tennison
http://www.jenitennison.com

Received on Saturday, 2 February 2008 13:40:19 UTC