You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Awasthi, Anand" <An...@bmc.com> on 2001/06/18 16:58:12 UTC
problem in DOMPrint.cpp
Hi,
I am trying to run the DOMPrint.cpp sample for generating XML from DOM
tree. this sample declares and defines
three following functions for this purpose:
ostream& operator<<(ostream& target, const DOMString& toWrite);
XMLFormatter& operator<< (XMLFormatter& strm, const DOMString& s);
and
ostream& operator<<(ostream& target, DOM_Node& toWrite); // this function
writes DOMtree data into xml format in ostream.
in my main function i am calling above as follows :
DOM_Node node = parser->getDocument();
ostream os ;
cout << os << node;
but when i compile above code, i get following error msg :
error C2248: 'ostream::ostream' : cannot access protected member
declared in class 'ostream'
see declaration of 'ostream::ostream'
could some pls tell why its happening and what i sohlud do to solve this
porblem ??
what is the correct way to call the above function in main() ??
thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
RE: problem in DOMPrint.cpp
Posted by Evert Haasdijk <ev...@zukkespijkers.nl>.
Anand,
If you want to write to cout, just use
DOM_Node node = parser->getDocument();
cout << node;
ta, evert
> -----Original Message-----
> From: Awasthi, Anand [mailto:Anand_Awasthi@bmc.com]
> Sent: Monday, June 18, 2001 16:58 PM
> To: 'xerces-c-dev@xml.apache.org'
> Subject: problem in DOMPrint.cpp
>
>
> Hi,
>
> I am trying to run the DOMPrint.cpp sample for generating XML from DOM
> tree. this sample declares and defines
>
> three following functions for this purpose:
>
> ostream& operator<<(ostream& target, const DOMString& toWrite);
> XMLFormatter& operator<< (XMLFormatter& strm, const DOMString& s);
>
> and
>
> ostream& operator<<(ostream& target, DOM_Node& toWrite); // this function
> writes DOMtree data into xml format in ostream.
>
>
>
> in my main function i am calling above as follows :
>
>
> DOM_Node node = parser->getDocument();
> ostream os ;
> cout << os << node;
>
>
>
> but when i compile above code, i get following error msg :
>
>
> error C2248: 'ostream::ostream' : cannot access protected member
> declared in class 'ostream'
> see declaration of 'ostream::ostream'
>
>
> could some pls tell why its happening and what i sohlud do to solve this
> porblem ??
> what is the correct way to call the above function in main() ??
>
>
> thanks
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
RE: problem in DOMPrint.cpp
Posted by Erik Rydgren <er...@mandarinen.se>.
Ehh? cout << os?
Print an ostream on stdout? Is that really what you wanna do? ;)
I think you were aiming at just:
os << node;
I know you can go totally blind when debugging your own code.
Regards
Erik Rydgren
-----Original Message-----
From: Awasthi, Anand [mailto:Anand_Awasthi@bmc.com]
Sent: den 18 juni 2001 16:58
To: 'xerces-c-dev@xml.apache.org'
Subject: problem in DOMPrint.cpp
Hi,
I am trying to run the DOMPrint.cpp sample for generating XML from DOM
tree. this sample declares and defines
three following functions for this purpose:
ostream& operator<<(ostream& target, const DOMString& toWrite);
XMLFormatter& operator<< (XMLFormatter& strm, const DOMString& s);
and
ostream& operator<<(ostream& target, DOM_Node& toWrite); // this function
writes DOMtree data into xml format in ostream.
in my main function i am calling above as follows :
DOM_Node node = parser->getDocument();
ostream os ;
cout << os << node;
but when i compile above code, i get following error msg :
error C2248: 'ostream::ostream' : cannot access protected member
declared in class 'ostream'
see declaration of 'ostream::ostream'
could some pls tell why its happening and what i sohlud do to solve this
porblem ??
what is the correct way to call the above function in main() ??
thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org