Solved

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

Posted on 2004-08-26
1
3,057 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
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.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

867 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

20 Experts available now in Live!

Get 1:1 Help Now