Solved

Exception "Invalid URI - The URI Scheme is not VALID" occured while transformation

Posted on 2004-08-26
1
3,039 Views
Last Modified: 2012-06-21
Public Function cleanExpXML(ByVal _expXML As String, ByVal _xslFilepath As String) As String
               Try
           Dim expFile_xmlDoc As New xmldocument
            Dim outputXML As String

            ' Load xsl document
            If xslTransformDoc Is Nothing Then
                resolver = New XmlUrlResolver
                resolver.Credentials = CredentialCache.DefaultCredentials
                xslTransformDoc = New XslTransform
                xslTransformDoc.Load(_xslFilepath)            
            End If

            expFile_xmlDoc.LoadXml(_expXML)
            Dim argumentList As XsltArgumentList

            ' Transform the file.
            xslTransformDoc.Transform(_expXML, outputXML, resolver)    'exception occuring here     '_xslFilepath is something  like  d:\www\temp\myxsl.xsl  

            Return outputXML    

        Catch ex As Exception
            Console.WriteLine(ex.ToString)
        End Try
    End Function


i mean,is there any constructor which returns the transformed document as a string INSTEAD of transforming document to a file?


thanks for your reply

regards

0
Comment
Question by:vihar123
1 Comment
 
LVL 2

Accepted Solution

by:
praveen79 earned 500 total points
ID: 11900878
hi,

try this ....



 Dim strWriter As StringWriter = New StringWriter

  ' Transform the file.
      xslTransformDoc.Transform(expFile_xmlDoc.CreateNavigator(), argumentList, strWriter , resolver)
       outputXML = strWriter .ToString()
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now