Hi,

I am having problems specifying the nodeset attribute of the
xforms:itemset element. I would really appreciate it if you could tell me
what am I doing wrong here.

Here is a simple form instance document

--- cut here ---
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<xforms:model xmlns:xforms="http://www.w3.org/2002/xforms";
  xmlns:xxforms="http://orbeon.org/oxf/xml/xforms";
  xmlns:oxf="http://www.orbeon.com/oxf/processors";
  xmlns:p="http://www.orbeon.com/oxf/pipeline";>
  <xforms:instance>
    <form name="sample">
      <category name="Baseball" weight="50">
        <description/>
        <question>
          <text>Who won the world series?</text>
          <option weight="50">The Red Sox</option>
          <option weight="0">The Cardinals</option>
          <comment/>
          <selected/>
        </question>
        <question>
          <text>What is Beantown?</text>
          <option weight="25">Boston</option>
          <option weight="50">The Hub</option>
          <option weight="0">Dunno</option>
          <comment/>
          <selected/>
        </question>
      </category>
      <category name="Football" weight="50">
        <description/>
        <question>
          <text>Who won the Superbowl this Year?</text>
          <option weight="50">The Patriots</option>
          <option weight="0">The Panthers</option>
          <comment/>
          <selected/>
        </question>
        <question>
          <text>Where is Gilette Stadium</text>
          <option weight="25">In New England</option>
          <option weight="50">Foxboro Massachusetts</option>
          <option weight="0">Dunno</option>
          <comment/>
          <selected/>
        </question>
      </category>
      <action/>
    </form>
  </xforms:instance>
  <xforms:submission method="post"/>
</xforms:model>
--- cut here ---

And here is the view stylesheet

--- cut here ---
<?xml version="1.0" encoding="UTF-8"?>
<xhtml:html xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
  xsl:version="2.0" xmlns:xhtml="http://www.w3.org/1999/xhtml";>
  <xhtml:head>
    <xhtml:title>XForms eVAL</xhtml:title>
  </xhtml:head>
  <xhtml:body>
    <xforms:group ref="form"
      xmlns:xforms="http://www.w3.org/2002/xforms";>
      <p> Form <b>
          <xsl:value-of select="/form/@name"/>
        </b>
      </p>
      <xforms:repeat nodeset="category" id="categorySet">
        <p>
          <i>Category </i>
          <xforms:output ref="@name"/>
        </p>
        <table>
          <xforms:repeat nodeset="question" id="questionSet">
            <tr>
              <td colspan="4">
                <xforms:output ref="text"/>
              </td>
            </tr>
            <tr>
              <td width="10"/>
              <td>
                <xforms:select1 ref="selected" appearance="full">
                  <xforms:label>Choose Answer</xforms:label>
    <!-- HERE --> <xforms:itemset nodeset="../option">
                    <xforms:label ref="."/>
                    <xforms:value ref="@weight"/>
                  </xforms:itemset>
                </xforms:select1>
              </td>
            </tr>
          </xforms:repeat>
        </table>
      </xforms:repeat>
    </xforms:group>
  </xhtml:body>
</xhtml:html>
--- cut here ---

With this nodeset specification I get the following exception message:

Expression '/form/category[1]/question[1]/option' must return an element
or an attribute

I find this strange because it is valid xpath

I tried specifying the nodeset attribute with various permutations of
Xpath expressions to no avail.

Thank you in advance for shedding some light on the matter.

Ciao
Stefano



-------------------------------------------------------
This Newsletter Sponsored by: Macrovision
For reliable Linux application installations, use the industry's leading
setup authoring tool, InstallShield X. Learn more and evaluate
today. http://clk.atdmt.com/MSI/go/ins0030000001msi/direct/01/
_______________________________________________
orbeon-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/orbeon-user

Reply via email to