Domparser and Empty Elements!

Hi, I’ve been playing with DXL to try and update various database desgn elements. I have had pretty good success but seem to have hit a bit of a wall…

I am trying to update an agent schedule for a “Daily” agent. The problem is trying to access the “text node” of the “Datettime” element inside the “starttime” element.

The general code structure I have been using to get to a node is as follows:

Set nodeListA = domDoc.GetElementsByTagName(“tagname”)

Set nodeA = nodelistA.GetItem(1)

I have been successful in getting the “trigger” and “Schedule” nodes but then comes the problem. The next part of the dxl will be something like:

Txxxxxx,xx

Now I would normaly try getting the nodelist for “starttime”, which returns a nodelist with no nodes. What I can’t figure out is how to get to the datetime text node so I can change the value and update the dom and finally serialize.

Appreciate any help from those DXL experts out there!

Subject: Domparser and Empty Elements!

Chris,

You’re probably running into the old “phantom nodes” issue.

I have some general purpose LotusScript routines for handling XML DOM parsing posted in my blog, here:

http://www.rhs.com/web/blog/poweroftheschwartz.nsf/d6plinks/RSCZ-6CYLGD

You may find them useful to use directly, or you may find them instructive at the code level – in particular in their use of While loops to handle the cases where (due to phantom nodes) what you find at a particular point in the DOM tree is not what you might have expected.

-rich

Subject: RE: Domparser and Empty Elements!

many thanks rich, will take a look and get back to you!