I have this code below, that works like a champ, but two lines are
continually marked as obsolete. See embeded notes.
Private Shared Function TransformHTMLSt ring(ByVal XSLT As String, _
ByVal XHTML As String) _
As String
Dim xdoc As Xml.XmlDocument = New Xml.XmlDocument
xdoc.LoadXml(XH TML)
Dim xsDoc As Xml.XmlDocument = New XmlDocument
xsDoc.LoadXml(X SLT)
'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.XslTran sform = New Xml.Xsl.XslTran sform
xformer.Load(xs Doc) 'Marked as obsolete
Dim writer As StringWriter = New StringWriter
xformer.Transfo rm(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? 4 2729
On 4 Mar 2005 10:21:15 -0800, BrianProgrammer wrote:
[snip] Dim xformer As Xml.Xsl.XslTran sform = New Xml.Xsl.XslTran sform xformer.Load(xs Doc) 'Marked as obsolete
' pass Nothing for the XmlResolver and Evidence parameters
xformer.Load(xs Doc, Nothing, Nothing)
Dim writer As StringWriter = New StringWriter xformer.Transfo rm(xdoc, Nothing, writer) 'Marked as obsolete
' pass Nothing for the XmlResolver parameter
xformer.Transfo rm(xdoc, Nothing, writer, Nothing
--
Ross Presser
"Life's a bitch, and life's got lots of sisters."
Thanks.
That was simple and seemed obvious. Just not clear in documentation to
me.
This version causes an error of:
System.Security .Policy.PolicyE xception: Exception from HRESULT:
0x80131418. at System.Reflecti on.Assembly.nLo adImage(Byte[]
rawAssembly, Byte[] rawSymbolStore, Evidence evidence, StackCrawlMark&
stackMark) at System.Reflecti on.Assembly.Loa d(Byte[] rawAssembly,
Byte[] rawSymbolStore, Evidence securityEvidenc e) at
Microsoft.JScri pt.JSCodeGenera tor.FromFileBat ch(CompilerPara meters
options, String[] fileNames) at
System.CodeDom. Compiler.CodeCo mpiler.FromDomB atch(CompilerPa rameters
options, CodeCompileUnit[] ea) at
System.CodeDom. Compiler.CodeCo mpiler.FromDom( CompilerParamet ers
options, CodeCompileUnit e) at
System.CodeDom. Compiler.CodeCo mpiler.System.C odeDom.Compiler .ICodeCompiler. CompileAssembly FromDom(Compile rParameters
options, CodeCompileUnit e) at
System.Xml.Xsl. Compiler.Compil eAssembly(Scrip tingLanguage lang,
Hashtable typeDecls, String nsName, Evidence evidence) at
System.Xml.Xsl. Compiler.Compil eScript(Evidenc e evidence) at
System.Xml.Xsl. Compiler.Compil e(NavigatorInpu t input, XmlResolver
xmlResolver, Evidence evidence) at
System.Xml.Xsl. XslTransform.Co mpile(XPathNavi gator stylesheet,
XmlResolver resolver, Evidence evidence) at
System.Xml.Xsl. XslTransform.Lo ad(XPathNavigat or stylesheet, XmlResolver
resolver, Evidence evidence) at
System.Xml.Xsl. XslTransform.Lo ad(IXPathNaviga ble stylesheet,
XmlResolver resolver, Evidence evidence) at
BFastControls.H tmlToRtf.Conver tToRtf(String XSLT, String XHTML) in
C:\Clients\BBI\ BFast2005\BFast Controls\HtmlTo Rtf.vb:line 50
Any Ideas on why?
Found my own solution
1. change method from being shared to requiring instantiation
2. change: xformer.Load(xs Doc, Nothing, Nothing)
to: xformer.Load(xs Doc, Nothing, Me.GetType().As sembly.Evidence )
problem solved. What a pain in the butt. lol This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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?
cheers,
reed
|
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 file:
BOOL CEditorWndCtlApp::InitInstance()
{
_Module.Init(ObjectMap, m_hInstance,
|
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 ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
|
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 must be many know the answer here.
thanks
|
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 by a web service:
Consider the following class:
class foo
{
| |
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. Such things happen. The whole
subsystem is going through radical changes. I don't really want to say
what I think of the code just yet. That would...
|
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
|
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 XHTML As String) _
As String
Dim xdoc As Xml.XmlDocument = New Xml.XmlDocument
xdoc.LoadXml(XHTML)
Dim xsDoc As Xml.XmlDocument = New XmlDocument
|
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 DotNet 2 and Visual Studio
says that I'm using obsolete methods:
XmlValidatingReader : should be using XmlReader.Create
XmlSchemaCollection :...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
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...
| |
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. ...
|
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...
|
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
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...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |