This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: can we use html objects in xsl


> lets say we have a xml like
> <groupinfo >
> <name > users </name>
> <ids> <id> 111</id>
>     <id > 222</id>
> <id> 333<i/d >
> </ids>
> </groupinfo>
>
> I want the html ouptut like
> 
> <input = text , name = "name" value = "user">
> <select name = id>
> <option value = 111>111
> <option value = 222>222
> <option value = 333>333
> </select>

Use xsl:output method="html" and this template:

<xsl:template match="groupinfo">
  <input type="text" name="name" value="{normalize-space(name)}"/>
  <select name="id">
    <xsl:for-each select="ids/id">
      <option value="normalize-space()">
        <xsl:value-of select="normalize-space()"/>
      </option>
    </xsl:for-each>
  </select>
</xsl:template>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]