W3C home > Mailing lists > Public > xproc-dev@w3.org > July 2020

Re: QName magic on map { 'serialization' : map { 'indent' : true() } }?

From: Achim Berndzen <achim.berndzen@xml-project.com>
Date: Sat, 4 Jul 2020 19:23:06 +0200
Cc: xproc-dev@w3.org
Message-Id: <896916A5-353C-4570-90E8-E6C020AADB8F@xml-project.com>
To: Martin Honnen <martin.honnen@gmx.de>
> I was wondering whether QName "magic" should be applied or at least
> would be desirable for using
>   <p:inline content-type="application/xml" document-properties="map {
> 'serialization' : map { 'indent' : true() } }">
> Morgana seems to provide the magic for the 'serialization' key of the
> outer map but not for the 'indent' key of the inner map so to have
> indentation set up I need to write
> <p:inline content-type="application/xml" document-properties="map {
> 'serialization' : map { QName('', 'indent') : true() } }">
> I think the spec only talks about the rules for maps without requiring
> any recursion on the rule to convert a string key to an xs:QName key in
> any outher map values so I think Morgana's behaviour is according to the
> spec.
> But for a pipeline author the QName magic would come in handy if it were
> also applied for the 'indent' key of the inner 'serialization' map in
> the example or for the keys of the 'serialization` map in general.
> Was that ever considered?

(a) I think MorganaXProc-IIIse does what the specs (https://spec.xproc.org/master/head/xproc/#qname-handling)
says: "As an additional convenience, if the specified sequence type of an option or a variable
 is a map with xs:QName keys (map(xs:QName, …)), the supplied map value is processed specially."

This to my reading makes it clear, that the QName magic is only applied to options (and variables) with the respective type, not to 
any map in the map.

(b) I do not see how you want to tell the processor that somewhere in the sub- sub-structure of your map you have a QName->value map.

Attribute "document-property" is defined as "map(xs:QName,item()*)" and you are on purpose able to put arbitrary values into it. How do you want to tell the processor, that one of these values is a map where QName-magic should happen?

In the long run I think this is more a use case for a user defined function, isn't it?
Received on Saturday, 4 July 2020 17:23:22 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 4 July 2020 17:23:23 UTC