Slightly OT XSTL StyleSheet for html form
| From: | Geoff Hankerson | Date: | Tue, 06 Aug 2002 19:09:34 +0000 |
| Subject: | Slightly OT XSTL StyleSheet for html form | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-111419@lists.php.net to get a copy of this message | ||
Not really a direct php question but I am trying to build an XSLT stlyeshet
to convert an xml file (or string) into an html form to allow editing.
Given this (simplified) xml:
<customer>
<CustomerID>78952157</CustomerID>
<FirstName>John</FirstName>
<MiddleInit />
<LastName>Doe</LastName>
<Firm>Doe& Doe, P.A.</Firm>
</customer>
I want to convert to this to the following html
<form>
<table WIDTH="662" BORDER="1" CELLPADDING="0"
CELLSPACING="0">
<tr>
<td valign="top" align="right" width="200">
First Name
</td>
<td valign="top" width="462">
<input type='text' name='FirstName' value='John' />
</td>
</tr>
</table>
</form>
So I can get the firstname value in the xsl stylesheet by using:
<xsl:value-of select="customer/FirstName"/>
but how do I jam it into value part of <input type='text' name='FirstName'
value='' />
without creating badly formed xml? Only way I can think of doing is using:
<textarea><xsl:value-of select="customer/FirstName"/></textarea> but
this
isn't such a great solution