Help!!! Populating XML Child Node Value With A Recordset Val

admin

Administrator
Staff member
Trying to set a value of a child node to a recordset value. having a hard time right now... I would like to generate the XML file dynamically from the element value and element name stored in the database. I have two recordsets: 1 to pull the data from a payment table while the other pulling the element name and what the value should be for that element (based on the value from the first recordset)

Database View For XML Info Table
=========================================================
ElementName ElementValue
_projectnumer objCpmsRS.Fields("CPMS_Project").Value

========================================================
objXMLDoc.loadXML "<uClient/>"
Set nodeRoot = objXMLDoc.documentElement

set objPI=objXMLDoc.createProcessingInstruction("xml", "version='1.0'")

'Append the processing instruction to the XML document.
objXMLDoc.insertBefore objPI, objXMLDoc.childNodes(0)

objHdrElmntRS.movefirst
while not objHdrElmntRS.EOF

Msgbox objHdrElmntRS.Fields("BPXMLINFO_ELMNTVALUE").Value

Set nodeCpms = objXMLDoc.createElement(objHdrElmntRS.Fields("BPXMLINFO_ELMNTNAME").Value)
nodeRoot.appendChild nodeCpms
nodeCpms.nodeTypedValue = objHdrElmntRS.Fields("BPXMLINFO_ELMNTVALUE").Value

objHdrElmntRS.movenext

wend
 
Back
Top