Is there a way to use the value from the form into XML nodes? Once they submit this form I want the values from the form fields to overwrite the existing nodes.
<html>
<head></head>
<body>
<form id="myForm" method="POST">
<input type="text" value="new XML node value here" />
<input type="submit" onClick="function();"/>
</form>
</body>
Thanks in advance
This transformation:
when applied on this XML document (corrected the provided to be well-formed):
produces the wanted, correct result:
Do note:
The Identity rule is used to copy the document as is.
The query string of the HTTP request is passed as an external parameter named
pqueryString.The
ext:node-set()extension used here will not be needed in practice, because the parameter will be passed externally.The only override of the identity rule is for attributes named
value.The template matching
@valuecreates an attribute with the same name and its value is either the one specified by the user (contained in the query string param) or if the user didn’t specify a value for this attribute, then its current value.