get Namespace Count
Returns the numbers of elements in the namespace stack for the give depth.
If namespaces are not enabled, 0 is returned.
NOTE: when the parser is on END_TAG, then it is allowed to call this function with getDepth()+1 argument to retrieve positions of namespace prefixes and URIs that were declared on corresponding START_TAG.
NOTE: to retrieve list of namespaces declared in current element:
val pp = ...
val nsStart = pp.getNamespaceCount(pp.getDepth()-1)
val nsEnd = pp.getNamespaceCount(pp.getDepth())
for (i in nsStart until nsEnd) {
val prefix = pp.getNamespacePrefix(i);
val ns = pp.getNamespaceUri(i);
// ...
}Content copied to clipboard