diff --git a/pkg/yqlib/doc/usage/xml.md b/pkg/yqlib/doc/usage/xml.md index 64a22248..729c8dc1 100644 --- a/pkg/yqlib/doc/usage/xml.md +++ b/pkg/yqlib/doc/usage/xml.md @@ -210,6 +210,11 @@ will output ``` +instead of +```xml + +``` + ## Parse xml: keep raw attribute namespace Given a sample.xml file of: ```xml @@ -228,6 +233,11 @@ will output ``` +instead of +```xml + +``` + ## Encode xml: simple Given a sample.yml file of: ```yaml diff --git a/pkg/yqlib/xml_test.go b/pkg/yqlib/xml_test.go index cf7fea5f..276f7006 100644 --- a/pkg/yqlib/xml_test.go +++ b/pkg/yqlib/xml_test.go @@ -408,6 +408,9 @@ func documentXMLDecodeKeepNsScenario(w *bufio.Writer, s formatScenario) { writeOrPanic(w, "will output\n") writeOrPanic(w, fmt.Sprintf("```xml\n%v```\n\n", processFormatScenario(s, NewXMLDecoder("+", "+content", false, true, false), NewXMLEncoder(2, "+", "+content")))) + + writeOrPanic(w, "instead of\n") + writeOrPanic(w, fmt.Sprintf("```xml\n%v```\n\n", processFormatScenario(s, NewXMLDecoder("+", "+content", false, false, false), NewXMLEncoder(2, "+", "+content")))) } func documentXMLDecodeKeepNsRawTokenScenario(w *bufio.Writer, s formatScenario) { @@ -426,6 +429,9 @@ func documentXMLDecodeKeepNsRawTokenScenario(w *bufio.Writer, s formatScenario) writeOrPanic(w, "will output\n") writeOrPanic(w, fmt.Sprintf("```xml\n%v```\n\n", processFormatScenario(s, NewXMLDecoder("+", "+content", false, true, true), NewXMLEncoder(2, "+", "+content")))) + + writeOrPanic(w, "instead of\n") + writeOrPanic(w, fmt.Sprintf("```xml\n%v```\n\n", processFormatScenario(s, NewXMLDecoder("+", "+content", false, false, false), NewXMLEncoder(2, "+", "+content")))) } func documentXMLEncodeScenario(w *bufio.Writer, s formatScenario) {