LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

LabWindows/CVI 2012 how to convert a xml to char

Hi guys

 

here is my code, I'm learning about XML

I can create a xml file now I'm wondering is there a way to convert testxmldocument into char array(or string) directly?

================================================================

char buffer[256];
char path[256] = "C:\\test.xml";
CVIXMLDocument testxmldocument;
CVIXMLStatus status;
status = CVIXMLNewDocument("Test1", &testxmldocument);
status = CVIXMLSaveDocument(testxmldocument, 1, path);
CVIXMLGetErrorString(status, buffer, sizeof(buffer));
CVIXMLDiscardDocument(testxmldocument);

================================================================

Thanks!

 

Jacky Liao

0 Kudos
Message 1 of 3
(2,540 Views)

I must admit that I don't get the point...

An XML file actually is a text file: you could open and read it with normal file I/O functions like fopen (), fread ()...: is this what you want to do?

If on the contrary you want to get the active content of the document leaving away all open and close tags (<item> and </item>) you can do that with cvi xml instrument, which it appears you are already using. So: what is your goal?

It seems to me you should explain better your question.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 3
(2,529 Views)

Look here: How can I access the XML document in memory?

 

Regards, Marcel

Message 3 of 3
(2,528 Views)