How can I input an xml-instance from persistancy into an XForm for editing?
Is this a case when it is necessary to use the “oxf/processors/xforms-input” processor?
Greg, the form elements sent to the end user are populated with the content of the instance. If you want to display default values, just pre-populate the instance in the XForms model.
If the default values come from a database (or are dynamically generated somehow), just change your XForms model from an XML file to an XPL file, create the XForms model in XPL and connect it to the "data" output of the XPL. As an illustration, I have attached a sample XPL file that pre-populates the credit card number with a random 16 digit number.
Alex
<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline">
<p:param name="data" type="output"/>
<p:processor uri="oxf/processor/xslt">
<p:input name="data"><dummy/></p:input>
<p:input name="config">
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:math="http://exslt.org/math">
<xsl:template match="/">
<xforms:model schema="oxf:/credit-card/schema.rng"
xmlns:xforms="http://www.w3.org/2002/xforms">
<xforms:instance>
<credit-card-info>
<number>
<xsl:value-of
select="substring(concat(math:random(), '0000000000000000'), 3, 16)"/>
</number>
<type>visa</type>
<expiration-date/>
</credit-card-info>
</xforms:instance>
<xforms:submission method="post"/>
</xforms:model>
</xsl:template>
</xsl:stylesheet>
</p:input>
<p:output name="data" ref="data" debug="gaga"/>
</p:processor>
</p:config>
_______________________________________________ oxf-users mailing list [EMAIL PROTECTED] http://mail.orbeon.com/mailman/listinfo/oxf-users
