| 167 | //========================== |
| 168 | |
| 169 | XML_NodePtr XML_Node::GetNamedElement ( XMP_StringPtr nsURI, XMP_StringPtr localName, size_t which /* = 0 */ ) |
| 170 | { |
| 171 | |
| 172 | for ( size_t i = 0, vLim = this->content.size(); i < vLim; ++i ) { |
| 173 | XML_Node * childPtr = this->content[i]; |
| 174 | if ( childPtr->ns != nsURI ) continue; |
| 175 | if ( strcmp ( localName, childPtr->name.c_str()+childPtr->nsPrefixLen ) != 0 ) continue; |
| 176 | if ( which == 0 ) return childPtr; |
| 177 | --which; |
| 178 | } |
| 179 | |
| 180 | return 0; /// Not found. |
| 181 | |
| 182 | } // XML_Node::GetNamedElement |
| 183 | |
| 184 | // ================================================================================================= |
| 185 | // DumpNodeList |