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 "Gulko, Yan" <YG...@dlj.com> on 2000/07/12 22:32:39 UTC

null in Xerces-C

Xerces-C documentation refers to 'null' returned by numerous fuctions. While
null works like that in Java, what is the C++ equivalent?

For instance, if I have a code sample:

	DOM_Node		currentNode;
	DOM_Element		rootElement;

	// Start with the first child node, and loop over all the nodes
	currentNode = rootElement.getFirstChild();
	
	// loop over all the child nodes
	while( currentNode != null )
	{
		// do smth
	}

how can I make it work in C++?


Yan Gulko
ISG, Inc.
	



Re: null in Xerces-C

Posted by Joe Polastre <jp...@apache.org>.
null works for DOMStrings and the like.  It may even work for DOM_Nodes, but
I'm not sure (I know that it does work for the underlying impl classes, but
you shouldn't have to worry about that)

 DOM_Node currentNode;
 DOM_Element rootElement;

 // Start with the first child node, and loop over all the nodes
 currentNode = rootElement.getFirstChild();

 // loop over all the child nodes
 while( !currentNode.isNull() )
 {
 // do smth
 }

-Joe Polastre  (jpolast@apache.org)
IBM Cupertino, XML Technology Group


----- Original Message -----
From: "Gulko, Yan" <YG...@dlj.com>
To: <xe...@xml.apache.org>
Sent: Wednesday, July 12, 2000 1:32 PM
Subject: null in Xerces-C


> Xerces-C documentation refers to 'null' returned by numerous fuctions.
While
> null works like that in Java, what is the C++ equivalent?
>
> For instance, if I have a code sample:
>
> DOM_Node currentNode;
> DOM_Element rootElement;
>
> // Start with the first child node, and loop over all the nodes
> currentNode = rootElement.getFirstChild();
>
> // loop over all the child nodes
> while( currentNode != null )
> {
> // do smth
> }
>
> how can I make it work in C++?
>
>
> Yan Gulko
> ISG, Inc.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>
>