Search code examples
orbeonxforms

xf:submission: Populate Header Value From Current Context


I'm wanting to populate the header in a xf:submission with a value from the current context. Documentation says that an xpath expression can be used but doesn't provide any examples.

I've tried using xsl:value, seen below, but that doesn't populate anything. Is that the correct syntax to populate xf:value?

<p:for-each href="#attachments" select="//attachment" root="attachments" id="post-document-pages">
    <p:processor name="oxf:xforms-submission">
        <p:input name="submission">
            <xf:submission 
                method="post" 
                resource="http://localhost:8080/is/document/{@documentId}/page" 
                serialization="application/octet-stream">
                <xf:header>
                    <xf:name>Resource-Name</xf:name>
                    <xf:value>
                        <xsl:value-of select="@filename" />
                    </xf:value>
                </xf:header>
            </xf:submission>
        </p:input>
        <p:input name="request"  href="current()" />
        <p:output name="response" ref="post-document-pages" /> 
    </p:processor>


Solution

  • Inside the <xf:header>, simply use:

    <xf:value value="[your XForms expression here]"/>