I did something similar in this article:
http://enterprise-solutions.swits.net/infopath2003/article.php?t=transform-data-
secondary-data-source-xslt&c=infopath2003
Scroll down to the code. While I transformed data in a secondary data
source, the same principles apply. You need to retrieve the parent of the
node in the Main DOM that you want to transform and then replace the old
child node with your transformed XML for the new child node, using
replaceChild().
If you cannot read JScript, replace the "var" with "Dim", remove the
semi-colons, separate the variable declarations and assignments by placing
them on separate lines, and you've got VBScript code.
---
S.Y.M. Wong-A-Ton
> I've created a button on my form with a VBscript to perform a custom
> transform from an XSLT 1.0 file. I'm able to create the DOM object for the
[quoted text clipped - 12 lines]
>
> Mike.
MJB - 05 Nov 2007 19:21 GMT
Sorry to take so long to get back to you but other things got in the way.
Thanks for the pointer on how to start with this. After pondering it
further, I realized that InfoPath only supported XSLT 1.0 and I was planning
to use a capability new to XSLT 2.0. So I ended up instead writing a script.
Your example though, turned out to have enough to get me started quickly on
manipulating nodes via the DOM in InfoPath. So I learned what I needed from
your example, even though I had started by asking a different question.
Thanks.
Mike.