RE: document-properties() / p:document-property()

I'm in favor, it makes using the properties easier without cluttering the language too much, which is good.

Erik

> -----Oorspronkelijk bericht-----
> Van: Norman Walsh [mailto:ndw@nwalsh.com]
> Verzonden: zondag 8 oktober 2017 16:20
> Aan: XProc Dev <xproc-dev@w3.org>
> Onderwerp: p:document-properties() / p:document-property()
> 
> Hi,
> 
> The spec currently says that p:document-properties() returns the document
> properties as a map. I think it should also be possible to get them as an XML
> document.
> 
> I propose:
> 
>   p:document-properties($doc as document-node()) as map(xs:QName,
> item())
> 
> and
> 
>   p:document-properties-document($doc as document-node()) as document-
> node()
> 
> (Suggestions for better names gratefully accepted; note that I’ve explicitly
> avoided the “use a second argument that identifies the type” solution
> because I think it’s convenient to have a return type that’s more explicit
> than item(). But I could be wrong.)
> 
> I’m also proposing:
> 
>   p:document-property($doc as document-node(), $key as xs:QName) as
> item()
> 
> which returns the value of the $key key in the map, if there is one.
> It returns the empty sequence if the key does not exist.
> 
> I think p:document-property(., 'content-type') is simpler and more direct
> than map:get(p:document-properties(.), 'content-type') or p:document-
> properties-document(.)/content-type.
> 
> Thoughts?
> 
>                                         Be seeing you,
>                                           norm
> 
> --
> Norman Walsh
> Lead Engineer
> MarkLogic Corporation
> Phone: +1 512 761 6676
> www.marklogic.com

Received on Monday, 9 October 2017 06:05:52 UTC