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 / February 2006

Tip: Looking for answers? Try searching our database.

How can I reference Msxml2.XSLTemplate50 in vbscript?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Caeanis - 14 Feb 2006 02:26 GMT
I tried using the following code sample out of help.  
    Dim xslt As New Msxml2.XSLTemplate50
    Dim xslDoc  As Msxml2.FreeThreadedDOMDocument50
    Dim xmlDoc As New Msxml2.DOMDocument50
    Dim xslProc As IXSLProcessor

Problem is vbscript is not vb there for there must be a way to reference the
object by referencing the dll that it is found in.  I thought that maybe
because it was inside my infopath doc it would be an intrinsic object.  I
also tried using asp's method of

    Set xslt = Server.CreateObject("Msxml2.XSLTemplate50")
    Set xslDoc = Server.CreateObject("Msxml2.FreeThreadedDOMDocument50")
    Set xslProc = Server.CreateObject("IXSLProcessor")

But that doesn't work either since I'm not pulling this from a webserver.  
How do I initialize these object in VbScript?
S.Y.M. Wong-A-Ton - 14 Feb 2006 07:58 GMT
A plain old "CreateObject" without the "Server" part should work if the DLL
is registered on your machine. So try using
Set xslt = CreateObject("Msxml2.XSLTemplate50")
---
S.Y.M. Wong-A-Ton

> I tried using the following code sample out of help.  
>     Dim xslt As New Msxml2.XSLTemplate50
[quoted text clipped - 13 lines]
> But that doesn't work either since I'm not pulling this from a webserver.  
> How do I initialize these object in VbScript?
Caeanis - 15 Feb 2006 09:35 GMT
Thank you for stating the obvious.  I don't know why I didn't see it right
away.  Now I have a new problem; the following line:

xslDoc.Load "myRecipes.xsl"

Generates this error at run-time:

"The stylesheet does not contain a document element.  The stylesheet may be
empty, or it may not be a well-formed XML document."

!!!

I can use this same style sheet to successfully transform a xml document
generated by my infopath form in both Stylus Studio and Altova XMLSpy.   I
have validated it in both for being well formed and all that jazz.   So why
is InfoPath having an issue with it?  Does it need a special tag(s) for
Infopath to use it?

> A plain old "CreateObject" without the "Server" part should work if the DLL
> is registered on your machine. So try using
[quoted text clipped - 19 lines]
> > But that doesn't work either since I'm not pulling this from a webserver.  
> > How do I initialize these object in VbScript?
 
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.