Having some trouble with appending to an xml file. I'm a complete xml virgin and can't find any good documentation for what I'm doing.
Trying to a a record to xml file:
Have been trying to just add one filed at the moment (baby steps!!) Using the code below:
This then gives me:
Am trying to work out how to do something like set the document root to products or something.
Please HELP )-;
Trying to a a record to xml file:
Code:
<CONFIG><STATIC><_ROOT><_ROOT>
<PRODUCTS>
<CAP>
<GROUP></GROUP>
<NAME></NAME>
<TEXT1></TEXT1>
<TEXT2></TEXT2>
<TEXT3></TEXT3>
</CAP>
</PRODUCTS><_ROOT></STATIC></CONFIG>
Code:
Set xmlDoc = server.CreateObject("Microsoft.XMLDOM")
xmlDoc.preserveWhiteSpace = True
blnFileExists = xmlDoc.Load(Server.MapPath(pathCapsXML))
Set xmlRoot = xmlDoc.documentElement
Set xmlRecord = xmlDoc.createElement("CAP")
xmlRoot.appendChild xmlRecord
Set xmlField = xmlDoc.createElement("GROUP")
xmlField.Text = Request.Form("GROUP")
xmlRecord.appendChild xmlField
xmlDoc.save (server.mappath(pathCapsXML))
This then gives me:
Code:
<CONFIG><STATIC><_ROOT><_ROOT>
<PRODUCTS>
<CAP>
<GROUP></GROUP>
<NAME></NAME>
<TEXT1></TEXT1>
<TEXT2></TEXT2>
<TEXT3></TEXT3>
</CAP>
</PRODUCTS><_ROOT></STATIC><CAP><GROUP>GERG</GROUP></CAP><CAP><GROUP>GERG</GROUP></CAP></CONFIG>
Am trying to work out how to do something like set the document root to products or something.
Please HELP )-;