Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I didn't test it, but i think it should be possible by breaking the encapsulation. Without this, your XBL will only have access to the content of the bound node, as in your third code snippet. If you want to make the XBL access the XForms instance data, you will have to declare a <a href="http://wiki.orbeon.com/forms/doc/developer-guide/xbl-components-guide#TOC-Creating-a-single-node-binding" rel="nofollow" title="Orbeoon Wiki | XBL - single node binding">variable inside the XBL that's pointing to the single-node binding of the bound node</a>.</p> <p>Here's the code snippet from the Wiki example:</p> <pre><code>&lt;xforms:group xbl:attr="model context ref bind" xxbl:scope="outer"&gt; &lt;xforms:group xxbl:scope="inner"&gt; &lt;!-- Variable pointing to external single-node binding --&gt; &lt;xxforms:variable name="binding" as="node()?"&gt; &lt;xxforms:sequence select="." xxbl:scope="outer"/&gt; &lt;/xxforms:variable&gt; ... &lt;/xforms:group&gt; &lt;/xforms:group&gt; </code></pre> <p>Having defined the single-node binding like this, it should be possible to reference that variable and use it for xslt transformation. Just replace the XSLT template element matching the root node and point it to the content of the variable <code>$binding</code>:</p> <pre><code>&lt;xsl:transform version="2.0"&gt; &lt;xsl:template match="@*|node()" priority="-100"&gt; &lt;xsl:apply-templates select="@*|node()"/&gt; &lt;/xsl:template&gt; &lt;xsl:template match="text()" priority="-100" mode="in-paragraph"&gt; &lt;xsl:copy&gt; &lt;xsl:value-of select="."/&gt; &lt;/xsl:copy&gt; &lt;/xsl:template&gt; &lt;xsl:template match="OCem" mode="in-paragraph"&gt; &lt;x:i&gt;&lt;xsl:value-of select="."/&gt;&lt;/x:i&gt; &lt;/xsl:template&gt; &lt;xsl:template match="OCp"&gt; &lt;x:div&gt; &lt;xsl:apply-templates mode="in-paragraph"/&gt; &lt;/x:div&gt; &lt;/xsl:template&gt; &lt;xsl:template match="oc:instructionitem"&gt; &lt;xforms:group ref="$binding"&gt; &lt;x:div contentEditable="true"&gt; &lt;xsl:apply-templates/&gt; &lt;/x:div&gt; &lt;/xforms:group&gt; &lt;/xsl:template&gt; </code></pre> <p>Hope this works for you. Maybe this requires making provisions if the bound node (in your example: <code>oc:instructionitem</code>) isn't empty, so the xslt may process both that content as well as the content of the <code>$binding</code> variable.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload