Re: New draft of XInclude 1.1

Jirka Kosek <jirka@kosek.cz> writes:
> It seems useful and easy to solve such use-case by providing special
> XInclude related namespace which will allow copying of local attributes.
> We can say that attributes in namepsace
> "http://www.w3.org/2001/XInclude-copy-as-local-attribute" are copied but
> namespace is removed.
>
> So above example can be written as
>
> <xi:include href="docbook.fragment.xml" xia:condition="print"
> xmlns:xia="http://www.w3.org/2001/XInclude-copy-as-local-attribute"/>
>
> Advantage is that there is no need for additional post-processing and
> correction of attribute names.

I wish I had a better sense for what percentage of scenarios will
require post-processing. If 90% of the time, some post processing will
be required anyway, then it seems like a lot of complexity for little
benefit. OTOH, if this feature would eliminate a significant portion
of the post-processing cases, maybe it's worth it.

I observe that doing any kind of IDREF fixup requires post processing
so it seems like you'll usually be doing some post processing.

Of course, even if you're doing some sort of post processing anyway,
requiring everyone to makeup their own
"copy-these-attributes-into-no-namespace" rules seems a bit
inconvenient. No reason for DocBook users to do it one way and DITA
users to do it another, for example.

And most vocabularies put most attributes in no namespace, so I think
an argument can be made for providing a feature to set them.

> I think that if we are going to do another LC anyway we might consider
> adding this feature into spec as well. It's quite coherent with recent
> set-xml-id functionality -- if we allow direct modification of xml:id
> during inclusion, we should allow modification of local attributes as
> well. We should support removal of attribute by specifying empty value
> as well.

Yes, when the semantics were just "copy everything", I think I would
have been marginally opposed to adding more special semantics for the
non-namespaced attributes. But now that we have set-xml-id, I guess
we've opened the door for more complexity.

We could:

1. Do as Jirka suggests and say that attributes in the xia: namespace
   are copied with an absent namespace prefix and namespace URI.

2. We could use the xi: namespace for this purpose.

3. We could add a copy-without-namespaces attribute that enumerated
   the namespace(s) to use for this purpose on a per-xi:include basis.

I don't think we need the complexity of 3. I suppose 1 is marginally
simpler though it does require declaring another namespace.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh
Lead Engineer
MarkLogic Corporation
Phone: +1 512 761 6676
www.marklogic.com

Received on Monday, 24 November 2014 16:02:56 UTC