これが私のコードです:
path = wsdlPath;
SAXParserFactory saxfac = SAXParserFactory.newInstance();
saxfac.setNamespaceAware(true);
saxfac.setXIncludeAware(true);
saxfac.setValidating(false);
SAXParser saxParser = saxfac.newSAXParser();
saxParser.parse(wsdlPath, this);
設定後、メソッドのパラメータの属性をsetNamespaceAware=true取得できません。xmlns:XXXattributespublic void startElement(String uri, String localName, String qName, Attributes attributes)
次のノードの場合:
<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/">
私はただ取得nameしてtargetNamespace属性を付けます。xmlns、xmlns:wsdl、xmlns:mime、xmlns:httpおよびxmlns:tnsがattributesパラメーターに含まれています。しかし、それらはアクセスできません。
setNamespaceAware=trueノードのすべての属性を使用して取得する方法はありますか?