これが私のコードです:
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:XXX
attributes
public 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
ノードのすべての属性を使用して取得する方法はありますか?