473,385 Members | 1,465 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

What to replace obsolete interfaces with?

I have this code below, that works like a champ, but two lines are
continually marked as obsolete. See embeded notes.

Private Shared Function TransformHTMLString(ByVal XSLT As String, _
ByVal XHTML As String) _
As String
Dim xdoc As Xml.XmlDocument = New Xml.XmlDocument
xdoc.LoadXml(XHTML)

Dim xsDoc As Xml.XmlDocument = New XmlDocument
xsDoc.LoadXml(XSLT)

'Both lines that are marked as obsolete are tagged that way
'by VS.Net2003. It is because I am passing an XMLDocument
'rather than a resolver

Dim xformer As Xml.Xsl.XslTransform = New Xml.Xsl.XslTransform
xformer.Load(xsDoc) 'Marked as obsolete

Dim writer As StringWriter = New StringWriter
xformer.Transform(xdoc, Nothing, writer) 'Marked as obsolete

Dim rtf As String = writer.ToString()
writer.Close()
Return rtf
End Function

What is the non-obsolete way to do the same thing?

Nov 12 '05 #1
4 2720
On 4 Mar 2005 10:21:15 -0800, BrianProgrammer wrote:

[snip]
Dim xformer As Xml.Xsl.XslTransform = New Xml.Xsl.XslTransform
xformer.Load(xsDoc) 'Marked as obsolete
' pass Nothing for the XmlResolver and Evidence parameters
xformer.Load(xsDoc, Nothing, Nothing)
Dim writer As StringWriter = New StringWriter
xformer.Transform(xdoc, Nothing, writer) 'Marked as obsolete


' pass Nothing for the XmlResolver parameter
xformer.Transform(xdoc, Nothing, writer, Nothing

--
Ross Presser
"Life's a bitch, and life's got lots of sisters."
Nov 12 '05 #2
Thanks.
That was simple and seemed obvious. Just not clear in documentation to
me.

Nov 12 '05 #3
This version causes an error of:

System.Security.Policy.PolicyException: Exception from HRESULT:
0x80131418. at System.Reflection.Assembly.nLoadImage(Byte[]
rawAssembly, Byte[] rawSymbolStore, Evidence evidence, StackCrawlMark&
stackMark) at System.Reflection.Assembly.Load(Byte[] rawAssembly,
Byte[] rawSymbolStore, Evidence securityEvidence) at
Microsoft.JScript.JSCodeGenerator.FromFileBatch(Co mpilerParameters
options, String[] fileNames) at
System.CodeDom.Compiler.CodeCompiler.FromDomBatch( CompilerParameters
options, CodeCompileUnit[] ea) at
System.CodeDom.Compiler.CodeCompiler.FromDom(Compi lerParameters
options, CodeCompileUnit e) at
System.CodeDom.Compiler.CodeCompiler.System.CodeDo m.Compiler.ICodeCompiler.CompileAssemblyFromDom(Co mpilerParameters
options, CodeCompileUnit e) at
System.Xml.Xsl.Compiler.CompileAssembly(ScriptingL anguage lang,
Hashtable typeDecls, String nsName, Evidence evidence) at
System.Xml.Xsl.Compiler.CompileScript(Evidence evidence) at
System.Xml.Xsl.Compiler.Compile(NavigatorInput input, XmlResolver
xmlResolver, Evidence evidence) at
System.Xml.Xsl.XslTransform.Compile(XPathNavigator stylesheet,
XmlResolver resolver, Evidence evidence) at
System.Xml.Xsl.XslTransform.Load(XPathNavigator stylesheet, XmlResolver
resolver, Evidence evidence) at
System.Xml.Xsl.XslTransform.Load(IXPathNavigable stylesheet,
XmlResolver resolver, Evidence evidence) at
BFastControls.HtmlToRtf.ConvertToRtf(String XSLT, String XHTML) in
C:\Clients\BBI\BFast2005\BFastControls\HtmlToRtf.v b:line 50

Any Ideas on why?

Nov 12 '05 #4
Found my own solution

1. change method from being shared to requiring instantiation
2. change: xformer.Load(xsDoc, Nothing, Nothing)
to: xformer.Load(xsDoc, Nothing, Me.GetType().Assembly.Evidence)

problem solved. What a pain in the butt. lol

Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

92
by: Reed L. O'Brien | last post by:
I see rotor was removed for 2.4 and the docs say use an AES module provided separately... Is there a standard module that works alike or an AES module that works alike but with better encryption?...
0
by: SueDong | last post by:
I have a VC6 application and would like to convert it to .Net. The application have a few ATL projects that have a standard global CComModule _Module in header file and following code in cpp...
4
by: JellBell | last post by:
I dont know what is a legacy system..please help me out Posted Via Usenet.com Premium Usenet Newsgroup Services ---------------------------------------------------------- ** SPEED ** RETENTION...
44
by: lester | last post by:
a pre-beginner's question: what is the pros and cons of .net, compared to ++ I am wondering what can I get if I continue to learn C# after I have learned C --> C++ --> C# ?? I think there...
0
by: jbeerni | last post by:
In .NET, you can mark methods and accessors as obsolete by using the directive. I've found some interesting behavior with the directive when used in a class which is referenced as a return type...
12
by: Steven T. Hatton | last post by:
This is something I've been looking at because it is central to a currently broken part of the KDevelop new application wizard. I'm not complaining about it being broken, It's a CVS images. ...
9
by: gulu man | last post by:
Hi, What is the substitute for COM objects in .NET? How can I create something similar to com in .net? Is it still possible? Thank you
1
by: BrianProgrammer | last post by:
I have this code below, that works like a champ, but two lines are continually marked as obsolete. See embeded notes. Private Shared Function TransformHTMLString(ByVal XSLT As String, _ ByVal...
2
by: Craig HB | last post by:
I have been using the code below to validate an XML document with an XML schema. If the XML is not valid, then the procedure throws an exception. I have upgraded the application using this proc to...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.