Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - XML- Add child element [Thread Next] Re: XML- Add child elementTo: NULL Date: 6/7/2008 2:00:00 PM As Joe has implied, you need to ensure that there are no errors being ignored. I do understand that you might have removed the error-checking code, but if you are not checking for errors, then please do that. For problems such as this, when possible, create a small program that re-creates the problem. Make the program as small as possible; if it can't be reduced to a small program then it is better to use just snippets as you have already done here. I think it is very reasonable to suggest that you create a small program that re-creates the problem, since I have done that myself when I have had problems. There is however a lot of code that is not shown; for example, VariantToType is not anything from the Windows API (right?). That problem and many other possible problems would result in an error being reported, so before posting more code, please ensure your program is not ignoring an error code. For this question, you can probably create a program that is less than 20 lines of code. Also provide a small data file. If your progam is not getting errors or if you can't understand the errors, then consider creating a small sample program that can be compiled as-is by me or someone else. I don't have access to VC after version 6, but your code appears to be compatible with VC 6. "Popu" <Popu@d...> wrote in message news:4A71A720-64D2-49AE-8D3F-C2D2BBDBFADB@m...... > Hi, I am working with C++ and MSXML 6.0, I am able to read and write(new) > an > XML file, but I am not able to edit using MSXML. > For ex: To add a child element to my existing XML file I: > > Load the xmldoc: hr = pXMLDoc->load(bstrFileName,&isSuccess); > ... > hr = pXMLDoc->selectSingleNode(bstr, &pXMLNode); > NodeType = VariantToType(NODE_ELEMENT); > hr = pXMLDoc->createNode(NodeType,bstr,NULL,&pXMLChildNode); > hr = pXMLNode->appendChild(pXMLChildNode,&pXMLInsertedNode); > > > I am getting an error here. I am not able to append child to the node > which > i got from the selectsinglenode method. > any help is appreciated. | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
