Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: XML- Add child element

From: "Sam Hobbs" <samuel@------.--.---_------_------_--_----->
To: 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.





transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent