Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Transforming an XML using XSL(with VB Script) using MSXML4.0

From: Jnani@-----------.---------.---
To: NULL
Date: 9/5/2006 7:16:00 AM

Thanks Martin,

That was a conclusive respone from your side. The script is indeed VB.Net 
code, which was overlooked by me. I will use .NET to do the transformation. 
Thanks again. 

"Martin Honnen" wrote:

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


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent