![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Transforming an XML using XSL(with VB Script) using MSXML4.0 >Thread Next - Re: Transforming an XML using XSL(with VB Script) using MSXML4.0 Re: Transforming an XML using XSL(with VB Script) using MSXML4.0To: NULL Date: 9/5/2006 3:18:00 PM Jnani wrote: > I have an XSL which has a VB script function embedded. I need to tranform an > XML using MSXML4.0. I am getting "Invalid class string" error. XML, XSL and > the code is given below. > <xsl:stylesheet version="1.0" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xmlns:msxsl="urn:schemas-microsoft-com:xslt" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:var="urn:var" > xmlns:user="urn:user" exclude-result-prefixes="msxsl var user xsi"> > <xsl:template match="/Root/Parent"> > <Result> > <xsl:value-of select="//Data"/> > </Result> > </xsl:template> > <msxsl:script language="VB" implements-prefix="user"><![CDATA[ > Function DateToday() As String > Return Date.Now.ToShortDateString > End Function Are you sure that is syntactically correct _VBScript_? Looks more like VB.NET to me. And if you use MSXML then for script you can use JScript or VBScript in XSLT but not the .NET languages. > C#.Net method being used > > public static string Ex_Transform(XmlDocument oXML, XmlDocument oXSL) > { > String sRet = null; > try > { > MSXML2.DOMDocument40Class oCOMXml = new MSXML2.DOMDocument40Class(); > MSXML2.DOMDocument40Class oCOMXsl = new MSXML2.DOMDocument40Class(); > oCOMXml.load("<XMLPath>"); > oCOMXsl.load("<XSLPath>"); > sRet = oCOMXml.transformNode(oCOMXsl).ToString(); Why are you trying to use MSXML in .NET anyway? .NET 1.x has XslTransform for XSLT transformations, .NET 2.0 has XslCompiledTransform. And then you could indeed use VB.NET as a "scripting" language in your XSLT stylesheets. -- Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/ | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
