company logo

XMLString :: nextElement - Get next element

XMLString provides a kind of cursor functionality, which allows iterating through subordinates elements.

void   fragment(XMLString &xstring) {  // OSI implementation

VARIABLES

  XMLString    &xelement;

PROCESS

  xelement &= xstring.element("author"); // look for first author

  while ( xelement.isValid() ) {

    // do something

    xelement &= xstring.nextElement("author");

  }

}

Notes:

The function relies on the element cursor in the XMLString, which may be changed when calling element() or nextElement().

Return value:   - internal feature (not documented) ( odaba::utils::XMLString  )

Implementation details

odaba::utils::XMLString XMLString  :: nextElement ( odaba::String &sName )

The function returns the next element with the element name passed in sName. The first element may be selected calling element(). The function returns the next XML element as XMLString. When no more elements with the name passed in sName could be located, the function returns an invalid XMLString.

  • sName - Name