Hi everyone,
I just have a small but annoying C++ problem. It has
to do with Xerces imported code, but I have
experienced it, before, so I kind of doubt that it is
a problem with the actual code. If this is an
inappropriate question for this forum, please ignore.
When copying and pasting the following code from
DOMPrint.cpp (located from the middle to the end of
the source file, for reference):
/*star code snippet
//
---------------------------------------------------------------------------
// ostream << DOM_Node
//
// Stream out a DOM node, and, recursively, all of
its children. This
// function is the heart of writing a DOM tree out as
XML source. Give it
// a document node and it will do the whole thing.
//
---------------------------------------------------------------------------
/*## line 184 of my program is the next one...##*/
ostream& operator<<(ostream& target, DOM_Node&
toWrite)
{
// Get the name and value out for convenience
DOMString nodeName = toWrite.getNodeName();
DOMString nodeValue = toWrite.getNodeValue();
unsigned long lent = nodeValue.length();
// [continue copy and paste from this point in
DOMPrint.cpp until EOF - the rest is omitted from
this email as it is contained in one of the samples]
*/ end code snippet
When inserting this code into completely
clean-compiling code, where there is already present a
document tree derived from the sample on how to build
and count a DOMtree, the following errors are thrown:
[C++ Error] testXML.cpp(184): E2108 Improper use of
typedef 'ostream'
[C++ Error] testXML.cpp(184): E2108 Improper use of
typedef 'ostream'
[C++ Error] testXML.cpp(184): E2451 Undefined symbol
'target'
[C++ Error] testXML.cpp(184): E2108 Improper use of
typedef 'DOM_Node'
[C++ Error] testXML.cpp(184): E2451 Undefined symbol
'toWrite'
[C++ Error] testXML.cpp(184): E2268 Call to undefined
function '<<'
[C++ Error] testXML.cpp(185): E2379 Statement missing
;
I have searched around and found a few instances of
new users coming up to this problem, or one similar to
it, but none where it explains it or its resolution.
Any help or redirection would be appreciated.
Thanks!
~Rhys Black
__________________________________________________
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]