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
+12 -4
View File
@@ -59,10 +59,18 @@ yq -P sample.json
return err
}
if (inputFormat == "x" || inputFormat == "xml") &&
outputFormatType != yqlib.XMLOutputFormat &&
yqlib.ConfiguredXMLPreferences.AttributePrefix == "+" {
yqlib.GetLogger().Warning("The default xml-attribute-prefix will change in the v4.30 to `+@` to avoid " +
inputFormatType, err := yqlib.InputFormatFromString(inputFormat)
if err != nil {
return err
}
if (inputFormatType == yqlib.XMLInputFormat &&
outputFormatType != yqlib.XMLOutputFormat ||
inputFormatType != yqlib.XMLInputFormat &&
outputFormatType == yqlib.XMLOutputFormat) &&
yqlib.ConfiguredXMLPreferences.AttributePrefix == "+@" {
yqlib.GetLogger().Warning("The default xml-attribute-prefix has changed in the v4.30 to `+@` to avoid " +
"naming conflicts with the default content name, directive name and proc inst prefix. If you need to keep " +
"`+` please set that value explicityly with --xml-attribute-prefix.")
}