mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-26 14:41:02 +03:00
fix(skd-validate): принимать <dcsset:item> без xsi:type как StructureItemGroup
Platform эмитит StructureItemGroup как короткую форму <dcsset:item> без xsi:type (это дефолтный тип). Раньше валидатор выдавал error на любой реальный XML с такой формой. Теперь — отсутствие xsi:type трактуется как dcsset:StructureItemGroup (с warning только для нестандартных типов).
This commit is contained in:
@@ -655,10 +655,8 @@ function Check-StructureItem {
|
|||||||
if ($script:stopped) { return }
|
if ($script:stopped) { return }
|
||||||
|
|
||||||
$xsiType = $itemNode.GetAttribute("type", "http://www.w3.org/2001/XMLSchema-instance")
|
$xsiType = $itemNode.GetAttribute("type", "http://www.w3.org/2001/XMLSchema-instance")
|
||||||
if (-not $xsiType) {
|
# StructureItemGroup — дефолтный тип, platform эмитит <dcsset:item> без xsi:type.
|
||||||
Report-Error "Variant '$variantName': structure item missing xsi:type"
|
if (-not $xsiType) { $xsiType = 'dcsset:StructureItemGroup' }
|
||||||
return
|
|
||||||
}
|
|
||||||
if ($validStructureTypes -notcontains $xsiType) {
|
if ($validStructureTypes -notcontains $xsiType) {
|
||||||
Report-Warn "Variant '$variantName': unusual structure item type '$xsiType'"
|
Report-Warn "Variant '$variantName': unusual structure item type '$xsiType'"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -622,9 +622,9 @@ def check_structure_item(item_node, variant_name):
|
|||||||
return
|
return
|
||||||
|
|
||||||
xsi_type = item_node.get(XSI_TYPE, "")
|
xsi_type = item_node.get(XSI_TYPE, "")
|
||||||
|
# StructureItemGroup — дефолтный тип, platform эмитит <dcsset:item> без xsi:type.
|
||||||
if not xsi_type:
|
if not xsi_type:
|
||||||
report_error(f"Variant '{variant_name}': structure item missing xsi:type")
|
xsi_type = "dcsset:StructureItemGroup"
|
||||||
return
|
|
||||||
if xsi_type not in valid_structure_types:
|
if xsi_type not in valid_structure_types:
|
||||||
report_warn(f"Variant '{variant_name}': unusual structure item type '{xsi_type}'")
|
report_warn(f"Variant '{variant_name}': unusual structure item type '{xsi_type}'")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user