| 163 | } |
| 164 | |
| 165 | func TestDuplicateNamespaceURL(t *testing.T) { |
| 166 | s := `<?xml version='1.0' encoding='UTF-8'?> |
| 167 | <S:Envelope |
| 168 | xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> |
| 169 | <S:Body test="1"> |
| 170 | <ns2:Fault |
| 171 | xmlns:ns2="http://schemas.xmlsoap.org/soap/envelope/" |
| 172 | xmlns:ns3="http://www.w3.org/2003/05/soap-envelope"> |
| 173 | <faultcode>ns2:Client</faultcode> |
| 174 | <faultstring>This is a client fault</faultstring> |
| 175 | </ns2:Fault> |
| 176 | </S:Body> |
| 177 | </S:Envelope>` |
| 178 | doc, err := Parse(strings.NewReader(s)) |
| 179 | if err != nil { |
| 180 | t.Fatal(err) |
| 181 | } |
| 182 | n2 := FindOne(doc, `//S:Envelope/S:Body/ns2:Fault/faultcode`) |
| 183 | if n2 == nil { |
| 184 | t.Fatalf("should fount one but nil") |
| 185 | } |
| 186 | } |
| 187 | |
| 188 | func TestNamespaceURL(t *testing.T) { |
| 189 | s := ` |