Skip to content

Commit

Permalink
Changed to treat the same type in different namespaces as the same (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
dazzhe committed Jul 25, 2022
1 parent 5d4a065 commit 7d1ba03
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion sources/src/parser/nodetypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,23 @@ namespace citygml {
}
}

return InvalidNode;
std::string nodeName = lowerName;

size_t pos = nodeName.find_first_of(":");
if (pos != std::string::npos) {
nodeName = nodeName.substr(pos + 1);
} else {
// node has no prefix... try with core prefix
return getXMLNodeFor("core:" + name);
}

auto it = nodeNameTypeMap.find(nodeName);

if (it == nodeNameTypeMap.end()) {
return InvalidNode;
} else {
return *it->second;
}
}

#define DEFINE_NODE( prefix, elementname ) NodeType::XMLNode NodeType::prefix ## _ ## elementname ## Node;
Expand Down

0 comments on commit 7d1ba03

Please sign in to comment.