Here is my code:
path = wsdlPath;
SAXParserFactory saxfac = SAXParserFactory.newInstance();
saxfac.setNamespaceAware(true);
saxfac.setXIncludeAware(true);
saxfac.setValidating(false);
SAXParser saxParser = saxfac.newSAXParser();
saxParser.parse(wsdlPath, this);
After Setting setNamespaceAware=true
, I can't get the xmlns:XXX
attributes in parameter attributes
of method public void startElement(String uri, String localName, String qName, Attributes attributes)
.
for the following node:
<definitions name="Service1"
targetNamespace="http://www.test.com/service"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:tns="http://www.test.com/">
I just get name
and targetNamespace
attribute. xmlns
, xmlns:wsdl
, xmlns:mime
, xmlns:http
and xmlns:tns
are in the attributes
parameter. But they are not accessible.
Is there any way to use setNamespaceAware=true
and get all attributes of a node?