HeinzSchmelter
HeinzSchmelter

Reputation: 3

Trying to load String with pXMLDom in c++ with MSMXL

I am trying to use XSLT to convert some XML into HTML. I used the standard code seen here:

https://msdn.microsoft.com/en-us/ie/ms766389(v=vs.100)

It works perfectly fine. It doesnt need to be fancy.

Now I want to have the three files (XML Input, XSL Input and XML Output) as variables inside the code and not hardcoded.

The problem lies within this statement

pXMLDom->load(L"stocks.xml");

I can't figure out how to replace the (L"stocks.xml") part with a variable. I tried working with strings and wide chars, but my knowledge in C++ is pretty limited to what I did 10-15 years ago. If someone could just give me a push in the right direction, I would appreciate it.

Upvotes: 0

Views: 39

Answers (1)

SoronelHaetir
SoronelHaetir

Reputation: 15172

std::wstring strFileName{L"stocks.xml"};
pXmlDom->Load(strFileName.c_str());

Upvotes: 1

Related Questions