سؤال

I'm working on a project to generate electronic surveys in XForms from questionnaire metadata. While I have been able to create the XForms easy enough, that conform to the XForms spec I am having trouble running the form through Orbeon.

The form I am trying to run through Orbeon is here: https://gist.github.com/3850705#file_dogsurvey.xhtml

I've been able to test this form using XSLTForms and it runs perfectly fine, however when I attempt to run it through Orbeon none of the question text shows up, and it doesn't even exist in the HTML source being presented to the user, as shown here: https://gist.github.com/3850705#file_orbeon_source.html

So, Orbeon is doing some sort of translation of the original form (which is to be expected) and I'm guessing, based on their examples that its selecting text based on some language information, however, for the life of me I can't figure out how to get the xf:label text to appear on the form.

Can anyone help?

هل كانت مفيدة؟

المحلول

You might want to have a look at the orbeon.log as you run the form. I have seen the following two problems:

  1. As I am trying to run this here, I am first getting errors because of xf:bind like this one:

    <xf:bind id="bindThen-DogSurvey_IF_2"
             nodeset="//rml:if[@id='DogSurvey_IF_2']/rml:then"
             relevant="//rml:response[@id='DogSurvey_QC_30'] = '1'"
             readonly="not(//rml:response[@id='DogSurvey_QC_30'] = '1')"/>
    

    If the element doesn't contain a number, for instance because it is empty, that expression will fail to evaluate, as the XPath engine attempts to convert an empty string to a number. So unless you are absolutely sure that the value will always be a number (which doesn't seem to be the case here), it is safer to write … = '1', thus doing a string comparison. If you really want to do comparison between integers, you could write //rml:response[@id='DogSurvey_QC_30']/(. castable as xs:integer and . = 1).

  2. After changing the code for #1 above, with the latest code, I am also getting an exception, which looks like a bug, so I filled an bug report, but you might not hit this if you are using the 3.9 release.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top