Jump to content
Sign in to follow this  
malanno

new to xml... are dynamic forms possible

Recommended Posts

Hi. My goal is to have a form that updates an xml.file...

 

Can I create a form that would automatically know what the field names are? For instance the hardware engineers I work with don't even close to html forms and php so they want to be able to just change a node name or even add and subtract nodes, however they don't want to touch the code for the form/

 

The hardware engineer that gave me this task call it... Self Defining Entry Fields

 

Anyone ever hear of that? Here are my xml and xsl sheet....

 

It's kinda like the xsl

 

<xsl:template match="/">
<html>
<body>
<form method="post" action="test.php">
<h2>Customer Information:</h2>
<table border="0">
<xsl:for-each select="/customer/location/field">
<tr>
<td><xsl:value-of select="@id"/></td>
<td>
<input type="text" size="50">
<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="value" />
</xsl:attribute>
</input>
</td>
</tr>
</xsl:for-each>
</table>
The xml looks like this
<location>
<field id="Name " name="name "> <value>MHV </value> </field>
<field id="City " name="city "> <value>Lake Katrine </value> </field>
<field id="State " name="state "> <value>NY </value> </field>
<field id="ZIP " name="zip "> <value>12449 </value> </field>
<field id="Email Addresses" name="email_addresses"> <value>hupcey@cadence.com berghorn@cadence.com </value> </field>
</location>
If you notice the xsl does not need the field names, Just the child node location.
How can I make this work the same way with an html form? Thank you...

 

customer.xml

Share this post


Link to post
Share on other sites

It looks like your XSL works. Are you asking how to do this with PHP?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...