DOMString has no member functions called print() or println().  You need to
transcode the string and use that value.

void
printValue(DOM_Node node, ostream& stream)
{
    if (node.isNull() == false)
    {
        char* const data = node.getNodeValue().transcode();

        stream << data;

        delete [] data;
    }
}

Remember that getNodeValue() doesn't always return any data.  For instance,
elements and entity nodes have no node value.  The "value" of the node is
stored in its text node children.

You should look at the DOMPrint sample for the details.

Dave



                                                                                       
                       
                    "Awasthi,                                                          
                       
                    Anand"               To:     "'[EMAIL PROTECTED]'"       
                       
                    <Anand_Awasth        <[EMAIL PROTECTED]>                 
                       
                    [EMAIL PROTECTED]>           cc:     (bcc: David N Bertoni/CAM/Lotus)      
                       
                                         Subject:     RE: sample for down casting 
DOM_Node to DOM_Entity ??   
                    06/08/2001                                                         
                       
                    05:32 PM                                                           
                       
                    Please                                                             
                       
                    respond to                                                         
                       
                    xerces-c-dev                                                       
                       
                                                                                       
                       
                                                                                       
                       



its wrong

should be

node.getNodeValue().print();

but even that does not work ??



-----Original Message-----
From: Adams, David [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 08, 2001 4:31 PM
To: '[EMAIL PROTECTED]'
Subject: RE: sample for down casting DOM_Node to DOM_Entity ??


Try this:
DOM_Node node;
cout << node.getNodeValue().print(); // no linefeed
cout << node.getNodeValue().println(); // linefeed



> -----Original Message-----
> From:         Awasthi, Anand [SMTP:[EMAIL PROTECTED]]
> Sent:         Friday, June 08, 2001 3:58 PM
> To:           '[EMAIL PROTECTED]'
> Subject:           RE: sample for down casting DOM_Node to DOM_Entity ??
>
> ok....now how do i print the Node value on console...
> could you pls give some exapmle code ??
>
> or
>
> getNodeValue().transcode() is the only way ??
>
>
>
>
>
>
> -----Original Message-----
> From: Adams, David [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 08, 2001 3:55 PM
> To: '[EMAIL PROTECTED]'
> Subject: RE: sample for down casting DOM_Node to DOM_Entity ??
>
>
> Yes, you should be safe doing it that way. That eliminates my earlier
> theory
> about your screen memory being corrupt. Back to the debugging board on
> that
> one.
>
>
> > -----Original Message-----
> > From:       Awasthi, Anand [SMTP:[EMAIL PROTECTED]]
> > Sent:       Friday, June 08, 2001 3:50 PM
> > To:         '[EMAIL PROTECTED]'
> > Subject:         RE: sample for down casting DOM_Node to DOM_Entity ??
> >
> > yeah i did that already and then i used old style casting and
> > i think that should be safe at least this case ...am i correct ??
> >
> >
> >
> > -----Original Message-----
> > From: Adams, David [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, June 08, 2001 3:49 PM
> > To: '[EMAIL PROTECTED]'
> > Subject: FW: sample for down casting DOM_Node to DOM_Entity ??
> >
> >
> > > Also, you may want to use the DOM_Node method DOM_Node::getNodeType()
> > and
> > > do
> > > a switch on the result to find out what you are really dealing with.
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to