I too have just writen the code to create the XML file. What a job! I had no idea what i was doing. But it is all done now. If anyone else is wondering how to create the XML file manually, here is a snippet of my code. A lot of this code was hi-jacked from Simon Arnold's article:
I found it very useful. I cheated and asked the company who provided the Schema for an example XML file. It was much easier to replicate the file than to follow the Schema.
Here is the code. I had to add an attribute node to the element node. That was not from Simon's example.
** Start the DOM
oXML = CreateObject("MSXML.DOMDocument")
** Add Encoding line
oXML.appendChild(oXML.createNode("PROCESSINGINSTRUCTION","xml",""))
** Create Root Node "fields"
oRoot = oXML.appendChild(oXML.createNode("ELEMENT","fields",""))
** Create Element "field"
oChild = oRoot.appendChild(oXML.createNode("ELEMENT","field",""))
** Create Attribute "name"
newatt=oXml.createAttribute("name")
** Create Attribute Value "b12c96nfAccount_name"
newatt.value="b12c96nfAccount_name"
** Attach Attribute to Element "field"
oChild.setAttributeNode(newatt)
** Create Element "value"
oChild.appendChild(oXML.createElement("value"))
** Create Text Node (data) attached to Element "value"
oChild.lastChild.text = ALLTRIM(LEFT(pvaname,26))
** Account No
oChild = oRoot.appendChild(oXML.createNode("ELEMENT","field",""))
newatt=oXml.createAttribute("name")
newatt.value="b12c96nfAccount_no"
oChild.setAttributeNode(newatt)
oChild.appendChild(oXML.createElement("value"))
oChild.lastChild.text = pvano
** Address Line 1
oChild = oRoot.appendChild(oXML.createNode("ELEMENT","field",""))
newatt=oXml.createAttribute("name")
newatt.value="b12c96nfAddress_line_1"
oChild.setAttributeNode(newatt)
oChild.appendChild(oXML.createElement("value"))
oChild.lastChild.text = ALLTRIM(LEFT(pvaddress,30))
** BSB
oChild = oRoot.appendChild(oXML.createNode("ELEMENT","field",""))
newatt=oXml.createAttribute("name")
newatt.value="b12c96nfBSB"
oChild.setAttributeNode(newatt)
oChild.appendChild(oXML.createElement("value"))
oChild.lastChild.text = pvbsb
** Company Name
oChild = oRoot.appendChild(oXML.createNode("ELEMENT","field",""))
newatt=oXml.createAttribute("name")
newatt.value="b12c96nfCompany_name"
oChild.setAttributeNode(newatt)
oChild.appendChild(oXML.createElement("value"))
oChild.lastChild.text = ALLTRIM(LEFT(pvshopname,30))
** Date Signed
oChild = oRoot.appendChild(oXML.createNode("ELEMENT","field",""))
newatt=oXml.createAttribute("name")
newatt.value="b12c96nfDate_signed_1"
oChild.setAttributeNode(newatt)
oChild.appendChild(oXML.createElement("value"))
oChild.lastChild.text = val(LEFT(DTOC(DATE()),2)+SUBSTR(DTOC(DATE()),4,2)+RIGHT(DTOC(DATE()),4))
** DOB
oChild = oRoot.appendChild(oXML.createNode("ELEMENT","field",""))
newatt=oXml.createAttribute("name")
newatt.value="b12c96nfDOB"
oChild.setAttributeNode(newatt)
oChild.appendChild(oXML.createElement("value"))
oChild.lastChild.text = val(LEFT(DTOC(pvdob),2)+SUBSTR(DTOC(pvdob),4,2)+RIGHT(DTOC(pvdob),4))
** Email
oChild = oRoot.appendChild(oXML.createNode("ELEMENT","field",""))
newatt=oXml.createAttribute("name")
newatt.value="b12c96nfEmail"
oChild.setAttributeNode(newatt)
oChild.appendChild(oXML.createElement("value"))
oChild.lastChild.text = ALLTRIM(LEFT(pvemail,30))
** First Name
oChild = oRoot.appendChild(oXML.createNode("ELEMENT","field",""))
newatt=oXml.createAttribute("name")
newatt.value="b12c96nfFirst_Name"
oChild.setAttributeNode(newatt)
oChild.appendChild(oXML.createElement("value"))
oChild.lastChild.text = ALLTRIM(LEFT(pdffirst,30))
** Bank
oChild = oRoot.appendChild(oXML.createNode("ELEMENT","field",""))
newatt=oXml.createAttribute("name")
newatt.value="b12c96nfInstitution"
oChild.setAttributeNode(newatt)
oChild.appendChild(oXML.createElement("value"))
oChild.lastChild.text = ALLTRIM(LEFT(pvbn,26))
** Branch
oChild = oRoot.appendChild(oXML.createNode("ELEMENT","field",""))
newatt=oXml.createAttribute("name")
newatt.value="b12c96nfInstitution_suburb"
oChild.setAttributeNode(newatt)
oChild.appendChild(oXML.createElement("value"))
oChild.lastChild.text = ALLTRIM(LEFT(pvb,26))
** Mobile
oChild = oRoot.appendChild(oXML.createNode("ELEMENT","field",""))
newatt=oXml.createAttribute("name")
newatt.value="b12c96nfMobile_phone"
oChild.setAttributeNode(newatt)
oChild.appendChild(oXML.createElement("value"))
oChild.lastChild.text = ALLTRIM(pvmobile)
** Phone
oChild = oRoot.appendChild(oXML.createNode("ELEMENT","field",""))
newatt=oXml.createAttribute("name")
newatt.value="b12c96nfPhone"
oChild.setAttributeNode(newatt)
oChild.appendChild(oXML.createElement("value"))
oChild.lastChild.text = ALLTRIM(pvphone)
** Post_code
oChild = oRoot.appendChild(oXML.createNode("ELEMENT","field",""))
newatt=oXml.createAttribute("name")
newatt.value="b12c96nfPost_code"
oChild.setAttributeNode(newatt)
oChild.appendChild(oXML.createElement("value"))
oChild.lastChild.text = pvpostcode
** Principal
oChild = oRoot.appendChild(oXML.createNode("ELEMENT","field",""))
newatt=oXml.createAttribute("name")
newatt.value="b12c96nfPrincipal"
oChild.setAttributeNode(newatt)
oChild.appendChild(oXML.createElement("value"))
oChild.lastChild.text = ALLTRIM(LEFT(pvshopname,24))
** Reference ezypay no
oChild = oRoot.appendChild(oXML.createNode("ELEMENT","field",""))
newatt=oXml.createAttribute("name")
newatt.value="b12c96nfReference_id"
oChild.setAttributeNode(newatt)
oChild.appendChild(oXML.createElement("value"))
oChild.lastChild.text = pdfcustrefid
** State
oChild = oRoot.appendChild(oXML.createNode("ELEMENT","field",""))
newatt=oXml.createAttribute("name")
newatt.value="b12c96nfState"
oChild.setAttributeNode(newatt)
oChild.appendChild(oXML.createElement("value"))
oChild.lastChild.text = ALLTRIM(LEFT(pvstate,3))
** Suburb
oChild = oRoot.appendChild(oXML.createNode("ELEMENT","field",""))
newatt=oXml.createAttribute("name")
newatt.value="b12c96nfSuburb"
oChild.setAttributeNode(newatt)
oChild.appendChild(oXML.createElement("value"))
oChild.lastChild.text = ALLTRIM(LEFT(pdfsuburb,26))
** Surname
oChild = oRoot.appendChild(oXML.createNode("ELEMENT","field",""))
newatt=oXml.createAttribute("name")
newatt.value="b12c96nfSurname"
oChild.setAttributeNode(newatt)
oChild.appendChild(oXML.createElement("value"))
oChild.lastChild.text = ALLTRIM(LEFT(pdflast,30))
oXML.Save("c:\data.xml")