Click here to Skip to main content
16,010,360 members
Home / Discussions / C#
   

C#

 
GeneralOffice Programming with C# Pin
Member 140011328-Oct-04 7:02
Member 140011328-Oct-04 7:02 
GeneralRe: Office Programming with C# Pin
Heath Stewart28-Oct-04 15:35
protectorHeath Stewart28-Oct-04 15:35 
GeneralIIS server Pin
ppp00128-Oct-04 6:41
ppp00128-Oct-04 6:41 
GeneralRe: IIS server Pin
Alex Korchemniy28-Oct-04 9:59
Alex Korchemniy28-Oct-04 9:59 
GeneralRe: IIS server Pin
Heath Stewart28-Oct-04 15:22
protectorHeath Stewart28-Oct-04 15:22 
GeneralAVI to WMV Pin
ee9903528-Oct-04 6:00
ee9903528-Oct-04 6:00 
GeneralRe: AVI to WMV Pin
Heath Stewart28-Oct-04 15:10
protectorHeath Stewart28-Oct-04 15:10 
GeneralXslTransform object protection level problem Pin
kroakdammit28-Oct-04 5:48
kroakdammit28-Oct-04 5:48 
Hi,

I have been developing a test application in Windows Forms (C#) to integerate with a Web Service to return a formatted XML document and then apply an XSLT template to convert the XML into a useful format.

Within the Windows Form enviorment I have had no problems, however when ported over to a class file i keep getting a protection error with the XslTransform object. (code snippet of the method that applies the transform below):

<br />
<font color="Green"><br />
/// Converts an imported XML file into FFW XML format. Expects the file <br />
/// to load from and the file to save to (strings) as parameters.</font><br />
private void WriteFFWImportFile(string strFileToLoad, string strFileToSave)<br />
{<br />
<font color="Green">//create a transform object to load the xslt conversion template.</font><br />
XslTransform myXsl = new XslTransform();<br />
myXsl.Load(ConfigurationSettings.AppSettings["XsltImportTransform"]);<br />
<br />
<font color="Green">//add the file imported as a parameter of the xslt for linking purposes</font><br />
XsltArgumentList myArgs = new XsltArgumentList();<br />
myArgs.AddParam("ParsolImport","",strFileToLoad);<br />
			<br />
<font color="Green">//create streams to allow us to write the file</font><br />
Stream	  fs		= new FileStream(strFileToSave,FileMode.Create);<br />
XmlWriter writer	= new XmlTextWriter(fs,System.Text.Encoding.Unicode);<br />
			<br />
<font color="Green">//load the import file</font><br />
XmlDocument myXml = new XmlDocument();<br />
myXml.Load(strFileToLoad);<br />
myXsl.Transform(myXml,myArgs,writer,null);<br />
	<br />
<font color="Green">//dispose of in memory objects</font><br />
writer.Close();<br />
fs.Close();<br />
}


Basically the code that I ported into a Class is exactly the same apart from where I am calling ConfigurationSettings.AppSettings["XsltImportTransform"] in WinForms - I have exposed via a property of the Class.

When I attempt to build the solution I get:
"Integration.cs(122): 'System.Xml.Xsl.XslTransform.XslTransform(object)' is inaccessible due to its protection level". I don't understand why this is happening ... is it a bug Confused | :confused:


Paul Griffiths
.Net Developer
GeneralRe: XslTransform object protection level problem Pin
Heath Stewart28-Oct-04 15:05
protectorHeath Stewart28-Oct-04 15:05 
GeneralRe: XslTransform object protection level problem Pin
kroakdammit28-Oct-04 23:24
kroakdammit28-Oct-04 23:24 
GeneralRe: XslTransform object protection level problem Pin
kroakdammit28-Oct-04 23:33
kroakdammit28-Oct-04 23:33 
GeneralCopy a piece of an Image Pin
delemur28-Oct-04 5:20
delemur28-Oct-04 5:20 
GeneralRe: Copy a piece of an Image Pin
Christian Graus28-Oct-04 9:36
protectorChristian Graus28-Oct-04 9:36 
GeneralRe: Copy a piece of an Image Pin
Alex Korchemniy28-Oct-04 9:56
Alex Korchemniy28-Oct-04 9:56 
QuestionHow to do this in C#? Pin
momer28-Oct-04 5:02
momer28-Oct-04 5:02 
AnswerRe: How to do this in C#? Pin
Christian Graus28-Oct-04 9:39
protectorChristian Graus28-Oct-04 9:39 
GeneralRe: How to do this in C#? Pin
Mike Dimmick28-Oct-04 10:47
Mike Dimmick28-Oct-04 10:47 
GeneralRe: How to do this in C#? Pin
momer28-Oct-04 14:57
momer28-Oct-04 14:57 
GeneralRe: How to do this in C#? Pin
Christian Graus28-Oct-04 15:01
protectorChristian Graus28-Oct-04 15:01 
GeneralRe: adding parameter to eventhandler Pin
sreejith ss nair28-Oct-04 2:18
sreejith ss nair28-Oct-04 2:18 
GeneralRe: adding parameter to eventhandler Pin
Stefan Troschuetz28-Oct-04 2:44
Stefan Troschuetz28-Oct-04 2:44 
GeneralRe: adding parameter to eventhandler Pin
Nick Parker28-Oct-04 3:35
protectorNick Parker28-Oct-04 3:35 
GeneralRe: adding parameter to eventhandler Pin
Member 147654828-Oct-04 3:51
Member 147654828-Oct-04 3:51 
GeneralRe: adding parameter to eventhandler Pin
Nick Parker28-Oct-04 5:01
protectorNick Parker28-Oct-04 5:01 
GeneralRe: adding parameter to eventhandler Pin
Anonymous28-Oct-04 6:08
Anonymous28-Oct-04 6:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.