Adding to an external XML Page

L

Lawrence

Hey

I have a form with a drop down list box, which fetches the list from
an external xml data source. When "Other" is selected a text box
appears where users can add an optional entry. This works fine as it
is, as I have it so it inserts this value directly into the drop-down
list.

However is it possible using VBS to add this entry to the external XML
document as another child node? I have had a bit of a dig around and
came up with this:

Dim other
Dim oAuxDOM
Dim oNewProf


other = XDocument.DOM.selectSingleNode("/my:myFields/my:grpProf/
my:grpCapaProfOther/my:txtCapaProfOther").text
Set oAuxDOM = XDocument.GetDOM("prof")

Set oNewProf = oAuxDOM.createNode(1, "prof", "")
oNewProf.text = other

oAuxDOM.selectSingleNode("//profcaps").appendChild(oNewProf)
XDocument.View.ForceUpdate()


Where the external XML document is called prof.xml (and has been
entered under data connections) parent node is "profcaps" and child
nodes called "prof"

This obviously doesnt work, any obvious problems?

Kind Regards

Lawrence
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top