Hello,
I basically have a XML and XSL file and form and HTML. It will be much easier to explain if you wouldn't mind taking the time to copy and paste the HTML at the bottom into this editor:
http://w3schools.com/html/tryit.asp?...ml_form_submit. As you will see I have two buttons next to the bottom two text input fields. What I would like to be able to do is if you hover or click on the button it would show the actually values of the referenced values inside the text field.
Example:
If the input text field contained:
$FIRST_NAME/$MIDDLE_NAME/$LAST_NAME
When you hover or click it would show:
$FIRST_NAME = John
$MIDDLE_NAME = Alan
$LAST_NAME = Doe
Example:
If the input text field contained:
$STREET_NAME_street
When you hover or click it would show:
$STREET_NAME = West Drive
I know in the example you can see the values right above, but this is a simple scenario that I made up. If you had a much large XML file it would be very useful to see what the values represented. I hope that this makes some sense, if not please let me know and I will try and explain things a bit more clear. I thought that Javascript might be the way to do this, but I wasn't sure.
Thanks,
Matt
****XML File*****
Code:
<People>
<Person>
<Name id="$FIRST_NAME">John</Name>
<Name id="$MIDDLE_NAME">Alan</Name>
<Name id="$LAST_NAME">Doe</Name>
<Street id="$STREET_NAME">West Drive</Street>
</Person>
<Ids>
<Id id="FullName">$FIRST_NAME/$MIDDLE_NAME/$LASTNAME</Id>
<Id id="Location">$STREET_NAME_street</Id>
</Ids>
</People>
*********XSL File**********
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<script type="text/javascript">
//NEED HELP HERE
</script>
</head>
<body>
<table>
<xsl:for-each select="//People/Person/Name">
<tr>
<td><xsl:value-of select="@id"/>: </td>
<td>
<input type="text" size="45">
<xsl:attribute name="id">
<xsl:value-of select="@id"/>
</xsl:attribute>
<xsl:attribute name="name">
<xsl:value-of select="@id"/>
</xsl:attribute>
<xsl:attribute name="value">
<xsl:value-of select="text()"/>
</xsl:attribute>
</input>
</td>
</tr>
</xsl:for-each>
<xsl:for-each select="//Ids/Id">
<tr>
<td><xsl:value-of select="@id"/>:
</td>
<td>
<input type="text" size="45">
<xsl:attribute name="id">
<xsl:value-of select="@id"/>
</xsl:attribute>
<xsl:attribute name="name">
<xsl:value-of select="@id"/>
</xsl:attribute>
<xsl:attribute name="value">
<xsl:value-of select="text()"/>
</xsl:attribute>
</input>
</td>
<td>
<input type="button" value="hint"/>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
*********HTML*********************
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<head>
<script type="text/javascript">
//NEED HELP HERE
</script>
</head>
<body>
<table>
<tr>
<td>$FIRST_NAME: </td>
<td><input type="text" size="45" id="$FIRST_NAME" name="$FIRST_NAME" value="John"/></td>
</tr>
<tr>
<td>$MIDDLE_NAME: </td>
<td><input type="text" size="45" id="$MIDDLE_NAME" name="$MIDDLE_NAME" value="Alan"/></td>
</tr>
<tr><td>$LAST_NAME: </td>
<td><input type="text" size="45" id="$LAST_NAME" name="$LAST_NAME" value="Doe"/></td>
</tr>
<tr>
<td>FullName: </td>
<td><input type="text" size="45" id="FullName" name="FullName" value="$FIRST_NAME/$MIDDLE_NAME_$LASTNAME"/></td>
<td><input type="button" value="hint"/></td></tr>
<tr>
<td>Location: </td>
<td><input type="text" size="45" id="Location" name="Location" value="$STREET_NAME_street"/></td>
<td><input type="button" value="hint"/>
</td>
</tr>
</table>
</body>
</html>