Using XSL in VB.net

All I want to do is execute a simple transformation in VB.net.... I know 
this has to be simple.

I tried the following as suggested by a web page I found....

Dim xslt as New XslTransform()

xslt.Load("Filename")
xslt.Transform("InFile", "ResultFile")

This appears to be very straightforward to me.

However, this causes an error saying the code is obsolete... (I thought the 
whole Framework version concept meant backwards compatability, but I guess 
not.) it further says "You should pass XmlResolver to Transform() method"

Can anyone tell me how / where / why to add the XmlResolver ?

Thanks ! 


0
robc11 (5)
11/18/2006 1:17:56 PM
dotnet.xml 7266 articles. 0 followers. Follow

3 Replies
868 Views

Similar Articles

[PageSpeed] 49

Rob wrote:
> All I want to do is execute a simple transformation in VB.net.... I know 
> this has to be simple.
> 
> I tried the following as suggested by a web page I found....
> 
> Dim xslt as New XslTransform()
> 
> xslt.Load("Filename")
> xslt.Transform("InFile", "ResultFile")
> 
> This appears to be very straightforward to me.
> 
> However, this causes an error saying the code is obsolete... (I thought the 
> whole Framework version concept meant backwards compatability, but I guess 
> not.) it further says "You should pass XmlResolver to Transform() method"
> 
> Can anyone tell me how / where / why to add the XmlResolver ?

The method overload you use (Transform(String, String)) is obsolete in 
..NET 1.x. For security reasons you should use the overload 
Transform(String, String, XmlResolver)
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemXmlXslXslTransformClassTransformTopic8.asp>
that allows you to pass in a third argument, an XmlResolver, to have the 
XSLT document function enabled, or Nothing, to have the XSLT document 
function disabled. So the overload with two arguments has been obsoleted 
in .NET 1.x to allow for better control by your code whether the XSLT 
stylesheet is allowd to use the XSLT document function or not.

So use e.g.
   xslt.Transform("InFile", "ResultFile", New XmlUrlResolver())
to allow the stylesheet to use the XSLT document function or use
   xslt.Transform("InFile", "ResultFile", Nothing)
to disallow it.


-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/
0
mahotrash (1777)
11/18/2006 2:04:56 PM
Martin Honnen wrote:

> The method overload you use (Transform(String, String)) is obsolete in 
> .NET 1.x. 

Should be "is obsolete in .NET 1.1".

-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/
0
mahotrash (1777)
11/18/2006 2:21:51 PM
Thanks Martin...

"Martin Honnen" <mahotrash@yahoo.de> wrote in message 
news:%23Wv7LqxCHHA.3620@TK2MSFTNGP02.phx.gbl...
> Rob wrote:
>> All I want to do is execute a simple transformation in VB.net.... I know 
>> this has to be simple.
>>
>> I tried the following as suggested by a web page I found....
>>
>> Dim xslt as New XslTransform()
>>
>> xslt.Load("Filename")
>> xslt.Transform("InFile", "ResultFile")
>>
>> This appears to be very straightforward to me.
>>
>> However, this causes an error saying the code is obsolete... (I thought 
>> the whole Framework version concept meant backwards compatability, but I 
>> guess not.) it further says "You should pass XmlResolver to Transform() 
>> method"
>>
>> Can anyone tell me how / where / why to add the XmlResolver ?
>
> The method overload you use (Transform(String, String)) is obsolete in 
> .NET 1.x. For security reasons you should use the overload 
> Transform(String, String, XmlResolver)
> <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemXmlXslXslTransformClassTransformTopic8.asp>
> that allows you to pass in a third argument, an XmlResolver, to have the 
> XSLT document function enabled, or Nothing, to have the XSLT document 
> function disabled. So the overload with two arguments has been obsoleted 
> in .NET 1.x to allow for better control by your code whether the XSLT 
> stylesheet is allowd to use the XSLT document function or not.
>
> So use e.g.
>   xslt.Transform("InFile", "ResultFile", New XmlUrlResolver())
> to allow the stylesheet to use the XSLT document function or use
>   xslt.Transform("InFile", "ResultFile", Nothing)
> to disallow it.
>
>
> -- 
>
> Martin Honnen --- MVP XML
> http://JavaScript.FAQTs.com/ 


0
robc11 (5)
11/18/2006 2:22:12 PM
Reply:

Similar Artilces:

Delegating Exchange admin rights without using the wizard
Environment: Windows 2003 AD approx 2 dozen regional/departmental OUs Exchange 2003 SP2 running in Native mode Single site I need to delegate rights to a group that is responsible for creating user accounts and subsequently the mailboxes to go with them. I have done so suceesfully using the basic available options in the Delegation Wizard in AD. This same group also is responsible for managing the public folders. I had already moved the public folders to a seperate administrative group and again used the Delegation Wizard in Exchange to grant thier access to public fo...

ASP.NET page do not refresh
Hello, We have a workflow which has around 20 steps. We have UI which is designed in such a way that when we click RUN WORKFLOW button, we go to a page with all the 20 steps like below Step desc Status Step1: Export selected Employees Completed. Step2: Import all data Processing. Step3: Import some data Not started. ..... .... Step20: Archive Not started We use ASP.net with XML and XSLT and every time we call the method with stepno it executes a proc in the database and returns the status and step no, based on which we refresh the same page with next stepno...

Permission to use object denied.
I have a user on a Windows 2000 machine with user rights. The user is also running office 97. When he opens a excel speedsheet and Enable's Macros, he gets the following message; "Permission to use object denied". Hi Shannon............ It sounds like there is some sort of link to another workbook that a macro is calling and your user does not have rights to it. I think I would open the book without enabling the macros, and then take a look at them to see if one is trying to do such a thing. hth Vaya con Dios, Chuck, CABGx3 "Shannon" <Shannon507@aol.com>...

2 y-axis want to use a macro to tighten the range on both
is there a way i can tighten the range using a macro for two y-axis in the same chart. Please explain more. Do you want a secondary axis? Do you want to change the scale on the axis/ -- Bernard V Liengme www.stfx.ca/people/bliengme remove caps from email "HBS" <HBSroka@gmail.com> wrote in message news:1128363469.899724.294940@o13g2000cwo.googlegroups.com... > is there a way i can tighten the range using a macro for two y-axis in > the same chart. > ...

Use Extender to add fields to G\L Transaction Line
I am migrating an in-house developed G\L system to Dynamics GP (GP). Our G\L system has a description of 39 characters and an extended description of 50 characters. The G\L line description within GP line items is 31 characters. Our users are very attached to the descriptive data and want me to migrate the data into GP. Below are several questions and assumptions about using Extender: 1. Can I use Extender to add a Description1 field of 39 characters and an ExtendedDescription field of 50 characters to the G\L Transaction Line table GL10001? 2. If I can add fields to GL10001, I then ...

how to use today's date in a equation to caculate somebody's birth
If DOB is in A1, then =Today()-A1 should return the number of days. ******************* ~Anne Troy www.OfficeArticles.com "Guyster" <Guyster@discussions.microsoft.com> wrote in message news:6C36C64E-5777-4802-BB79-CEE3265DF320@microsoft.com... > ...

Using Mid Function with Pivot Table Calculated Item
Hi, I'm using excel 2007, I have a pivot table and I'm trying to create a calculated item, the formula for the Calculated item is: IF(MID('Project Title',7,1)="S", .20, .10) The Project Title field contains text and if the 7th character of the project title field is "S" I want the calculated item to return .20 otherwise ..10, but for some reason it is always returning .10. Am I doing something wrong here? Thanks. Simon ...

tender using outside gift card
Hi, does anyone know how to 'pass' the transaction total to an outside exe or dll? we are trying to process the transaction with a gift card (not an internal gift card, this GC is another company who wants to 'share' the gift card balance). basically RMS needs to pass the transaction total to the exe (or dll) which will query the balance of the gift card (over the internet and/or local DB). the exe/dll will query its database and return a yes or no to RMS any help would be appreciated. scott@kanesvending.com -- Walt You use what's called a "Hook" function t...

Writeoff Routine
When using the Writeoff Routine to write off underpayments, the system uses either the Customer's default AR account or the System Posting Account's default AR account. This becomes a problem if your AR distribution account on the invoice is different from the default AR account - One example would be if your company uses location-specific AR accounts (i.e. one AR account for each branch of the company). So, invoices for a customer may have varying AR accounts, depending on the company's location where that customer is doing business with. This effectively does not relieve ...

What formula do I use to find a percentage change?
I'm new to using Excel and I just need to find a formula to use that will calculate a percentage change from one cell to another. I think you can use this, Lizzy: =(A2-A1)/A1 ************ Anne Troy www.OfficeArticles.com "buzy lizzy" <buzy lizzy@discussions.microsoft.com> wrote in message news:CD2BACED-4C91-4204-A897-5801339C3D40@microsoft.com... > I'm new to using Excel and I just need to find a formula to use that will > calculate a percentage change from one cell to another. One way: =(A2-A1)/A1 formatted as a percentage, which can be simplified t...

Using Actions>Forward to send a contact mangles the attachment.
I have Outlook 2003 attached to Exchange 2003. When I try to forward a contact the attachment shows up at the recipient the only data that appears is whatever happens to be in the notes field of the contact. I have noticed no other anomalies. All of my searches on the Internet have been fruitless. I am not even sure how to phrase a search to find what I am looking for. Thanks, -Dave When you forward a contact that way you're sending it as an msg file which requires that the recipient also have Outlook to read it. You'd be better off exporting the contact to a VCard file and sen...

Using form control names in SQL
I am creating a query that retrieves data from one table and creates a second table. I want to name the columns in the new table using the contents of the controls from a form within the same mdb. The form will be open when this query is run, but I am having trouble creating and saving the query. Here is a sample of what I am trying to do...Any help is greatly appreciated!! Thanks SELECT IndividualHolidays.SU, IndividualHolidays.SSN, IndividualHolidays.Init, IndividualHolidays.LName, Max(IndividualHolidays.NewYearsDay) AS Forms!HolidayDatesEntry!NewYearsDay, Max(IndividualHolidays.AftNewY...

Using scanner in office97 applications
I have a HP 4370 ScanJet scanner attached to my PC by USB2.0 and it works OK. However, there is no scanner option under "Insert" --> "Picture" for my Office97 applications, e.g. Word97, Excel97. Apparently I need some sort of Office97 add-on. What and where is it on the Office97 CD? How do I add the scan option? Have you considered scanning it in first, saving the file, then inserting it? -- JoAnn Paules MVP Microsoft [Publisher] Tech Editor for "Microsoft Publisher 2007 For Dummies" "PSRumbagh" <PSRumbagh@discussions.m...

OL 2003- Rules- How to use "and" instead of "or"
I enter the first phrase to look for and then add the second phrase, it adds it as an OR statement instead of an AND statement. Is it possible to do this? So it looks for "jump" AND "ball"??? not "jump" or "ball" Thanks Dan As far as I know, no. The conjunction used is always 'or' "Dan Sole" <dansole@dkdk.com> wrote in message news:r998b1h6kuh9bpfa8igr9qqpng4p1v6pap@4ax.com... >I enter the first phrase to look for and then add the > second phrase, it adds it as an OR statement instead of an AND > statement. > &...

using a "read receipt" for emails sent through Publisher
I'm using Outlook Express to send my email newsletter. Outlook Express itself has "read receipt" functionality. However, when I attempt to send my message through Publisher, I don't see "read receipt" as an option. Ideas? Michelle "mlemblem" <mlemblem@discussions.microsoft.com> wrote in message news:B015970F-4DDA-4D2B-9C4A-5215E3C84814@microsoft.com... > I'm using Outlook Express to send my email newsletter. Outlook > Express > itself has "read receipt" functionality. However, when I attempt to > se...

Re: Stored Proc Question: Use ad hoc Where Clause
Ive got a question on how to implement the following: I Have an sp_ that accepts two parameters. Here's essentially what the sp looks like: /****************************************************************************************************** Create Procedure sp_SearchResults @Status_ID Int, @Location_ID Int As Declare @SqlString varchar(100); /** Check values passed in to sp and based off these construct @sqlString to use in Where clause **/ If @Status_ID <> 0 Begin Select @SqlString = 'Where Mytable....

.NET 2003 MFC/CRT redistributable?
Where can I obtain the .NET 2003 MFC & CRT redistributable? I need to run a program written in Visual C++ 2003 on an older OS. Trevor wrote: > Where can I obtain the .NET 2003 MFC & CRT redistributable? I need to > run a program written in Visual C 2003 on an older OS. search at ms.com for the .net c toolkit, this is the free compiler and has an .net framework, which is needed to run such programmes; Trevor wrote: > Where can I obtain the .NET 2003 MFC & CRT redistributable? I need to > run a program written in Visual C++ 2003 on an older OS. I don't hav...

VB list box print reports. Known # of columns. # rows unknown
I have a Listbox with a number of reports. I know the number of columns in the report but not the number of rows in the report. This will vary based on data. How do I set the print area in VB when I don't know the number of rows. One way, assuming your data begins in cell A1. Set rng = ActiveSheet.Range(Cells(1, 1), _ Cells(UsedRange.Rows.Count, UsedRange.ColumnsCount)) ActiveSheet.PageSetUp.PrintArea = rng "Richard" <Richard@discussions.microsoft.com> wrote in message news:A660B32E-BEB0-4EFF-A146-0943407D4F91@microsoft.com... >I have...

display row indicator when using scroll bar in excel 2003 #2
Excel 2000 would display the row number as the used the scroll bar to the right of the spreadsheet. Can Excel 2003 be set to duplicate this behavior? Thanks. I use xl2002. When I use the scrollbar in xl2002, I see the display changing. I bet MS thought that if you could actually see the row, you wouldn't need that tip. Scott wrote: > > Excel 2000 would display the row number as the used the scroll bar to the > right of the spreadsheet. Can Excel 2003 be set to duplicate this behavior? > Thanks. -- Dave Peterson ec35720@msn.com ...

What is a macro, how to create and use it?
I have started experimenting with MS Excel and would be like to know about Macros, its use and how to create one? Try this for a start http://www.mvps.org/dmcritchie/excel/getstarted.htm Mike "ADNAN TEEJA" wrote: > I have started experimenting with MS Excel and would be like to know about > Macros, its use and how to create one? > If you're not familiar with VBA and macros, see David McRitchie's site for more on "getting started". http://www.mvps.org/dmcritchie/excel/getstarted.htm or Ron de De Bruin's site on where to store macros. htt...

Using a MS FlexGrid
Hi, I very new to MFC programming so please bear with me. 1) I have dropped a MS FlexGrid onto a dialog which shows up correctly when I run the app but I cannot seem to be able to edit any cells. I have set the enabled property to true 2) I have have a static label which I would like to change at runtime. For example I would like the label to show the row and column I have clicked on in the grid. How can I do this? 3) Also on the OnKeyUpGrid event I would like to test that the Return key has been pressed and then be able to do something like change the cell backcolor. 4) How ca...

Lineseparator in XML file to split long XSL to parts
I would like to but XSL clauses to XML file and retrieve XSL clauses with keys. How can I separate XSL clause into different XSL rows? I mean something like below. This in XML <add key="Key1" value="<xsl:value-of select="/VARIABLE/>" <xsl:choose> <xsl:when test="ORDER_NUMBER == ''> <value>Y</value> </xsl:when> <xsl:otherwise> <value>N</v...

How to get full address in "To" using first few letters of name
At one time, I was able to automatically get the full email address automatically entered in the "To' line after entering just the first few letters of the contact name. Now this only happens when I send another message to the same person I previously sent. How can I get this to work for all contacts? Autocompletion has never used your Contacts. It only uses a cache of previous recipients. -- Russ Valentine "bobengel" <bobengel@discussions.microsoft.com> wrote in message news:D279BE8E-33AE-40EC-9E28-EB614B8A292C@microsoft.com... > At one time, I...

Dial-up Connection Slows in Windows XP Pro when using Outlook (Send & Receive),
My dial-up connection seems to stop when using Outlook 2002 (Send & Receive) to download emails even though there are a number of messages to be downloaded. When Internet Explorer is used (to go to a web site or refresh), the Outlook data transfer rate improves significantly. Typically, for an email session (downloading about 10 messages), I have to hit the refresh button in Internet Explorer twice or thrice before all the messages are retrieved. I have XP Pro SP1, Dell Latitute C640. Outlook Express from my Desktop (Windows ME) works fine so the problem is probably not with t...

array from c++ to vb
Hi, i have a C++ DLL used by a vb program, how can i create in a c++ function an array and let vb use this array???? i'm i obliged to use SafeArrays??? i create the safearray, but vb don't see the data..... Private Declare Function MyCppFunction Lib "Mydll.dll" (ByRef tabl() As Double) As Boolean sub test() ..... Dim matable() As Double MyCppFunction matable() ..... end sub matable is empty bool __declspec(dllexport) CALLBACK MyCppFunction (LPSAFEARRAY FAR *saFineContours) { SAFEARRAY* psa; double HUGEP * prData; SAFEARRAYBOUND rgsabound...