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 Sunday, 8 October 2017 14:20:35 UTC