Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 214
  • Last Modified:

error on: XslTransform var_xsl = new XslTransform();

Hi experts
I am facing problem below:
I have following code and it gives an error on first line

-------------------------------------
XslTransform var_xsl = new XslTransform();
var_xsl.Load("test.xsl");
XmlDocument var_xml = new XmlDocument();
var_xml.LoadXml(var_some_xml);
StringWriter var_str_writer = new StringWriter();
var_xsl.Transform(var_xml, null, var_str_writer);

------------------------------------
error:
Object reference not set to an instance of an object

Please can anybody help me?

Thanks
0
Brutso
Asked:
Brutso
  • 2
  • 2
2 Solutions
 
123654789987Commented:
I tried u'r code it is not  giving any error in the first line. It lookss fine.
0
 
Razzie_Commented:
Are you SURE you get that error on that first line of code? I can't think of any reason why it give an error, at least not the error message you get. The more I think about it, the more I think it's impossible. Please check the line and code of your error message!
0
 
BrutsoAuthor Commented:
Oh, Sorry experts.
I found bug in my script. It's in

var_xsl.Load("test.xsl");

the URL is wrong.

I agree to give poins to both experts: 123654789987 and Razzie_, but i don't know how to make it.
0
 
Razzie_Commented:
You can click 'split points' and split them in half OR,

ask in the Community TA to have your points refunded because you found the answer yourself.
0
 
BrutsoAuthor Commented:
ok. thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now