| 554 | } |
| 555 | |
| 556 | func 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 | |
| 567 | func 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>` |