Updated default xml naming prefix

This commit is contained in:
Mike Farah
2022-11-10 22:22:55 +11:00
parent 46dbd0c859
commit ececd00fbd
7 changed files with 38 additions and 29 deletions
+3 -3
View File
@@ -194,7 +194,7 @@ var encoderDecoderOperatorScenarios = []expressionScenario{
},
{
description: "Encode value as xml string",
document: `{a: {cool: {foo: "bar", +id: hi}}}`,
document: `{a: {cool: {foo: "bar", +@id: hi}}}`,
expression: `.a | to_xml`,
expected: []string{
"D0, P[a], (!!str)::<cool id=\"hi\">\n <foo>bar</foo>\n</cool>\n\n",
@@ -202,7 +202,7 @@ var encoderDecoderOperatorScenarios = []expressionScenario{
},
{
description: "Encode value as xml string on a single line",
document: `{a: {cool: {foo: "bar", +id: hi}}}`,
document: `{a: {cool: {foo: "bar", +@id: hi}}}`,
expression: `.a | @xml`,
expected: []string{
"D0, P[a], (!!str)::<cool id=\"hi\"><foo>bar</foo></cool>\n\n",
@@ -210,7 +210,7 @@ var encoderDecoderOperatorScenarios = []expressionScenario{
},
{
description: "Encode value as xml string with custom indentation",
document: `{a: {cool: {foo: "bar", +id: hi}}}`,
document: `{a: {cool: {foo: "bar", +@id: hi}}}`,
expression: `{"cat": .a | to_xml(1)}`,
expected: []string{
"D0, P[], (!!map)::cat: |\n <cool id=\"hi\">\n <foo>bar</foo>\n </cool>\n",