•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the XML, XSLT and XPATH section within the Software Development category of DaniWeb, a massive community of 374,006 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,766 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our XML, XSLT and XPATH advertiser:
Views: 2437 | Replies: 1
![]() |
| |
•
•
Join Date: Apr 2008
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
Please help me how to write into XML file using VC++ 6.0
this is example code where i am not able to write the data into XML File
this is ScanComputer.cpp where i am trying to try into XML file
I am getting this output like name=003BEC20 instead of getting actual values of the variable
OUTPUT
this is example code where i am not able to write the data into XML File
this is ScanComputer.cpp where i am trying to try into XML file
c++ Syntax (Toggle Plain Text)
void CScanComputer::saveParameters(const char *filename) { ParamIO outXml;//ParamIO.h is pasted below this writeParameters(outXml); outXml.writeFile(filename); } void CScanComputer::writeParameters(ParamIO &outXml) { outXml.write("PARAMS:NAME",fname1);//fname1 is the string variable where i am getting the value outXml.write("PARAMS:EMAILID",Path1);//Path1i s the string variable where i am getting the value outXml.write("PARAMS:DOB",cell2);//cell2is the string variable where i am getting the value }
c++ Syntax (Toggle Plain Text)
#include "ParamIO.h" void ParamIO::parseAccess(const char *str, std::vector<std::string> &access) { access.clear(); if(str == 0 || strlen(str) == 0) { return; } std::istringstream stream(str); char *char_str = new char[strlen(str)]; while(stream.getline(char_str, strlen(str), ':')) { access.push_back(std::string(char_str)); } delete[] char_str; } void ParamIO::writeStream(std::ostream &os) const { _treeBuilder.print(os); } void ParamIO::writeFile(const char *filename) const { std::ofstream os(filename); writeStream(os); os.close(); }
I am getting this output like name=003BEC20 instead of getting actual values of the variable
OUTPUT
xml Syntax (Toggle Plain Text)
<PARAMS> <NAME>003BEC20</NAME> //instead of the value of the string variable it is taking as 003BEC20 etc <EMAILID>01970328</EMAILID> <DOB>003BEEA0</DOB> </PARAMS>
Last edited by peter_budo : Apr 1st, 2008 at 7:18 am. Reason: Keep It Organized - please use [code] tags
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb XML, XSLT and XPATH Marketplace
- Read XML File in C/C++ (C++)
- Convert an XML file into a Binary Format File (C#)
- read xml file and display to many text box (C#)
- xml remove <br /> tag (RSS, Web Services and SOAP)
- Read and parse and xml file from an ftp server (PHP)
- xml appending (C#)
Other Threads in the XML, XSLT and XPATH Forum
- Previous Thread: XML Linking !!!
- Next Thread: SAML Help


Hybrid Mode