Hi,

I’ve got an issue with calculated submissions using <xf:resource/> in 1.0RC2

I’ve got a control instance with a case element. This gets set in a select1 to 
what case I want.
I’ve a submission to get this case and put the results in the case_record 
instance:


<!— Instance to hold the case —>
<xf:instance id="case_record" xmlns="">
        <data></data>   
</xf:instance>  

<!— Instance to control bits of the form —>     
<xf:instance id=“control" xmlns="">
        <data>
               <case>A100000</case>
               <qstatus>OK</qstatus>
            </data>
</xf:instance>
        
<xf:submission id="getcase" 
        method="get" replace="instance" instance="case_record"
        omit-xml-declaration="yes" >
        <xf:resource 
value="concat('v1/documents?uri=/cases/',instance(‘control')/case,'/case.xml')"/>
 
</xf:submission>

If I run this it works the first time, however the second time, it sends the 
calculated uri, *plus* every element now in the case_record (actually what ever 
is the first instance in the form). I can get around that, by creating a dummy 
instance at the top of my form that’s empty, i.e. 
<xf:instance><data/></xf:instance> but that seems a little messy.

I’ve also found that adding an action attribute with the base of my uri works 
as well:

<xf:submission id="getcase" action="v1/documents"
                method="get" replace="instance" instance="case_record"
                omit-xml-declaration="yes" >
        <xf:resource 
value="concat('v1/documents?uri=/cases/',instance(‘control')/case,'/case.xml')"/>
 
</xf:submission> 

My question should I be able to create a submission with just a <xf:resource> 
in it, without a ref/action/resource attribute?

Thanks,

Mark Lawson
Senior Technical Architect
Staffordshire and West Midlands 
Community Rehabilitation Company
[email protected]
[sent from home email]



------------------------------------------------------------------------------
_______________________________________________
Xsltforms-support mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xsltforms-support

Reply via email to