diff --git a/crates/nu-command/src/formats/from/xml.rs b/crates/nu-command/src/formats/from/xml.rs index 8dd5c1949f..0fb80f6e0b 100644 --- a/crates/nu-command/src/formats/from/xml.rs +++ b/crates/nu-command/src/formats/from/xml.rs @@ -35,10 +35,10 @@ impl Command for FromXml { fn extra_usage(&self) -> &str { r#"Every XML entry is represented via a record with tag, attribute and content fields. To represent different types of entries different values are written to this fields: -1. Tag entry: {tag: attrs: {: "" ...} content: []} -2. Comment entry: {tag: '!' attrs: null content: ""} -3. Processing instruction (PI): {tag: '?' attrs: null content: ""} -4. Text: {tag: null attrs: null content: ""}. +1. Tag entry: `{tag: attrs: {: "" ...} content: []}` +2. Comment entry: `{tag: '!' attrs: null content: ""}` +3. Processing instruction (PI): `{tag: '?' attrs: null content: ""}` +4. Text: `{tag: null attrs: null content: ""}`. Unlike to xml command all null values are always present and text is never represented via plain string. This way content of every tag is always a table and is easier to parse"# diff --git a/crates/nu-command/src/formats/to/xml.rs b/crates/nu-command/src/formats/to/xml.rs index 105549ecca..a17a709757 100644 --- a/crates/nu-command/src/formats/to/xml.rs +++ b/crates/nu-command/src/formats/to/xml.rs @@ -34,10 +34,10 @@ impl Command for ToXml { fn extra_usage(&self) -> &str { r#"Every XML entry is represented via a record with tag, attribute and content fields. To represent different types of entries different values must be written to this fields: -1. Tag entry: {tag: attrs: {: "" ...} content: []} -2. Comment entry: {tag: '!' attrs: null content: ""} -3. Processing instruction (PI): {tag: '?' attrs: null content: ""} -4. Text: {tag: null attrs: null content: ""}. Or as plain "" instead of record. +1. Tag entry: `{tag: attrs: {: "" ...} content: []}` +2. Comment entry: `{tag: '!' attrs: null content: ""}` +3. Processing instruction (PI): `{tag: '?' attrs: null content: ""}` +4. Text: `{tag: null attrs: null content: ""}`. Or as plain "" instead of record. Additionally any field which is: empty record, empty list or null, can be omitted."# }