Skip to Content
Using XML with Legacy Business Applications
book

Using XML with Legacy Business Applications

by Michael C. Rawlins
August 2003
Intermediate to advanced content levelIntermediate to advanced
624 pages
15h 3m
English
Addison-Wesley Professional
Content preview from Using XML with Legacy Business Applications

write in CSVRowReader.cpp

Let's look at how we create the Text Node and append it using MSXML from C++.

//  Text Node <- Call Document's createTextNode method
//    with text from ColumnArray[ColumnNumber]
//  MSXML createTextNode specifies a BSTR for the
//    argument. Visual C++ is usually happy to convert
//    a char * but wanted an explicit cast for this
//    array element.
IXMLDOMTextPtr spTexText = spDocOutput->createTextNode(
  (char *) cColumnArray[iColumnNumber]);

//  Column Element <- Call Column Element's appendChild
//    to add Text Node as child
spEleColumn->appendChild(spTexText);

Again, this is very similar to the Java implementation. A “gotcha” here, as noted in the code comments, is that createTextNode requires that the text argument be a ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning XML with C# 7: XML Processing and Data Access for C# Developers

Beginning XML with C# 7: XML Processing and Data Access for C# Developers

Bipin Joshi
XML Hacks

XML Hacks

Michael Fitzgerald
XML Unleashed

XML Unleashed

Michael Morrison
XML in a Nutshell, 3rd Edition

XML in a Nutshell, 3rd Edition

Elliotte Rusty Harold, W. Scott Means

Publisher Resources

ISBN: 0321154940Purchase book