| Home | Software Support | Training | Conferences |

Using XSLTransform under the .NET Framework. The XSLTransform component is not specifically designed for use under the Microsoft .NET Framework. It is a standard COM DLL, and so will require you to run any managed code application or ASP.NET page that uses it in "compatibility" mode (i.e. include AspCompat="true" in the <%@Page ... %> directive). Alternatively you can use the .NET TLBIMP utility to create a managed code wrapper for the component. However, please note that we cannot provide support for issues that arise in conjunction with using the component within a .NET application. Opening an XML document from a remote location. If you have problems accessing documents (XML files or stylesheets) from a remote location that is specified with the http:// prefix, you can take advantage of the XMLHTTP object that is built into MSXML. Use it to fetch the document and expose it as a string that you then pass to the the XSLTransform component: strURL = "http://www.your-url.com/path/filename.xml"
Set objHTTP = Server.CreateObject("Microsoft.XMLHTTP")
objHTTP.Open "GET", strURL, False
objHTTP.Send
strResult = objHTTP.ResponseText
Set objTransform = Server.CreateObject("Stonebroom.XSLTransform")
Dim strStatus 'to hold the status message
strXMLFile = strResult 'the XML source file as a string
strXSLFile = "filename.xsl" 'the XSL style sheet file
blnWorked = objTransform.TransformXML(strXMLFile, strXSLFile, , strStatus)
Response.Write strStatus
Changes to the component in version 1.2x. The XSLTransform component depends on the presence of a Microsoft-compatible XSL parser on the server. The ProgID string used by default to locate this component is "MSXML.DOMDocument". As new parsers have been released, the ability to select which one to use was added to the XSLTransform component in version 1.2x. This is done through an optional extra parameter for both the TransformXSL and TransformBatch methods named ParserClass. To use the updated XSLT-compliant version of the Microsoft parser, specify the value "MSXML2.DOMDocument" for this parameter. Checking the component version number. If you are having problems with XSLTransform, you should check the component version numbers and include these with your inquiry. The component file is stnxsltr.dll. It is installed by default in your Windows\System or Winnt\System32 folder. To check the version number of the file stnxsltr.dll:
Obtaining the latest version of the components. The XSLTransform DLL may be updated from time to time, either to fix minor errors, add functionality, or improve performance. You can download the latest version of the component from here and use it to update your installation:
I can't replace or delete the XSLTransform DLL file. Windows NT and the Web server cache the components they use in memory, and lock them so that they cannot be moved or deleted while in use. In some cases stopping and restarting the Web server may release the component. Otherwise restarting Windows or rebooting the server will do the trick. If you are using Internet Information Server 4 or higher, you can create Virtual Applications and place all your ASP pages that use the component inside this folder to avoid this problem. It's then possible to unload a component from memory using the Properties dialog of the Virtual Application folder in Internet Service Manager. The 'ERROR: Cannot replace existing file' and 'ERROR: Cannot open output file' messages. XSLTransform requires appropriate disk access permissions to be able to create the output file. If you encounter the 'Cannot replace existing file' or 'Cannot open output file' message, you will need to edit the Permissions list in the Properties dialog for the directories you wish to use with XSLTransform. Give the account that will use the component Write or Full Control permission. If the component is being accessed anonymously, the account in use will be either IUSR_machinename or IWAM_machinename depending on whether you have installed the component as a Virtual Application in Internet Service Manager. The 'ERROR: Invalid procedure call or argument' message. When running on Windows 2000, you might see this message displayed when calling the XSLTransform component methods. Give the account that will use the component Write or Full Control permission (you can temporarily give the Everyone group Full Control while testing). If the component is being accessed anonymously, the account in use will be either IUSR_machinename or IWAM_machinename depending on whether you have installed the component as a Virtual Application in Internet Service Manager. Runtime error 800a01ad 'ActiveX component can't create object'. This general error message can be caused by many things. To cure it, try the following:
Server.CreateObject() in your ASP pages.CreateObject() alone should only be used in Visual Basic.
regsvr32 path_to_dll\stnxsltr.dll
Finally, if you've got any suggestions - or any comments on XSLTransform
generally - we'd love to hear from you.
|