下拉列表不显示内容,而是白色空白XSLT



好的,所以我设法使用html选择创建了一个下拉列表,但是事实是,除了白色空白选项外,它没有显示任何内容。选项的数量与我准备的完全相同,它只是我无法在下拉列表上看到它的内容。

这是我的XML

  <group name="Housing Type">
  <field is_admin_field="N" required="Y">
    <question_title>Which of the housing type best describes your residential?</question_title>
    <type>List</type>
    <db_field_name>which_of_the_housing_type_best_describes_your_residential</db_field_name>
    <options>
      <item score="0">3 - 5 room HDB</item>
      <item score="0">Executive Condominium </item>
      <item score="0">Landed 1 Floor</item>
      <item score="0">Landed 2 Floor</item>
      <item score="0">Landed 3 Floor</item>
      <item score="0">Landed 4 Floor</item>
      <item score="0">Landed 5 Floor</item>
    </options>
    <db_field_length>22</db_field_length>
    <additional_comment/>
  </field>
</group>

这是我的XSLT。编辑:现在,我只能看到一个选项。

  <xsl:if test="$type='List'">

        <select>
          <xsl:for-each select="./options">
          <option >
            <xsl:value-of select="item"/>
          </option>
          </xsl:for-each>
        </select>

    </xsl:if>

尝试删除'。如下所述,选择器选择当前节点的方式几乎相同。在文件系统路径中选择当前文件夹。

尝试使用

<xsl:if test="$type='List'">
  <xsl:for-each select="options">
    <select>
      <xsl:for-each select="item">
      <option >
        <xsl:value-of select="item"/>
      </option>
      </xsl:for-each>
    </select>

  </xsl:for-each>
</xsl:if>

最新更新