What about that document-properties attribute?

Consider this pipeline fragment:

  <p:inline document-properties="{
     map {{ 'content-type': 'image/svg+xml',
            'color-space': 'cmyk'
         }} }”>
    <svg:svg>…</svg:svg>
  </p:inline>

The document-properties value must be a map. The only representation
of a map in a string is a map constructor. Map constructors use curly
braces. The only way to get an expression in a string is with an AVT.
And AVTs also use braces.

Given that document properties *has* to be a map, I wonder if we
should assert, like we do with @select on p:with-option, that it’s
always an XPath expression.

I don’t really like it because it means there are three kinds of
attributes: attributes that are always and only strings (@name),
attributes that are AVTs (@href and many others), and attributes that
are always expressions (@document-properties, @select).

On the other hand, I don’t like the fact that every literal expression
of a map in document-properties is always going to have all those
annoying double-escaped braces.

                                        Be seeing you,
                                          norm

P.S. Note that using p:with-option/@select here isn’t an, uh, option,
because p:inline isn’t a step.

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

Received on Thursday, 7 September 2017 13:56:42 UTC