473,563 Members | 2,867 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

xsltransform.tr ansform() method not works in 2003

94 New Member
Hi all,

I am using VS2003. I am new to VS2003. I cannot transform an xml file into a string output in my windows application. But the same function works well with VS2005. it also asks for xmlresolver in the transform() function. I provided Nothing as 4th parameter, eventhough it doesnt work. anybody can help me?. I dont know where i am wrong. I need to create html files with this xml data.

Expand|Select|Wrap|Line Numbers
  1. Public Shared Function CreateHtmlFile(ByVal ds As DataSet, ByVal xslpath As String) As String
  2.  
  3. Dim document As XmlDocument ' Xml document root
  4. Dim navigator As XPathNavigator ' navigate document
  5. Dim transformer As XslTransform ' transform document
  6. Dim output As StringWriter
  7.  
  8. document = New XmlDocument()
  9. document.LoadXml(ds.GetXml())
  10.  
  11. ' create navigator
  12. navigator = document.CreateNavigator
  13.  
  14. ' load style sheet
  15. transformer = New XslTransform()
  16. transformer.Load(xslpath)
  17.  
  18.  
  19.  
  20. ' transform XML data
  21. output = New StringWriter()
  22. transformer.Transform(navigator, Nothing, output)
  23.  
  24. ' display transformation in text box
  25. Console.WriteLine(output.ToString)
  26.  
  27. ' write transformation result to disk
  28. Dim stream As FileStream = _
  29. New FileStream("c:\Billcustomer1.html", FileMode.Create)
  30.  
  31. Dim writer As StreamWriter = New StreamWriter(stream)
  32. writer.Write(output.ToString)
  33.  
  34. ' close streams
  35. writer.Close()
  36. output.Close()
  37. Return output.ToString()
  38. End Function 
  39.  
With thanks,
Sudha
Dec 27 '08 #1
1 1070
MrMancunian
569 Recognized Expert Contributor
Does the function return any error message you can post? And why don't you just use VB.NET 2005 instead of VB.NET 2003 if it works in 2005?

Steven
Dec 29 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
5812
by: Anthony Bouch | last post by:
Can anyone tell me why I receive the following compiler warning after having recently upgraded to VS.Net 2003 and .Net 1.1? Warning CS0618: 'System.Xml.Xsl(System.Xml.XPath.IXPathNavigable, System.Xml.Xsl.XsltArgumentList, System.Xml.XmlWriter)' is obsolete: 'You should pass XmlResolver to Transform() method' XPathDocument xmlData = new...
2
3614
by: John Meyer | last post by:
I have an application where I create an xml fragment using an XslTransform object. However, if I use the following output method, <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes" standalone="no" /> some of my transforms fail with the following exception: System.Xml.Xsl.XsltException: There...
5
1832
by: Kevin Westhead | last post by:
I'm using XslTransform to apply a transform to an XML document, however I get validation problems when parsing the resulting XML document due to invalid whitespace. I'm passing in an XPathNavigator for the input to the Transform method and specifying a Stream for the output. Here is an example of a transform and a document (it's the...
2
6019
by: Graham Pengelly | last post by:
Hi I am trying to transform on System.Xml.XmlDocument into another using XslTransform without writing the object out to a file. I am guessing it should work something like this... public XmlDocument TransformXmlDoc(XmlDocument docToTransform, string xsltFilePath) { //load the xslt
2
3707
by: KJS | last post by:
Hello, I'm receiving: 'System.Xml.Xsl.XsltException: Missing mandatory attribute 'version' After I try and run my transformation. I spent a good few days coming up with the appropriate (I think) methods, and overrides for this task. I have verified that the source XML and XSL will transform by means of using the MSXML command line parsing...
4
3584
by: David S. Alexander | last post by:
I am trying to transform XML to XML using an XSLT in C#, but the root node of my XML is not being matched by the XSLT if it has an xmlns attribute. Am I handling my namespaces incorrectly? My C# code is, // Create an XSLT transform object XslTransform xslTransform = new XslTransform(); // Load the stylesheet
1
1500
by: rmgalante | last post by:
Hello, I have a VB.Net component that uses the XslTransform object. I am using the FXSL randomizeList function in my XSL template. When I transform the XML in the VB.Net component, my application hangs. When I load the XML in a browser with a reference to the XSL template, it works fine. Here is my XML:
12
10076
by: InvalidLastName | last post by:
We have been used XslTransform. .NET 1.1, for transform XML document, Dataset with xsl to HTML. Some of these html contents contain javascript and links. For example: // javascript if (a &gt; b) ..... // xsl contents abc.aspx?p1=v1&amp;p2=<xsl:value-of select="$v2" />
9
2491
by: WT | last post by:
Hello, I have code created with .net 1.0 and migrated to 3.5. Form 2.0 the XslTransform class is obsolete and the vs2008 compiler generates warnings that these classes are absolete suggesting to use XslCompiledTransform. But all this was rendered using an Xml control and I can't find a way to relate this control to an XslCompiledTransform...
0
7583
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7888
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7642
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6255
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1200
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.