RE: [xsl] matching input value to a node

Subject: RE: [xsl] matching input value to a node
From: "John Wang" <jwang@xxxxxxxxxxx>
Date: Mon, 30 Apr 2001 16:48:36 -0500
Try this please, see if it is what you want to do.
here is the xml:

<?xml version="1.0"?>
	<field>Org 1</field>
	<field>Org 2</field>
	<field>Org 3</field>
	<field>Org 4</field>
	<field>Org 5</field>

here is the xsl:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
	<xsl:output method="html"/>
	<xsl:template match="/root">
		<xsl:variable name="sel">Org 2</xsl:variable>
				<select name="request" size="1">
					<xsl:for-each select="field">
								<xsl:when test="node()=$sel">
									<xsl:attribute name="selected"/>
							<xsl:value-of select="."/>

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of
Sent: Sunday, April 29, 2001 1:06 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] matching input value to a node

My xml is as follows:
                <orgType>Org 2</orgType>

In my xsl I am trying to:

1. set the value of a html text box to the value of  a node:

e.g. <td bgcolor="#FFFFFF">
            <input size="55" name="orgname" type="text" maxlength="200"
value=<xsl:value-of select="organisation"/>> </input> <!-- here is the
This obviously does not work.

2. From a drop down list /menu - I want to ensure that the top value
displayed is equal to the node.
 <select name="droptypeoforg">
                              <option value="org 1"> Org 1</option>
                              <option value="org 2">Org 2</option>
                             <option value="other">Other (specify)</option>

So that the <xsl:value-of select="orgType"/> e.g Org 2 in xml, would be
highlighted (or top of the list)

Can someone help?


 XSL-List info and archive:

 XSL-List info and archive:

Current Thread