Re: multiple namespaces?

Stefan Haustein <[email protected]> Thu, 23 Jan 2003 15:06:01 +0100
Newsgroups gmane.comp.java.enhydra.kxml
Organization Univ. Dortmund FB 4 LS 8
Message-ID <[email protected]>

Wolfgang Beer wrote:
> Hi,
> 
> Can anybody tell me how to get out multiple namespaces from a ParseEvent?
> e.g.:
> 
> <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" 
> xmlns:Soap="http://schemas.xmlsoap.org/wsdl/soap/" />

For kXML 2 / xmlpull, this is possible the following way:

for (int i = getNamespaceCount(getDepth()-1); i < 
getNamespaceCount(getDepth); i++) {
   System.out.println ("new namespace: 
"+getNamespacePrefix(i)+":"+getNamespaceUri(i));
}

Best,
Stefan







-- 
Stefan Haustein
Univ. Dortmund, FB 4, LS 8   tel: +49 231 755 2499
Baroper Str. 301             fax: +49 231 755 5105
D-44221 Dortmund (Germany)   www-ai.cs.uni-dortmund.de