BenyPooh
06-10-2007, 12:13 AM
Hi, I have an exemple of a script here in ASP that
receives an XML document and puts it into array :
I would really need some help to translate this into PHP script !
Thank You very much
-----------------------------------------------------------------
'Get XML that was send from SWF file
Dim sXMLString
dim item as String
For Each item In Request.Form
'Response.Write(item & " = " & Request.Form(item) & VbCrLf)
sXMLString = sXMLString & item & " = " & Request.Form(item)
Next
'Load XML into object
Dim oXML as Object
Dim oNodeList as Object
Dim oNode as Object
oXML = Server.CreateObject("MSXML2.DOMDocument")
oXML.async = False
oXML.validateOnParse = False
'Response.Write(sXMLString)
'Response.Write(oXML.loadXML(sXMLString))
oXML.loadXML(sXMLString)
'Use XPath to get the data
dim sPath as String
sPath = "/data/variable/row/column"
oNodeList = oXML.documentElement.selectNodes(sPath)
'Store data in an array
dim i, aVals(3)
i=0
For Each oNode in oNodeList
With oNode
' Just write the xml for that node to show you.
'Response.Write(.text + "<br>")
aVals(i)=.text
i=i+1
End With
Next
-----------------------------------------------------------------
receives an XML document and puts it into array :
I would really need some help to translate this into PHP script !
Thank You very much
-----------------------------------------------------------------
'Get XML that was send from SWF file
Dim sXMLString
dim item as String
For Each item In Request.Form
'Response.Write(item & " = " & Request.Form(item) & VbCrLf)
sXMLString = sXMLString & item & " = " & Request.Form(item)
Next
'Load XML into object
Dim oXML as Object
Dim oNodeList as Object
Dim oNode as Object
oXML = Server.CreateObject("MSXML2.DOMDocument")
oXML.async = False
oXML.validateOnParse = False
'Response.Write(sXMLString)
'Response.Write(oXML.loadXML(sXMLString))
oXML.loadXML(sXMLString)
'Use XPath to get the data
dim sPath as String
sPath = "/data/variable/row/column"
oNodeList = oXML.documentElement.selectNodes(sPath)
'Store data in an array
dim i, aVals(3)
i=0
For Each oNode in oNodeList
With oNode
' Just write the xml for that node to show you.
'Response.Write(.text + "<br>")
aVals(i)=.text
i=i+1
End With
Next
-----------------------------------------------------------------