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

Function TestWriteWithNamespacePrefix

node_test.go:556–565  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

554}
555
556func TestWriteWithNamespacePrefix(t *testing.T) {
557 s := `<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body></S:Body></S:Envelope>`
558 doc, _ := Parse(strings.NewReader(s))
559 var b strings.Builder
560 err := doc.Write(&b, false)
561 testTrue(t, err == nil)
562 if s != b.String() {
563 t.Fatal("xml document missing some characters")
564 }
565}
566
567func TestQueryWithPrefix(t *testing.T) {
568 s := `<?xml version="1.0" encoding="UTF-8"?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body test="1"><ns2:Fault xmlns:ns2="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns3="http://www.w3.org/2003/05/soap-envelope"><faultcode>ns2:Client</faultcode><faultstring>This is a client fault</faultstring></ns2:Fault></S:Body></S:Envelope>`

Callers

nothing calls this directly

Calls 4

ParseFunction · 0.85
testTrueFunction · 0.85
WriteMethod · 0.80
StringMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…