Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / November 2007

Tip: Looking for answers? Try searching our database.

Applying a custom transform (XSLT)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MJB - 01 Oct 2007 01:02 GMT
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
transform and use XDocument.DOM.transformNode to create a string with the
transformation result, but I can't figure out how to apply this into the
XDocument in the form.

My best guess was to use XDocument.DOM.loadXML but I get an error message
that "This DOM cannot be loaded twice". Is there some property of the
XDocument I need to set?

Or, more likely, am I going about this completely wrong? Using InfoPath 2003
and MSXML 5.

Thanks.

Mike.
S.Y.M. Wong-A-Ton - 01 Oct 2007 09:00 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.