envar datos en formato xml

egamonty
27 de Mayo del 2005
quiero hacer un formulario en una web para enviar los datos en xml, pero no sé como hacerlo. No tengo ni idea de xml!!!

frank
27 de Mayo del 2005
<HTML>
<HEAD>
<SCRIPT LANGUAGE="VBScript">
Function onLoad()
Dim mydata, pi
Set mydata = CreateObject("Msxml2.DOMDocument.4.0")
Set pi = mydata.createProcessingInstruction("xml", "version='1.0' encoding='UTF-8'")
mydata.insertBefore pi, mydata.firstChild
End function
Function sendInfo()
Dim MyHttp
'Do validation of input data before sending it.
If(Not(customerName.value = "")) then
With MyData.documentElement
.getElementsByTagName("Name").item(0).text = customerName.value
.getElementsByTagName("Phone").item(0).text = customerPhoneNum.value
End With
Set MyHttp=CreateObject("Msxml2.XMLHTTP.4.0")
MyHttp.open "POST", "http://localhost/httpreqserver.asp", False
'Simulate message sent by a custom user agent.
MyHttp.setRequestHeader "User-Agent", "MyCustomUser"
MyData.async = False
MyHttp.send mydata.XMLDocument
Document.Write MyHttp.responseText
Else
Document.Write "Invalid data."
End If
End function
</SCRIPT>
</HEAD>
<BODY LANGUAGE="JScript" ONLOAD="Return onLoad()">
<TABLE BORDER="2" ALIGN="center">
<TR><TD WIDTH="150" ALIGN="center">
<LABEL>Name</LABEL>
</TD><TD>
<INPUT NAME="customerName" TYPE="EDIT"/>
</TD></TR>
<TR><TD WIDTH="150" align="CENTER">
<LABEL>Telephone number</LABEL>
</TD><TD>
<INPUT NAME="customerPhoneNum" type="EDIT"/>
</TD></TR>
</TABLE>
<TABLE ALIGN="CENTER">
<TR><TD WIDTH="150" ALIGN="CENTER">
<INPUT TYPE="BUTTON" VALUE="Send Information" ALIGN="CENTER" ONCLICK="sendInfo()"/>
</TD></TR>
</TABLE>
</BODY>
</HTML>
<XML id="MyData">
<MyStructure>
<Name/>
<Phone/>
</MyStructure>
</XML>

e
27 de Mayo del 2005
bobo