Re: XInclude questions--copying attributes

On 2012-06-13 11:20, John Cowan wrote:
> Norman Walsh scripsit:
>
>> 2. What attributes should be copied from the XInclude element to the
>>     root(s) of the included content?
>>
>>     a. all of them
>>     b. all except href, parse, xml:base, and xml:lang
>>     c. only namespace qualified attributes
>>     d. only non-namespace-qualified attributes
>>     e. the attributes to be copied could be explicitly enumerated in
>>     a new attribute
> I'm for 2c, which would include the xml:* attributes.  Non-namespaced
> attributes are reserved for XInclude, so they are part of the machinery
> and shouldn't be copied.


+1


>
> However, this raises two subsidiary questions:
>
> 2.1) What happens to xml:id when there are multiple roots?  4.5.3 says
> nothing about how to fix up ID attributes, only IDREF(S) attributes.


In our requirements document, we basically gave up on handling
inclusions that consist of top-level nodes other than elements.

Given that, I suggest we have several options for multiple
rooted inclusions:

1.  give up on any attribute copying unless the inclusion
     is single-rooted.

2.  do all attribute copying to all top-level elements in
     the inclusion and let the application deal with multiple
     identical xml:id's.

3.  do all attribute copying to all top-level elements in the
     inclusion except if there is more than one top-level element:
   a.  don't copy xml:id to any of them
   b.  only copy xml:id to the first in document order

I suppose a 4th is to define some id fixup, but I'm not even
going to suggest that, as I think the conclusion in our req doc
was "that there is no single strategy that would satisfy all
authors all the time" and that we would let the post-xinclude
application deal with id fixup.

I lean toward #2 above.


>
> 2.2) What happens if the xinclude element and the included root(s) both
> have a given attribute?  I'd say the included root wins, so the copiable
> attributes on the xinclude element are just defaults.

I'm not sure what all the use cases might be, so I'm not sure
if there is a single right answer here, but I think I'm fine
with letting the root attributes win.


paul

Received on Wednesday, 13 June 2012 21:12:24 UTC