MCPcopy Create free account
hub / github.com/antchfx/xmlquery / TestDuplicateNamespaceURL

Function TestDuplicateNamespaceURL

parse_test.go:165–186  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

163}
164
165func 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
188func TestNamespaceURL(t *testing.T) {
189 s := `

Callers

nothing calls this directly

Calls 2

ParseFunction · 0.85
FindOneFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…