File tree Expand file tree Collapse file tree 3 files changed +6
-17
lines changed Expand file tree Collapse file tree 3 files changed +6
-17
lines changed Original file line number Diff line number Diff line change @@ -59,22 +59,6 @@ yq -P sample.json
59
59
return err
60
60
}
61
61
62
- inputFormatType , err := yqlib .InputFormatFromString (inputFormat )
63
-
64
- if err != nil {
65
- return err
66
- }
67
-
68
- if (inputFormatType == yqlib .XMLInputFormat &&
69
- outputFormatType != yqlib .XMLOutputFormat ||
70
- inputFormatType != yqlib .XMLInputFormat &&
71
- outputFormatType == yqlib .XMLOutputFormat ) &&
72
- yqlib .ConfiguredXMLPreferences .AttributePrefix == "+@" {
73
- yqlib .GetLogger ().Warning ("The default xml-attribute-prefix has changed in the v4.30 to `+@` to avoid " +
74
- "naming conflicts with the default content name, directive name and proc inst prefix. If you need to keep " +
75
- "`+` please set that value explicityly with --xml-attribute-prefix." )
76
- }
77
-
78
62
if outputFormatType == yqlib .YamlOutputFormat ||
79
63
outputFormatType == yqlib .PropsOutputFormat {
80
64
unwrapScalar = true
Original file line number Diff line number Diff line change @@ -245,7 +245,7 @@ func (dec *xmlDecoder) decodeXML(root *xmlNode) error {
245
245
}
246
246
case xml.CharData :
247
247
// Extract XML data (if any)
248
- elem .n .Data = trimNonGraphic (string (se ))
248
+ elem .n .Data = elem . n . Data + trimNonGraphic (string (se ))
249
249
if elem .n .Data != "" {
250
250
elem .state = "chardata"
251
251
log .Debug ("chardata [%v] for %v" , elem .n .Data , elem .label )
Original file line number Diff line number Diff line change @@ -233,6 +233,11 @@ const expectedXmlWithProcInstAndDirectives = `<?xml version="1.0"?>
233
233
`
234
234
235
235
var xmlScenarios = []formatScenario {
236
+ {
237
+ skipDoc : true ,
238
+ input : "<root>value<!-- comment--> </root>" ,
239
+ expected : "root: value # comment\n " ,
240
+ },
236
241
{
237
242
description : "Parse xml: simple" ,
238
243
subdescription : "Notice how all the values are strings, see the next example on how you can fix that." ,
You can’t perform that action at this time.
0 commit comments