I'm still in the early stages of understanding and learning to use XBL components. I am experimenting with using a stylesheet to generate an HTML "report" on the contents of a node in the main instance (putting aside for now the issue of updating it if that node changes). I can get the stylesheet to run and generate the HTML without any values in it, but I'm still trying to understand how to get the data to the stylesheet. I looked at the "XForm Sandbox" example "xbl-xslt.xhtml", which does run in my application. That example uses an xform repeat inside the custom tag, and in the stylesheet has a template with a match referring to the custom tag, so I assume that's how the stylesheet gets its data.
I don't want it to generate any XForm markup, just HTML. On the XBL binding, I am using xxbl:mode="binding"
as an attribute. I would like to just put a ref
attribute on the custom tag, but I can't figure out how to pass the data to the stylesheet. (Currently in my stylesheet, everything is under a <xsl:template match="/">
element.)
I noticed the "alternate table" example has this:
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:if test="/*">
<xsl:attribute name="xxbl:scope">outer</xsl:attribute>
</xsl:if>
<xsl:apply-templates select="@*[not(name() = ('style1', 'style2'))]|node()"/>
</xsl:copy>
</xsl:template>
and this:
<xsl:template match="foo:table-alternate">
<xh:table>
<xsl:apply-templates select="@*|node()"/>
</xh:table>
</xsl:template>
I imagine are the keys to this working, but how could I simply add a ref
attribute on the custom tag of my xbl and have this work? I have been looking through the Orbeon documentation, the "sandbox" examples, and elsewhere, but I probably am still misunderstanding some basic principles of XBL components. Can anyone point me in the right direction?