【问题标题】:Dropdownlist not displaying content but white blanks XSLT下拉列表不显示内容但白色空白 XSLT
【发布时间】:2017-08-05 18:30:46
【问题描述】:

好的,所以我设法使用 html select 创建了一个下拉列表,但问题是,除了白色空白选项之外,它没有显示任何内容。选项的数量和我准备的完全一样,只是我在下拉列表中看不到它的内容。

这是我的 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>

【问题讨论】:

    标签: c# asp.net xml xslt


    【解决方案1】:

    尝试删除 '.'选择器如here 所述,选择当前节点的方式与 .选择文件系统路径中的当前文件夹。

    尝试使用

    <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>
    

    【讨论】:

    • 我改变了一些东西。请查看我最初的帖子。
    猜你喜欢
    • 2011-08-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多