From 6963df6b99f753221dd73e3e32252f775c451c51 Mon Sep 17 00:00:00 2001 From: Nick Shirokov Date: Sun, 2 Aug 2026 13:49:25 +0300 Subject: [PATCH] =?UTF-8?q?fix(meta-compile,meta-decompile):=20=D0=BF?= =?UTF-8?q?=D0=BE=D0=BB=D0=B8=D0=BC=D0=BE=D1=80=D1=84=D0=BD=D1=8B=D0=B9=20?= =?UTF-8?q?DataPathField=20=D0=B8=20=D1=8D=D0=BA=D1=80=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BA=D0=B0=D0=B2?= =?UTF-8?q?=D1=8B=D1=87=D0=B5=D0=BA=20=D0=B2=20=D1=82=D0=B5=D0=BA=D1=81?= =?UTF-8?q?=D1=82=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Первый полный прогон по всем поддерживаемым типам трёх конфигураций (41366 объектов) вскрыл два дефекта, живущих только в корпусе 2.17. DataPathField в блоке характеристик полиморфно: обычно -1 («не задано»), но в 8 случаях содержит путь к полю. Обе стороны жёстко приводили значение к [int], из-за чего декомпиляция всего объекта падала — 8 документов БП не разбирались вовсе. Теперь число остаётся числом, а путь проходит через Expand-CharField/Shorten-CharField, как соседние путевые поля. Текст элемента экранировался атрибутной функцией: кавычка превращалась в ", тогда как платформа держит её в тексте как есть (наименование «Транспортные средства, зарегистрированные в системе "Платон"» в ERP). В компиляторе для этого давно есть Esc-XmlText/esc_xml_text — переведены все 128 мест эмиссии текста в обоих портах. Замена строго ослабляющая: атрибуты не затронуты, экранирование & < > сохранено. Проверка: три документа БП с путевым DataPathField 3/3, сюита meta-compile 76/76 на обоих портах. Полный прогон корпуса идёт частями. Co-Authored-By: Claude Opus 5 (1M context) --- .../meta-compile/scripts/meta-compile.ps1 | 266 +++++++++--------- .../meta-compile/scripts/meta-compile.py | 258 ++++++++--------- .../meta-decompile/scripts/meta-decompile.ps1 | 10 +- 3 files changed, 272 insertions(+), 262 deletions(-) diff --git a/.claude/skills/meta-compile/scripts/meta-compile.ps1 b/.claude/skills/meta-compile/scripts/meta-compile.ps1 index c10610a2..f36cdac1 100644 --- a/.claude/skills/meta-compile/scripts/meta-compile.ps1 +++ b/.claude/skills/meta-compile/scripts/meta-compile.ps1 @@ -1,4 +1,4 @@ -# meta-compile v1.73 — Compile 1C metadata object from JSON +# meta-compile v1.74 — Compile 1C metadata object from JSON # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills param( [Parameter(Mandatory)] @@ -375,7 +375,7 @@ function Normalize-FormRef { # Ссылка на форму по умолчанию: непустая → значение, иначе . function Emit-FormRef { param([string]$i, [string]$tag, $val) - if ($val) { X "$i<$tag>$(Esc-Xml (Normalize-FormRef "$val"))" } else { X "$i<$tag/>" } + if ($val) { X "$i<$tag>$(Esc-XmlText (Normalize-FormRef "$val"))" } else { X "$i<$tag/>" } } # Ссылка verbatim (без Normalize-FormRef): для форм/схем/хранилищ Report/DataProcessor, где имя формы может быть @@ -383,7 +383,7 @@ function Emit-FormRef { # вида (SettingsStorage.X / Report.X.Template.Y). Декомпилятор пишет полный путь → passthrough. function Emit-VerbatimRef { param([string]$i, [string]$tag, $val) - if ($val) { X "$i<$tag>$(Esc-Xml "$val")" } else { X "$i<$tag/>" } + if ($val) { X "$i<$tag>$(Esc-XmlText "$val")" } else { X "$i<$tag/>" } } if (-not $def.type) { @@ -1318,7 +1318,7 @@ function Emit-StandardAttribute { $lbtDp = if ($lbt.dataPath) { "$($lbt.dataPath)" } else { "$lbt" } $lbtLi = if ($null -ne $lbt.linkItem) { $lbt.linkItem } else { 0 } X "$indent`t" - X "$indent`t`t$(Esc-Xml $lbtDp)" + X "$indent`t`t$(Esc-XmlText $lbtDp)" X "$indent`t`t$lbtLi" X "$indent`t" } else { @@ -1338,7 +1338,7 @@ function Emit-StandardAttribute { Emit-MLText "$indent`t" "xr:ToolTip" $tt X "$indent`tfalse" Emit-MLText "$indent`t" "xr:Format" $fmt - if ($cf) { X "$indent`t$(Esc-Xml "$cf")" } else { X "$indent`t" } + if ($cf) { X "$indent`t$(Esc-XmlText "$cf")" } else { X "$indent`t" } X "$indent`tAuto" X "$indent`t$chi" Emit-MLText "$indent`t" "xr:EditFormat" $efmt @@ -1358,7 +1358,7 @@ function Emit-StandardAttribute { else { $fvN = Normalize-ChoiceValue $fvRaw if ([string]::IsNullOrEmpty($fvN.Text)) { X "$indent`t" } - else { X "$indent`t$(Esc-Xml $fvN.Text)" } + else { X "$indent`t$(Esc-XmlText $fvN.Text)" } } if ($msk) { X "$indent`t$(Esc-XmlText "$msk")" } else { X "$indent`t" } Emit-ChoiceParameters "$indent`t" (OvOr 'ChoiceParameters' $null) 'xr:ChoiceParameters' @@ -1503,7 +1503,7 @@ function Emit-LinkByType { if (-not $dp) { X "$indent"; return } $dp = Expand-DataPath $dp X "$indent" - X "$indent`t$(Esc-Xml "$dp")" + X "$indent`t$(Esc-XmlText "$dp")" X "$indent`t$li" X "$indent" } @@ -1517,7 +1517,7 @@ function Emit-FieldBlock { $arr = @($fields | Where-Object { "$_" -ne '' }) if ($arr.Count -eq 0) { X "$indent<$tag/>"; return } X "$indent<$tag>" - foreach ($f in $arr) { X "$indent`t$(Esc-Xml "$f")" } + foreach ($f in $arr) { X "$indent`t$(Esc-XmlText "$f")" } X "$indent" } @@ -1527,7 +1527,7 @@ function Emit-BasedOn { $arr = @($items | Where-Object { $_ }) if ($arr.Count -eq 0) { X "$indent"; return } X "$indent" - foreach ($it in $arr) { X "$indent`t$(Esc-Xml (Normalize-MDObjectRef "$it"))" } + foreach ($it in $arr) { X "$indent`t$(Esc-XmlText (Normalize-MDObjectRef "$it"))" } X "$indent" } @@ -1658,13 +1658,13 @@ function Emit-ChoiceParameters { if (Is-EmptyRef $v) { X "$indent`t`t`t"; continue } $norm = Normalize-ChoiceValueT $v $ptype if ([string]::IsNullOrEmpty($norm.Text)) { X "$indent`t`t`t" } - else { X "$indent`t`t`t$(Esc-Xml $norm.Text)" } + else { X "$indent`t`t`t$(Esc-XmlText $norm.Text)" } } X "$indent`t`t" } else { $norm = Normalize-ChoiceValueT $val $ptype if ([string]::IsNullOrEmpty($norm.Text)) { X "$indent`t`t" } - else { X "$indent`t`t$(Esc-Xml $norm.Text)" } + else { X "$indent`t`t$(Esc-XmlText $norm.Text)" } } X "$indent`t" } @@ -1690,8 +1690,8 @@ function Emit-ChoiceParameterLinks { } } X "$indent`t" - X "$indent`t`t$(Esc-Xml "$name")" - X "$indent`t`t$(Esc-Xml "$dp")" + X "$indent`t`t$(Esc-XmlText "$name")" + X "$indent`t`t$(Esc-XmlText "$dp")" X "$indent`t`t$vc" X "$indent`t" } @@ -1747,8 +1747,12 @@ function Expand-CharField { return $s } -# Числовое поле-флаг Characteristics (DataPathField/MultipleValues*) — дефолт -1. -function Get-CharIntField { param($obj, [string[]]$names) $v = Get-ChElProp $obj $names; if ($null -eq $v -or "$v" -eq '') { return -1 } return [int]$v } +# Поле-флаг Characteristics (DataPathField/MultipleValues*) — дефолт -1. ПОЛИМОРФНО: обычно число, +# но DataPathField в некоторых конфигурациях содержит ПУТЬ к полю (8 случаев на корпус) — тогда +# пропускаем строку как есть, приведение к [int] на ней падало. +function Get-CharIntField { param($obj, [string[]]$names) $v = Get-ChElProp $obj $names; if ($null -eq $v -or "$v" -eq '') { return -1 } + if ("$v" -match '^-?\d+$') { return [int]$v } + return "$v" } function Emit-Characteristics { param([string]$indent, $chars) @@ -1771,23 +1775,23 @@ function Emit-Characteristics { $mvo = Get-CharIntField $values @('multipleValuesOrderField') X "$indent`t" X "$indent`t`t" - X "$indent`t`t`t$(Esc-Xml $key)" - X "$indent`t`t`t$(Esc-Xml $tff)" + X "$indent`t`t`t$(Esc-XmlText $key)" + X "$indent`t`t`t$(Esc-XmlText $tff)" # filterValue: $null→nil; голое→xs:string, полный путь→DTR, bool→xs:boolean. $tfvRaw = Get-ChElProp $types @('filterValue','typesFilterValue') if ($null -eq $tfvRaw) { X "$indent`t`t`t" } else { $tfvN = Normalize-ChoiceValue $tfvRaw if ([string]::IsNullOrEmpty($tfvN.Text)) { X "$indent`t`t`t" } - else { X "$indent`t`t`t$(Esc-Xml $tfvN.Text)" } + else { X "$indent`t`t`t$(Esc-XmlText $tfvN.Text)" } } - X "$indent`t`t`t$dpf" + X "$indent`t`t`t$(Esc-XmlText (Expand-CharField "$dpf" $tFrom))" X "$indent`t`t`t$mvu" X "$indent`t`t" X "$indent`t`t" - X "$indent`t`t`t$(Esc-Xml $obj)" - X "$indent`t`t`t$(Esc-Xml $typ)" - X "$indent`t`t`t$(Esc-Xml $val)" + X "$indent`t`t`t$(Esc-XmlText $obj)" + X "$indent`t`t`t$(Esc-XmlText $typ)" + X "$indent`t`t`t$(Esc-XmlText $val)" X "$indent`t`t`t$mvk" X "$indent`t`t`t$mvo" X "$indent`t`t" @@ -1802,7 +1806,7 @@ function Emit-MinMaxValue { param([string]$indent, [string]$tag, $val) if ($null -eq $val) { X "$indent<$tag xsi:nil=`"true`"/>"; return } $t = if ($val -is [string]) { 'xs:string' } else { 'xs:decimal' } - X "$indent<$tag xsi:type=`"$t`">$(Esc-Xml "$val")" + X "$indent<$tag xsi:type=`"$t`">$(Esc-XmlText "$val")" } function Emit-Attribute { @@ -1827,7 +1831,7 @@ function Emit-Attribute { $uuid = New-Guid-String X "$indent<$elemTag uuid=`"$uuid`">" X "$indent`t" - X "$indent`t`t$(Esc-Xml $parsed.name)" + X "$indent`t`t$(Esc-XmlText $parsed.name)" Emit-MLText "$indent`t`t" "Synonym" $parsed.synonym if ($parsed.comment) { X "$indent`t`t$(Esc-XmlText $parsed.comment)" } else { X "$indent`t`t" } @@ -1891,7 +1895,7 @@ function Emit-Attribute { X "$indent`t`t$qc" $coi = if ($parsed.createOnInput) { $parsed.createOnInput } else { "Auto" } X "$indent`t`t$coi" - if ($parsed.choiceForm) { X "$indent`t`t$(Esc-Xml "$($parsed.choiceForm)")" } else { X "$indent`t`t" } + if ($parsed.choiceForm) { X "$indent`t`t$(Esc-XmlText "$($parsed.choiceForm)")" } else { X "$indent`t`t" } Emit-LinkByType "$indent`t`t" $parsed.linkByType $chi = if ($parsed.choiceHistoryOnInput) { $parsed.choiceHistoryOnInput } else { "Auto" } X "$indent`t`t$chi" @@ -1921,7 +1925,7 @@ function Emit-Attribute { } # Регистр расчёта: ScheduleLink у измерений и реквизитов (НЕ ресурсов), перед Indexing. Дефолт пустой. if ($context -eq "register-calc" -and $elemTag -in @("Dimension", "Attribute")) { - if ($parsed.scheduleLink) { X "$indent`t`t$(Esc-Xml "$($parsed.scheduleLink)")" } + if ($parsed.scheduleLink) { X "$indent`t`t$(Esc-XmlText "$($parsed.scheduleLink)")" } else { X "$indent`t`t" } } @@ -1930,12 +1934,12 @@ function Emit-Attribute { if ($context -eq "register-account" -and $elemTag -in @("Dimension", "Resource")) { $balance = if ($parsed.balance -eq $true -or $parsed.flags -contains "balance") { "true" } else { "false" } X "$indent`t`t$balance" - if ($parsed.accountingFlag) { X "$indent`t`t$(Esc-Xml "$($parsed.accountingFlag)")" } else { X "$indent`t`t" } + if ($parsed.accountingFlag) { X "$indent`t`t$(Esc-XmlText "$($parsed.accountingFlag)")" } else { X "$indent`t`t" } if ($elemTag -eq "Dimension") { $denyIncomplete = if ($parsed.denyIncompleteValues -eq $true -or $parsed.flags -contains "denyincomplete") { "true" } else { "false" } X "$indent`t`t$denyIncomplete" } else { - if ($parsed.extDimensionAccountingFlag) { X "$indent`t`t$(Esc-Xml "$($parsed.extDimensionAccountingFlag)")" } else { X "$indent`t`t" } + if ($parsed.extDimensionAccountingFlag) { X "$indent`t`t$(Esc-XmlText "$($parsed.extDimensionAccountingFlag)")" } else { X "$indent`t`t" } } } @@ -1960,7 +1964,7 @@ function Emit-Attribute { # Реквизит адресации задачи: AddressingDimension (ссылка на измерение регистра исполнителей), между Indexing и FullTextSearch. if ($context -eq "task-addressing" -and $elemTag -eq "AddressingAttribute") { - if ($parsed.addressingDimension) { X "$indent`t`t$(Esc-Xml "$($parsed.addressingDimension)")" } else { X "$indent`t`t" } + if ($parsed.addressingDimension) { X "$indent`t`t$(Esc-XmlText "$($parsed.addressingDimension)")" } else { X "$indent`t`t" } } $fts = if ($parsed.fullTextSearch) { $parsed.fullTextSearch } else { "Use" } X "$indent`t`t$fts" @@ -2003,8 +2007,8 @@ function Emit-CommandPicture { } if (-not $src) { X "$indent"; return } X "$indent" - if ($src -match '^abs:(.*)$') { X "$indent`t$(Esc-Xml $matches[1])" } - else { X "$indent`t$(Esc-Xml $src)" } + if ($src -match '^abs:(.*)$') { X "$indent`t$(Esc-XmlText $matches[1])" } + else { X "$indent`t$(Esc-XmlText $src)" } X "$indent`t$(if ($lt) { 'true' } else { 'false' })" if ($tpx) { X "$indent`t" } X "$indent" @@ -2018,7 +2022,7 @@ function Emit-Command { param([string]$indent, [string]$cmdName, $cmd) X "$indent" X "$indent`t" - X "$indent`t`t$(Esc-Xml $cmdName)" + X "$indent`t`t$(Esc-XmlText $cmdName)" $syn = if ($null -ne $cmd.synonym) { $cmd.synonym } else { Split-CamelCase $cmdName } Emit-MLText "$indent`t`t" "Synonym" $syn if ($cmd.comment) { X "$indent`t`t$(Esc-XmlText "$($cmd.comment)")" } else { X "$indent`t`t" } @@ -2027,7 +2031,7 @@ function Emit-Command { Write-Error "Команда '$cmdName': тип параметра (commandParameterType) недоступен для команд командного интерфейса раздела ('$group'). Тип параметра — только для групп формы (FormCommandBar*/FormNavigationPanel*) или CommandGroup.<Имя>." exit 1 } - X "$indent`t`t$(Esc-Xml $group)" + X "$indent`t`t$(Esc-XmlText $group)" if ($cmd.commandParameterType) { X "$indent`t`t" Emit-TypeContent "$indent`t`t`t" "$($cmd.commandParameterType)" @@ -2043,7 +2047,7 @@ function Emit-Command { X "$indent`t`t$rep" Emit-MLText "$indent`t`t" "ToolTip" $cmd.tooltip Emit-CommandPicture "$indent`t`t" $cmd - if ($cmd.shortcut) { X "$indent`t`t$(Esc-Xml "$($cmd.shortcut)")" } else { X "$indent`t`t" } + if ($cmd.shortcut) { X "$indent`t`t$(Esc-XmlText "$($cmd.shortcut)")" } else { X "$indent`t`t" } $osu = if ($cmd.onMainServerUnavalableBehavior) { "$($cmd.onMainServerUnavalableBehavior)" } else { "Auto" } X "$indent`t`t$osu" X "$indent`t" @@ -2075,7 +2079,7 @@ function Emit-TabularSection { $tsSynonym = if ($null -ne $tsSynonymArg) { $tsSynonymArg } else { Split-CamelCase $tsName } X "$indent`t" - X "$indent`t`t$(Esc-Xml $tsName)" + X "$indent`t`t$(Esc-XmlText $tsName)" Emit-MLText "$indent`t`t" "Synonym" $tsSynonym if ($tsComment) { X "$indent`t`t$(Esc-XmlText $tsComment)" } else { X "$indent`t`t" } Emit-MLText "$indent`t`t" "ToolTip" $tsTooltip @@ -2121,7 +2125,7 @@ function Emit-EnumValue { $uuid = New-Guid-String X "$indent" X "$indent`t" - X "$indent`t`t$(Esc-Xml $parsed.name)" + X "$indent`t`t$(Esc-XmlText $parsed.name)" Emit-MLText "$indent`t`t" "Synonym" $parsed.synonym if ($parsed.comment) { X "$indent`t`t$(Esc-XmlText $parsed.comment)" } else { X "$indent`t`t" } X "$indent`t" @@ -2136,7 +2140,7 @@ function Emit-Dimension { $uuid = New-Guid-String X "$indent" X "$indent`t" - X "$indent`t`t$(Esc-Xml $parsed.name)" + X "$indent`t`t$(Esc-XmlText $parsed.name)" Emit-MLText "$indent`t`t" "Synonym" $parsed.synonym X "$indent`t`t" @@ -2178,7 +2182,7 @@ function Emit-Dimension { X "$indent`t`t" X "$indent`t`tAuto" X "$indent`t`tAuto" - if ($parsed.choiceForm) { X "$indent`t`t$(Esc-Xml "$($parsed.choiceForm)")" } else { X "$indent`t`t" } + if ($parsed.choiceForm) { X "$indent`t`t$(Esc-XmlText "$($parsed.choiceForm)")" } else { X "$indent`t`t" } X "$indent`t`t" X "$indent`t`tAuto" @@ -2226,7 +2230,7 @@ function Emit-Resource { $uuid = New-Guid-String X "$indent" X "$indent`t" - X "$indent`t`t$(Esc-Xml $parsed.name)" + X "$indent`t`t$(Esc-XmlText $parsed.name)" Emit-MLText "$indent`t`t" "Synonym" $parsed.synonym X "$indent`t`t" @@ -2272,7 +2276,7 @@ function Emit-Resource { X "$indent`t`t" X "$indent`t`tAuto" X "$indent`t`tAuto" - if ($parsed.choiceForm) { X "$indent`t`t$(Esc-Xml "$($parsed.choiceForm)")" } else { X "$indent`t`t" } + if ($parsed.choiceForm) { X "$indent`t`t$(Esc-XmlText "$($parsed.choiceForm)")" } else { X "$indent`t`t" } X "$indent`t`t" X "$indent`t`tAuto" @@ -2298,7 +2302,7 @@ function Emit-CatalogProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText $def.comment)" } else { X "$i" } @@ -2317,7 +2321,7 @@ function Emit-CatalogProperties { if ($def.owners -and $def.owners.Count -gt 0) { X "$i" foreach ($ownerRef in $def.owners) { - X "$i`t$(Esc-Xml (Normalize-MDObjectRef "$ownerRef" 'Catalog'))" + X "$i`t$(Esc-XmlText (Normalize-MDObjectRef "$ownerRef" 'Catalog'))" } X "$i" } else { @@ -2403,12 +2407,12 @@ function Emit-DocumentProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText "$($def.comment)")" } else { X "$i" } $useStdCmd = if (Get-BoolProp "useStandardCommands" $true) { "true" } else { "false" } X "$i$useStdCmd" - if ($def.numerator) { X "$i$(Esc-Xml "$($def.numerator)")" } else { X "$i" } + if ($def.numerator) { X "$i$(Esc-XmlText "$($def.numerator)")" } else { X "$i" } $numberType = Get-EnumProp "NumberType" "numberType" "String" $numberLength = if ($null -ne $def.numberLength) { "$($def.numberLength)" } else { "11" } @@ -2468,7 +2472,7 @@ function Emit-DocumentProperties { } if ($regRecords.Count -gt 0) { X "$i" - foreach ($rr in $regRecords) { X "$i`t$(Esc-Xml (Normalize-MDObjectRef "$rr"))" } + foreach ($rr in $regRecords) { X "$i`t$(Esc-XmlText (Normalize-MDObjectRef "$rr"))" } X "$i" } else { X "$i" @@ -2502,7 +2506,7 @@ function Emit-EnumProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText $def.comment)" } else { X "$i" } $useStdCmds = if (Get-BoolProp "useStandardCommands" $false) { "true" } else { "false" } @@ -2528,7 +2532,7 @@ function Emit-ConstantProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText $def.comment)" } else { X "$i" } @@ -2558,7 +2562,7 @@ function Emit-ConstantProperties { Emit-ChoiceParameterLinks $i $def.choiceParameterLinks Emit-ChoiceParameters $i $def.choiceParameters X "$i$(Get-EnumProp 'QuickChoice' 'quickChoice' 'Auto')" - if ($def.choiceForm) { X "$i$(Esc-Xml "$($def.choiceForm)")" } else { X "$i" } + if ($def.choiceForm) { X "$i$(Esc-XmlText "$($def.choiceForm)")" } else { X "$i" } Emit-LinkByType $i $def.linkByType X "$i$(Get-EnumProp 'ChoiceHistoryOnInput' 'choiceHistoryOnInput' 'Auto')" @@ -2572,7 +2576,7 @@ function Emit-InformationRegisterProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText "$($def.comment)")" } else { X "$i" } $useStdCmd = if (Get-BoolProp "useStandardCommands" $true) { "true" } else { "false" } @@ -2623,7 +2627,7 @@ function Emit-AccumulationRegisterProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText "$($def.comment)")" } else { X "$i" } $useStdCmd = if (Get-BoolProp "useStandardCommands" $true) { "true" } else { "false" } @@ -2659,7 +2663,7 @@ function Emit-DefinedTypeProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText $def.comment)" } else { X "$i" } @@ -2675,13 +2679,13 @@ function Emit-FunctionalOptionProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText $def.comment)" } else { X "$i" } # Location — хранилище значения опции (Constant.X / InformationRegister.X.Resource.Y / <Тип>.X.Attribute.Y). # Ссылка verbatim (MDObjectRef-путь; принимаем location или value). $loc = if ($def.location) { "$($def.location)" } elseif ($def.value) { "$($def.value)" } else { "" } - if ($loc) { X "$i$(Esc-Xml (Normalize-MDObjectRef $loc))" } else { X "$i" } + if ($loc) { X "$i$(Esc-XmlText (Normalize-MDObjectRef $loc))" } else { X "$i" } # PrivilegedGetMode — привилегированный режим чтения (корпус 2864/2864 = true → дефолт true). X "$i$(if (Get-BoolProp 'privilegedGetMode' $true) { 'true' } else { 'false' })" # Content — объекты, зависящие от опции (список MDObjectRef-путей к реквизитам/измерениям/ресурсам). omit-on-empty. @@ -2689,7 +2693,7 @@ function Emit-FunctionalOptionProperties { if ($def.content) { $content = @($def.content) } if ($content.Count -gt 0) { X "$i" - foreach ($obj in $content) { X "$i`t$(Esc-Xml (Normalize-MDObjectRef "$obj"))" } + foreach ($obj in $content) { X "$i`t$(Esc-XmlText (Normalize-MDObjectRef "$obj"))" } X "$i" } else { X "$i" @@ -2702,7 +2706,7 @@ function Emit-MDRefList { $arr = @(); if ($items) { $arr = @($items) } if ($arr.Count -gt 0) { X "$indent<$tag>" - foreach ($it in $arr) { X "$indent`t$(Esc-Xml (Normalize-MDObjectRef "$it"))" } + foreach ($it in $arr) { X "$indent`t$(Esc-XmlText (Normalize-MDObjectRef "$it"))" } X "$indent" } else { X "$indent<$tag/>" @@ -2712,7 +2716,7 @@ function Emit-MDRefList { function Emit-SequenceProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText $def.comment)" } else { X "$i" } X "$i$(Get-EnumProp 'MoveBoundaryOnPosting' 'moveBoundaryOnPosting' 'DontMove')" @@ -2724,7 +2728,7 @@ function Emit-SequenceProperties { function Emit-FilterCriterionProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText $def.comment)" } else { X "$i" } $vt = if ($def.valueType) { "$($def.valueType)" } elseif ($def.valueTypes) { (@($def.valueTypes) | ForEach-Object { "$_" }) -join ' + ' } else { '' } @@ -2735,7 +2739,7 @@ function Emit-FilterCriterionProperties { $content = @(); if ($def.content) { $content = @($def.content) } if ($content.Count -gt 0) { X "$i" - foreach ($obj in $content) { X "$i`t$(Esc-Xml (Normalize-MDObjectRef "$obj"))" } + foreach ($obj in $content) { X "$i`t$(Esc-XmlText (Normalize-MDObjectRef "$obj"))" } X "$i" } else { X "$i" @@ -2750,7 +2754,7 @@ function Emit-FilterCriterionProperties { function Emit-DocumentNumeratorProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText $def.comment)" } else { X "$i" } X "$i$(Get-EnumProp 'NumberType' 'numberType' 'String')" @@ -2763,7 +2767,7 @@ function Emit-DocumentNumeratorProperties { function Emit-SettingsStorageProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText $def.comment)" } else { X "$i" } Emit-VerbatimRef $i "DefaultSaveForm" $def.defaultSaveForm @@ -2775,7 +2779,7 @@ function Emit-SettingsStorageProperties { function Emit-CommonFormProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText $def.comment)" } else { X "$i" } X "$i$(Get-EnumProp 'FormType' 'formType' 'Managed')" @@ -2799,7 +2803,7 @@ function Emit-CommonFormProperties { function Emit-SessionParameterProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText $def.comment)" } else { X "$i" } $vt = if ($def.valueType) { "$($def.valueType)" } elseif ($def.valueTypes) { (@($def.valueTypes) | ForEach-Object { "$_" }) -join ' + ' } else { '' } @@ -2809,7 +2813,7 @@ function Emit-SessionParameterProperties { function Emit-FunctionalOptionsParameterProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText $def.comment)" } else { X "$i" } # Use — измерения регистров/реквизиты, к которым привязан параметр (список MDObjectRef). @@ -2819,7 +2823,7 @@ function Emit-FunctionalOptionsParameterProperties { function Emit-WSReferenceProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText $def.comment)" } else { X "$i" } $url = if ($def.locationURL) { "$($def.locationURL)" } elseif ($def.locationUrl) { "$($def.locationUrl)" } else { "" } @@ -2829,7 +2833,7 @@ function Emit-WSReferenceProperties { function Emit-CommonPictureProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText $def.comment)" } else { X "$i" } X "$i$(if (Get-BoolProp 'availabilityForChoice' $false) { 'true' } else { 'false' })" @@ -2839,7 +2843,7 @@ function Emit-CommonPictureProperties { function Emit-CommonTemplateProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText $def.comment)" } else { X "$i" } X "$i$(Get-EnumProp 'TemplateType' 'templateType' 'SpreadsheetDocument')" @@ -2848,7 +2852,7 @@ function Emit-CommonTemplateProperties { function Emit-CommandGroupProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText $def.comment)" } else { X "$i" } X "$i$(Get-EnumProp 'Representation' 'representation' 'Auto')" @@ -2860,15 +2864,15 @@ function Emit-CommandGroupProperties { function Emit-CommonCommandProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText $def.comment)" } else { X "$i" } $group = if ($def.group) { "$($def.group)" } else { "" } - if ($group) { X "$i$(Esc-Xml $group)" } else { X "$i" } + if ($group) { X "$i$(Esc-XmlText $group)" } else { X "$i" } X "$i$(Get-EnumProp 'Representation' 'representation' 'Auto')" Emit-MLText $i "ToolTip" $def.tooltip Emit-CommandPicture $i $def - if ($def.shortcut) { X "$i$(Esc-Xml "$($def.shortcut)")" } else { X "$i" } + if ($def.shortcut) { X "$i$(Esc-XmlText "$($def.shortcut)")" } else { X "$i" } $inclHelp = if (Get-BoolProp "includeHelpInContents" $false) { "true" } else { "false" } X "$i$inclHelp" if ($def.commandParameterType) { @@ -2886,7 +2890,7 @@ function Emit-CommonCommandProperties { function Emit-CommonAttributeProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText $def.comment)" } else { X "$i" } # Дефолт типа — String(0) (переменная длина 0), НЕ $def.type (это тип метаобъекта «CommonAttribute»). @@ -2911,7 +2915,7 @@ function Emit-CommonAttributeProperties { Emit-ChoiceParameters $i $def.choiceParameters X "$i$(Get-EnumProp 'QuickChoice' 'quickChoice' 'Auto')" X "$i$(Get-EnumProp 'CreateOnInput' 'createOnInput' 'Auto')" - if ($def.choiceForm) { X "$i$(Esc-Xml "$($def.choiceForm)")" } else { X "$i" } + if ($def.choiceForm) { X "$i$(Esc-XmlText "$($def.choiceForm)")" } else { X "$i" } Emit-LinkByType $i $def.linkByType X "$i$(Get-EnumProp 'ChoiceHistoryOnInput' 'choiceHistoryOnInput' 'Auto')" # Content — объекты, к которым добавлен общий реквизит: {metadata, use?, conditionalSeparation?}. @@ -2922,10 +2926,10 @@ function Emit-CommonAttributeProperties { $md = if ($c -is [string]) { "$c" } else { "$($c.metadata)" } $use = if ($c -is [string]) { 'Use' } elseif ($c.use) { "$($c.use)" } else { 'Use' } X "$i`t" - X "$i`t`t$(Esc-Xml (Normalize-MDObjectRef $md))" + X "$i`t`t$(Esc-XmlText (Normalize-MDObjectRef $md))" X "$i`t`t$use" $cs = if ($c -isnot [string] -and $c.conditionalSeparation) { "$($c.conditionalSeparation)" } else { "" } - if ($cs) { X "$i`t`t$(Esc-Xml $cs)" } else { X "$i`t`t" } + if ($cs) { X "$i`t`t$(Esc-XmlText $cs)" } else { X "$i`t`t" } X "$i`t" } X "$i" @@ -2936,11 +2940,11 @@ function Emit-CommonAttributeProperties { X "$i$(Get-EnumProp 'DataSeparation' 'dataSeparation' 'DontUse')" X "$i$(Get-EnumProp 'SeparatedDataUse' 'separatedDataUse' 'Independently')" $dsv = if ($def.dataSeparationValue) { "$($def.dataSeparationValue)" } else { "" } - if ($dsv) { X "$i$(Esc-Xml $dsv)" } else { X "$i" } + if ($dsv) { X "$i$(Esc-XmlText $dsv)" } else { X "$i" } $dsu = if ($def.dataSeparationUse) { "$($def.dataSeparationUse)" } else { "" } - if ($dsu) { X "$i$(Esc-Xml $dsu)" } else { X "$i" } + if ($dsu) { X "$i$(Esc-XmlText $dsu)" } else { X "$i" } $cs2 = if ($def.conditionalSeparation) { "$($def.conditionalSeparation)" } else { "" } - if ($cs2) { X "$i$(Esc-Xml $cs2)" } else { X "$i" } + if ($cs2) { X "$i$(Esc-XmlText $cs2)" } else { X "$i" } X "$i$(Get-EnumProp 'UsersSeparation' 'usersSeparation' 'DontUse')" X "$i$(Get-EnumProp 'AuthenticationSeparation' 'authenticationSeparation' 'DontUse')" X "$i$(Get-EnumProp 'ConfigurationExtensionsSeparation' 'configurationExtensionsSeparation' 'DontUse')" @@ -2957,7 +2961,7 @@ function Emit-SequenceDimension { $parsed = Parse-AttributeShorthand $dimDef X "$indent" X "$indent`t" - X "$indent`t`t$(Esc-Xml $parsed.name)" + X "$indent`t`t$(Esc-XmlText $parsed.name)" Emit-MLText "$indent`t`t" "Synonym" $parsed.synonym if ($parsed.comment) { X "$indent`t`t$(Esc-XmlText $parsed.comment)" } else { X "$indent`t`t" } if ($parsed.typeEmpty) { X "$indent`t`t" } @@ -2975,7 +2979,7 @@ function Emit-CommonModuleProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText $def.comment)" } else { X "$i" } @@ -3017,7 +3021,7 @@ function Emit-ScheduledJobProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText $def.comment)" } else { X "$i" } @@ -3026,14 +3030,14 @@ function Emit-ScheduledJobProperties { if ($methodName -and -not $methodName.StartsWith("CommonModule.")) { $methodName = "CommonModule.$methodName" } - X "$i$(Esc-Xml $methodName)" + X "$i$(Esc-XmlText $methodName)" # Description — плоская строка (дефолт ПУСТО: корпус 662 пустых / 209 заданы; не подставляем синоним — иначе роундтрип рвётся). $description = if ($def.description) { "$($def.description)" } else { "" } if ($description) { X "$i$(Esc-XmlText $description)" } else { X "$i" } $key = if ($def.key) { "$($def.key)" } else { "" } - X "$i$(Esc-Xml $key)" + X "$i$(Esc-XmlText $key)" $use = if ($def.use -eq $true) { "true" } else { "false" } X "$i$use" @@ -3051,7 +3055,7 @@ function Emit-EventSubscriptionProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText $def.comment)" } else { X "$i" } @@ -3075,7 +3079,7 @@ function Emit-EventSubscriptionProperties { if ($handler -and -not $handler.StartsWith("CommonModule.")) { $handler = "CommonModule.$handler" } - X "$i$(Esc-Xml $handler)" + X "$i$(Esc-XmlText $handler)" } # --- 13b. Wave 2: Report, DataProcessor --- @@ -3084,7 +3088,7 @@ function Emit-ReportProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText $def.comment)" } else { X "$i" } # UseStandardCommands: дефолт true (авторски-безопасно — доступность объекта через стандартный командный @@ -3110,7 +3114,7 @@ function Emit-DataProcessorProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText $def.comment)" } else { X "$i" } $useStdCmds = if (Get-BoolProp "useStandardCommands" $true) { "true" } else { "false" } @@ -3130,7 +3134,7 @@ function Emit-ExchangePlanProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText "$($def.comment)")" } else { X "$i" } $useStdCmd = if (Get-BoolProp "useStandardCommands" $true) { "true" } else { "false" } @@ -3202,7 +3206,7 @@ function Emit-ChartOfCharacteristicTypesProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText "$($def.comment)")" } else { X "$i" } $useStdCmd = if (Get-BoolProp "useStandardCommands" $true) { "true" } else { "false" } @@ -3211,7 +3215,7 @@ function Emit-ChartOfCharacteristicTypesProperties { X "$i$inclHelp" # CharacteristicExtValues — ссылка на справочник доп. значений характеристик (обычно пусто). - if ($def.characteristicExtValues) { X "$i$(Esc-Xml "$($def.characteristicExtValues)")" } + if ($def.characteristicExtValues) { X "$i$(Esc-XmlText "$($def.characteristicExtValues)")" } else { X "$i" } # Type — тип значения характеристики (составной). DSL `valueType` строка "A + B + C" ИЛИ массив; нет ключа → дефолт. @@ -3311,7 +3315,7 @@ function Emit-DocumentJournalProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText $def.comment)" } else { X "$i" } @@ -3325,7 +3329,7 @@ function Emit-DocumentJournalProperties { if ($def.registeredDocuments) { $regDocs = @($def.registeredDocuments) } if ($regDocs.Count -gt 0) { X "$i" - foreach ($rd in $regDocs) { X "$i`t$(Esc-Xml (Normalize-MDObjectRef "$rd"))" } + foreach ($rd in $regDocs) { X "$i`t$(Esc-XmlText (Normalize-MDObjectRef "$rd"))" } X "$i" } else { X "$i" @@ -3358,7 +3362,7 @@ function Emit-ChartOfAccountsProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText "$($def.comment)")" } else { X "$i" } $useStdCmd = if (Get-BoolProp "useStandardCommands" $true) { "true" } else { "false" } @@ -3369,7 +3373,7 @@ function Emit-ChartOfAccountsProperties { # ExtDimensionTypes — ссылка на ПВХ видов субконто (прощающий ввод: ПланВидовХарактеристик.X → ChartOfCharacteristicTypes.X). $extDimTypes = if ($def.extDimensionTypes) { Resolve-TypePrefixSyn "$($def.extDimensionTypes)" } else { "" } - if ($extDimTypes) { X "$i$(Esc-Xml $extDimTypes)" } else { X "$i" } + if ($extDimTypes) { X "$i$(Esc-XmlText $extDimTypes)" } else { X "$i" } # Количество субконто: без ПВХ (extDimensionTypes) платформа не даёт > 0 → дефолт 0; с ПВХ — 3. $maxExtDim = if ($null -ne $def.maxExtDimensionCount) { "$($def.maxExtDimensionCount)" } elseif ($extDimTypes) { "3" } else { "0" } @@ -3464,7 +3468,7 @@ function Emit-AccountingRegisterProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText "$($def.comment)")" } else { X "$i" } $useStdCmd = if (Get-BoolProp "useStandardCommands" $true) { "true" } else { "false" } @@ -3473,7 +3477,7 @@ function Emit-AccountingRegisterProperties { X "$i$inclHelp" $chartOfAccounts = if ($def.chartOfAccounts) { "$($def.chartOfAccounts)" } else { "" } - if ($chartOfAccounts) { X "$i$(Esc-Xml $chartOfAccounts)" } + if ($chartOfAccounts) { X "$i$(Esc-XmlText $chartOfAccounts)" } else { X "$i" } $correspondence = if ($def.correspondence -eq $true) { "true" } else { "false" } @@ -3537,7 +3541,7 @@ function Emit-ChartOfCalculationTypesProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText "$($def.comment)")" } else { X "$i" } $useStdCmd = if (Get-BoolProp "useStandardCommands" $true) { "true" } else { "false" } @@ -3582,7 +3586,7 @@ function Emit-ChartOfCalculationTypesProperties { $baseTypes = @(); if ($def.baseCalculationTypes) { $baseTypes = @($def.baseCalculationTypes | ForEach-Object { Resolve-TypePrefixSyn "$_" }) } if ($baseTypes.Count -gt 0) { X "$i" - foreach ($bt in $baseTypes) { X "$i`t$(Esc-Xml (Normalize-MDObjectRef "$bt"))" } + foreach ($bt in $baseTypes) { X "$i`t$(Esc-XmlText (Normalize-MDObjectRef "$bt"))" } X "$i" } else { X "$i" } $actionPeriodUse = if ($def.actionPeriodUse -eq $true) { "true" } else { "false" } @@ -3616,7 +3620,7 @@ function Emit-CalculationRegisterProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText "$($def.comment)")" } else { X "$i" } $useStdCmd = if (Get-BoolProp "useStandardCommands" $true) { "true" } else { "false" } @@ -3634,16 +3638,16 @@ function Emit-CalculationRegisterProperties { X "$i$basePeriod" $schedule = if ($def.schedule) { "$($def.schedule)" } else { "" } - if ($schedule) { X "$i$(Esc-Xml $schedule)" } else { X "$i" } + if ($schedule) { X "$i$(Esc-XmlText $schedule)" } else { X "$i" } $scheduleValue = if ($def.scheduleValue) { "$($def.scheduleValue)" } else { "" } - if ($scheduleValue) { X "$i$(Esc-Xml $scheduleValue)" } else { X "$i" } + if ($scheduleValue) { X "$i$(Esc-XmlText $scheduleValue)" } else { X "$i" } $scheduleDate = if ($def.scheduleDate) { "$($def.scheduleDate)" } else { "" } - if ($scheduleDate) { X "$i$(Esc-Xml $scheduleDate)" } else { X "$i" } + if ($scheduleDate) { X "$i$(Esc-XmlText $scheduleDate)" } else { X "$i" } $chartOfCalcTypes = if ($def.chartOfCalculationTypes) { "$($def.chartOfCalculationTypes)" } else { "" } - if ($chartOfCalcTypes) { X "$i$(Esc-Xml $chartOfCalcTypes)" } + if ($chartOfCalcTypes) { X "$i$(Esc-XmlText $chartOfCalcTypes)" } else { X "$i" } $inclHelp = if (Get-BoolProp "includeHelpInContents" $false) { "true" } else { "false" } @@ -3668,7 +3672,7 @@ function Emit-BusinessProcessProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText "$($def.comment)")" } else { X "$i" } $useStdCmd = if (Get-BoolProp "useStandardCommands" $true) { "true" } else { "false" } @@ -3707,7 +3711,7 @@ function Emit-BusinessProcessProperties { Emit-BasedOn $i $def.basedOn X "$i$(Get-EnumProp 'NumberPeriodicity' 'numberPeriodicity' 'Nonperiodical')" - if ($def.task) { X "$i$(Esc-Xml "$($def.task)")" } else { X "$i" } + if ($def.task) { X "$i$(Esc-XmlText "$($def.task)")" } else { X "$i" } $createTaskPriv = if (Get-BoolProp "createTaskInPrivilegedMode" $true) { "true" } else { "false" } X "$i$createTaskPriv" @@ -3733,7 +3737,7 @@ function Emit-BusinessProcessProperties { function Emit-TaskProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym if ($def.comment) { X "$i$(Esc-XmlText "$($def.comment)")" } else { X "$i" } $useStdCmd = if (Get-BoolProp "useStandardCommands" $true) { "true" } else { "false" } @@ -3752,9 +3756,9 @@ function Emit-TaskProperties { X "$i$autonumbering" X "$i$taskNumberAutoPrefix" X "$i$descriptionLength" - if ($def.addressing) { X "$i$(Esc-Xml "$($def.addressing)")" } else { X "$i" } - if ($def.mainAddressingAttribute) { X "$i$(Esc-Xml "$($def.mainAddressingAttribute)")" } else { X "$i" } - if ($def.currentPerformer) { X "$i$(Esc-Xml "$($def.currentPerformer)")" } else { X "$i" } + if ($def.addressing) { X "$i$(Esc-XmlText "$($def.addressing)")" } else { X "$i" } + if ($def.mainAddressingAttribute) { X "$i$(Esc-XmlText "$($def.mainAddressingAttribute)")" } else { X "$i" } + if ($def.currentPerformer) { X "$i$(Esc-XmlText "$($def.currentPerformer)")" } else { X "$i" } Emit-BasedOn $i $def.basedOn Emit-StandardAttributes $i "Task" Emit-Characteristics $i $def.characteristics @@ -3798,12 +3802,12 @@ function Emit-HTTPServiceProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym - if ($def.comment) { X "$i$(Esc-Xml "$($def.comment)")" } else { X "$i" } + if ($def.comment) { X "$i$(Esc-XmlText "$($def.comment)")" } else { X "$i" } $rootURL = if ($def.rootURL) { "$($def.rootURL)" } else { $objName.ToLower() } - X "$i$(Esc-Xml $rootURL)" + X "$i$(Esc-XmlText $rootURL)" $reuseSessions = Get-EnumProp "ReuseSessions" "reuseSessions" "DontUse" X "$i$reuseSessions" @@ -3820,7 +3824,7 @@ function Emit-XDTOType { $uri = $Matches[1]; $local = $Matches[2] X "$indent<$tag xmlns:d1p1=`"$(Esc-Xml $uri)`">d1p1:$(Esc-Xml $local)" } else { - X "$indent<$tag>$(Esc-Xml $value)" + X "$indent<$tag>$(Esc-XmlText $value)" } } @@ -3828,12 +3832,12 @@ function Emit-WebServiceProperties { param([string]$indent) $i = $indent - X "$i$(Esc-Xml $objName)" + X "$i$(Esc-XmlText $objName)" Emit-MLText $i "Synonym" $synonym - if ($def.comment) { X "$i$(Esc-Xml "$($def.comment)")" } else { X "$i" } + if ($def.comment) { X "$i$(Esc-XmlText "$($def.comment)")" } else { X "$i" } $namespace = if ($def.namespace) { "$($def.namespace)" } else { "" } - X "$i$(Esc-Xml $namespace)" + X "$i$(Esc-XmlText $namespace)" # XDTOPackages — СПИСОК элементов, а не скаляр: значение либо ссылка на пакет конфигурации # (xr:MDObjectRef "XDTOPackage.Имя"), либо URI внешнего пространства имён (xs:string). @@ -3848,7 +3852,7 @@ function Emit-WebServiceProperties { X "$i`t" X "$i`t`t" X "$i`t`t0" - X "$i`t`t$(Esc-Xml $pv)" + X "$i`t`t$(Esc-XmlText $pv)" X "$i`t" } X "$i" @@ -3856,7 +3860,7 @@ function Emit-WebServiceProperties { # Имя файла дескриптора не выводится из имени сервиса (DMILService → dmil.1cws) — только дефолт. $descriptor = if ($def.descriptorFileName) { "$($def.descriptorFileName)" } else { "$objName.1cws" } - X "$i$(Esc-Xml $descriptor)" + X "$i$(Esc-XmlText $descriptor)" $reuseSessions = Get-EnumProp "ReuseSessions" "reuseSessions" "DontUse" X "$i$reuseSessions" @@ -3890,14 +3894,14 @@ function Emit-Column { X "$indent" X "$indent`t" - X "$indent`t`t$(Esc-Xml $name)" + X "$indent`t`t$(Esc-XmlText $name)" Emit-MLText "$indent`t`t" "Synonym" $synonym if ($comment) { X "$indent`t`t$(Esc-XmlText $comment)" } else { X "$indent`t`t" } X "$indent`t`t$indexing" if ($references.Count -gt 0) { X "$indent`t`t" foreach ($ref in $references) { - X "$indent`t`t`t$(Esc-Xml (Normalize-MDObjectRef "$ref"))" + X "$indent`t`t`t$(Esc-XmlText (Normalize-MDObjectRef "$ref"))" } X "$indent`t`t" } else { @@ -3933,10 +3937,10 @@ function Emit-URLTemplate { X "$indent" X "$indent`t" - X "$indent`t`t$(Esc-Xml $tmplName)" + X "$indent`t`t$(Esc-XmlText $tmplName)" Emit-MLText "$indent`t`t" "Synonym" $tmplSynonym - if ($tmplComment) { X "$indent`t`t$(Esc-Xml $tmplComment)" } else { X "$indent`t`t" } - X "$indent`t`t" + if ($tmplComment) { X "$indent`t`t$(Esc-XmlText $tmplComment)" } else { X "$indent`t`t" } + X "$indent`t`t" X "$indent`t" if ($methods.Count -gt 0) { @@ -3959,11 +3963,11 @@ function Emit-URLTemplate { X "$indent`t`t" X "$indent`t`t`t" - X "$indent`t`t`t`t$(Esc-Xml $methodName)" + X "$indent`t`t`t`t$(Esc-XmlText $methodName)" Emit-MLText "$indent`t`t`t`t" "Synonym" $methodSynonym - if ($methodComment) { X "$indent`t`t`t`t$(Esc-Xml $methodComment)" } else { X "$indent`t`t`t`t" } + if ($methodComment) { X "$indent`t`t`t`t$(Esc-XmlText $methodComment)" } else { X "$indent`t`t`t`t" } X "$indent`t`t`t`t$httpMethod" - X "$indent`t`t`t`t$(Esc-Xml $handler)" + X "$indent`t`t`t`t$(Esc-XmlText $handler)" X "$indent`t`t`t" X "$indent`t`t" } @@ -4009,13 +4013,13 @@ function Emit-Operation { X "$indent" X "$indent`t" - X "$indent`t`t$(Esc-Xml $opName)" + X "$indent`t`t$(Esc-XmlText $opName)" Emit-MLText "$indent`t`t" "Synonym" $opSynonym - if ($opComment) { X "$indent`t`t$(Esc-Xml $opComment)" } else { X "$indent`t`t" } + if ($opComment) { X "$indent`t`t$(Esc-XmlText $opComment)" } else { X "$indent`t`t" } Emit-XDTOType "$indent`t`t" "XDTOReturningValueType" $returnType X "$indent`t`t$nillable" X "$indent`t`t$transactioned" - X "$indent`t`t$(Esc-Xml $handler)" + X "$indent`t`t$(Esc-XmlText $handler)" X "$indent`t`t$dataLock" X "$indent`t" @@ -4042,9 +4046,9 @@ function Emit-Operation { X "$indent`t`t" X "$indent`t`t`t" - X "$indent`t`t`t`t$(Esc-Xml $paramName)" + X "$indent`t`t`t`t$(Esc-XmlText $paramName)" Emit-MLText "$indent`t`t`t`t" "Synonym" $paramSynonym - if ($paramComment) { X "$indent`t`t`t`t$(Esc-Xml $paramComment)" } else { X "$indent`t`t`t`t" } + if ($paramComment) { X "$indent`t`t`t`t$(Esc-XmlText $paramComment)" } else { X "$indent`t`t`t`t" } Emit-XDTOType "$indent`t`t`t`t" "XDTOValueType" $paramType X "$indent`t`t`t`t$paramNillable" X "$indent`t`t`t`t$paramDir" @@ -4861,7 +4865,7 @@ if ($objType -eq "ExchangePlan") { [void]$sbC.Append("`r`n") foreach ($it in $cItems) { [void]$sbC.Append("`t`r`n") - [void]$sbC.Append("`t`t$(Esc-Xml $it.metadata)`r`n") + [void]$sbC.Append("`t`t$(Esc-XmlText $it.metadata)`r`n") [void]$sbC.Append("`t`t$($it.autoRecord)`r`n") [void]$sbC.Append("`t`r`n") } diff --git a/.claude/skills/meta-compile/scripts/meta-compile.py b/.claude/skills/meta-compile/scripts/meta-compile.py index 884d68be..830e2fc2 100644 --- a/.claude/skills/meta-compile/scripts/meta-compile.py +++ b/.claude/skills/meta-compile/scripts/meta-compile.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# meta-compile v1.73 — Compile 1C metadata object from JSON +# meta-compile v1.74 — Compile 1C metadata object from JSON # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse @@ -520,7 +520,7 @@ def normalize_form_ref(s): def emit_form_ref(i, tag, val): """Ссылка на форму по умолчанию: непустая → значение, иначе .""" if val: - X(f'{i}<{tag}>{esc_xml(normalize_form_ref(str(val)))}') + X(f'{i}<{tag}>{esc_xml_text(normalize_form_ref(str(val)))}') else: X(f'{i}<{tag}/>') @@ -528,7 +528,7 @@ def emit_verbatim_ref(i, tag, val): """Ссылка verbatim (без normalize_form_ref): формы/схемы/хранилища Report/DataProcessor, где имя формы может быть буквально «Форма» (normalize перевёл бы имя-сегмент Форма→Form) либо ref не-форменного вида.""" if val: - X(f'{i}<{tag}>{esc_xml(str(val))}') + X(f'{i}<{tag}>{esc_xml_text(str(val))}') else: X(f'{i}<{tag}/>') @@ -1338,7 +1338,7 @@ def emit_standard_attribute(indent, attr_name, ov=None): lbt_dp = str(lbt.get('dataPath')) if isinstance(lbt, dict) else str(lbt) lbt_li = lbt.get('linkItem', 0) if isinstance(lbt, dict) else 0 X(f'{indent}\t') - X(f'{indent}\t\t{esc_xml(lbt_dp)}') + X(f'{indent}\t\t{esc_xml_text(lbt_dp)}') X(f'{indent}\t\t{lbt_li}') X(f'{indent}\t') else: @@ -1357,7 +1357,7 @@ def emit_standard_attribute(indent, attr_name, ov=None): X(f'{indent}\tfalse') emit_mltext(f'{indent}\t', 'xr:Format', fmt) if cf: - X(f'{indent}\t{esc_xml(str(cf))}') + X(f'{indent}\t{esc_xml_text(str(cf))}') else: X(f'{indent}\t') X(f'{indent}\tAuto') @@ -1386,7 +1386,7 @@ def emit_standard_attribute(indent, attr_name, ov=None): if fv_tx == '' or fv_tx is None: X(f'{indent}\t') else: - X(f'{indent}\t{esc_xml(fv_tx)}') + X(f'{indent}\t{esc_xml_text(fv_tx)}') if msk: X(f'{indent}\t{esc_xml_text(str(msk))}') else: @@ -1591,7 +1591,7 @@ def emit_link_by_type(indent, spec): return dp = expand_data_path(dp) X(f'{indent}') - X(f'{indent}\t{esc_xml(str(dp))}') + X(f'{indent}\t{esc_xml_text(str(dp))}') X(f'{indent}\t{li}') X(f'{indent}') @@ -1603,7 +1603,7 @@ def emit_field_block(indent, tag, fields): return X(f'{indent}<{tag}>') for f in arr: - X(f'{indent}\t{esc_xml(str(f))}') + X(f'{indent}\t{esc_xml_text(str(f))}') X(f'{indent}') def emit_based_on(indent, items): @@ -1614,7 +1614,7 @@ def emit_based_on(indent, items): return X(f'{indent}') for it in arr: - X(f'{indent}\t{esc_xml(normalize_md_object_ref(str(it)))}') + X(f'{indent}\t{esc_xml_text(normalize_md_object_ref(str(it)))}') X(f'{indent}') # --- Параметры/связи выбора (порт из form-compile) --- @@ -1752,14 +1752,14 @@ def emit_choice_parameters(indent, cp, tag='ChoiceParameters'): if tx == '' or tx is None: X(f'{indent}\t\t\t') else: - X(f'{indent}\t\t\t{esc_xml(tx)}') + X(f'{indent}\t\t\t{esc_xml_text(tx)}') X(f'{indent}\t\t') else: xt, tx = normalize_choice_value_t(val, ptype) if tx == '' or tx is None: X(f'{indent}\t\t') else: - X(f'{indent}\t\t{esc_xml(tx)}') + X(f'{indent}\t\t{esc_xml_text(tx)}') X(f'{indent}\t') X(f'{indent}') @@ -1786,8 +1786,8 @@ def emit_choice_parameter_links(indent, cpl, tag='ChoiceParameterLinks'): else: vc = str(vc_raw) X(f'{indent}\t') - X(f'{indent}\t\t{esc_xml(str(name))}') - X(f'{indent}\t\t{esc_xml(str(dp))}') + X(f'{indent}\t\t{esc_xml_text(str(name))}') + X(f'{indent}\t\t{esc_xml_text(str(dp))}') X(f'{indent}\t\t{vc}') X(f'{indent}\t') X(f'{indent}') @@ -1863,8 +1863,8 @@ def emit_characteristics(indent, chars): mvo = char_int_field(values, ['multipleValuesOrderField']) X(f'{indent}\t') X(f'{indent}\t\t') - X(f'{indent}\t\t\t{esc_xml(key)}') - X(f'{indent}\t\t\t{esc_xml(tff)}') + X(f'{indent}\t\t\t{esc_xml_text(key)}') + X(f'{indent}\t\t\t{esc_xml_text(tff)}') # filterValue: None→nil; голое→xs:string, полный путь→DTR, bool→xs:boolean. tfv_raw = ch_el_prop(types, ['filterValue', 'typesFilterValue']) if tfv_raw is None: @@ -1874,14 +1874,14 @@ def emit_characteristics(indent, chars): if tfv_tx == '' or tfv_tx is None: X(f'{indent}\t\t\t') else: - X(f'{indent}\t\t\t{esc_xml(tfv_tx)}') + X(f'{indent}\t\t\t{esc_xml_text(tfv_tx)}') X(f'{indent}\t\t\t{dpf}') X(f'{indent}\t\t\t{mvu}') X(f'{indent}\t\t') X(f'{indent}\t\t') - X(f'{indent}\t\t\t{esc_xml(obj)}') - X(f'{indent}\t\t\t{esc_xml(typ)}') - X(f'{indent}\t\t\t{esc_xml(val)}') + X(f'{indent}\t\t\t{esc_xml_text(obj)}') + X(f'{indent}\t\t\t{esc_xml_text(typ)}') + X(f'{indent}\t\t\t{esc_xml_text(val)}') X(f'{indent}\t\t\t{mvk}') X(f'{indent}\t\t\t{mvo}') X(f'{indent}\t\t') @@ -1894,7 +1894,7 @@ def emit_min_max_value(indent, tag, val): X(f'{indent}<{tag} xsi:nil="true"/>') return t = 'xs:string' if isinstance(val, str) else 'xs:decimal' - X(f'{indent}<{tag} xsi:type="{t}">{esc_xml(str(val))}') + X(f'{indent}<{tag} xsi:type="{t}">{esc_xml_text(str(val))}') def emit_attribute(indent, parsed, context, elem_tag='Attribute'): # context: "catalog", "document", "object", "processor", "tabular", "processor-tabular", "register", @@ -1911,7 +1911,7 @@ def emit_attribute(indent, parsed, context, elem_tag='Attribute'): uid = new_uuid() X(f'{indent}<{elem_tag} uuid="{uid}">') X(f'{indent}\t') - X(f'{indent}\t\t{esc_xml(parsed["name"])}') + X(f'{indent}\t\t{esc_xml_text(parsed["name"])}') emit_mltext(f'{indent}\t\t', 'Synonym', parsed['synonym']) if parsed.get('comment'): X(f'{indent}\t\t{esc_xml_text(parsed["comment"])}') @@ -1965,7 +1965,7 @@ def emit_attribute(indent, parsed, context, elem_tag='Attribute'): emit_choice_parameters(f'{indent}\t\t', parsed.get('choiceParameters')) X(f'{indent}\t\t{parsed.get("quickChoice") or "Auto"}') X(f'{indent}\t\t{parsed.get("createOnInput") or "Auto"}') - X(f'{indent}\t\t{esc_xml(str(parsed["choiceForm"]))}' if parsed.get('choiceForm') else f'{indent}\t\t') + X(f'{indent}\t\t{esc_xml_text(str(parsed["choiceForm"]))}' if parsed.get('choiceForm') else f'{indent}\t\t') emit_link_by_type(f'{indent}\t\t', parsed.get('linkByType')) chi = parsed.get('choiceHistoryOnInput') or 'Auto' X(f'{indent}\t\t{chi}') @@ -1990,7 +1990,7 @@ def emit_attribute(indent, parsed, context, elem_tag='Attribute'): # Регистр расчёта: ScheduleLink у измерений и реквизитов (НЕ ресурсов), перед Indexing. Дефолт пустой. if context == 'register-calc' and elem_tag in ('Dimension', 'Attribute'): if parsed.get('scheduleLink'): - X(f'{indent}\t\t{esc_xml(str(parsed["scheduleLink"]))}') + X(f'{indent}\t\t{esc_xml_text(str(parsed["scheduleLink"]))}') else: X(f'{indent}\t\t') # Измерение/ресурс регистра бухгалтерии: Balance + AccountingFlag, затем DenyIncompleteValues (изм.) / ExtDimensionAccountingFlag (рес.). @@ -1998,7 +1998,7 @@ def emit_attribute(indent, parsed, context, elem_tag='Attribute'): balance = 'true' if (parsed.get('balance') is True or 'balance' in parsed.get('flags', [])) else 'false' X(f'{indent}\t\t{balance}') if parsed.get('accountingFlag'): - X(f'{indent}\t\t{esc_xml(str(parsed["accountingFlag"]))}') + X(f'{indent}\t\t{esc_xml_text(str(parsed["accountingFlag"]))}') else: X(f'{indent}\t\t') if elem_tag == 'Dimension': @@ -2006,7 +2006,7 @@ def emit_attribute(indent, parsed, context, elem_tag='Attribute'): X(f'{indent}\t\t{deny_incomplete}') else: if parsed.get('extDimensionAccountingFlag'): - X(f'{indent}\t\t{esc_xml(str(parsed["extDimensionAccountingFlag"]))}') + X(f'{indent}\t\t{esc_xml_text(str(parsed["extDimensionAccountingFlag"]))}') else: X(f'{indent}\t\t') if context == 'catalog': @@ -2027,7 +2027,7 @@ def emit_attribute(indent, parsed, context, elem_tag='Attribute'): # Реквизит адресации задачи: AddressingDimension (между Indexing и FullTextSearch). if context == 'task-addressing' and elem_tag == 'AddressingAttribute': if parsed.get('addressingDimension'): - X(f'{indent}\t\t{esc_xml(str(parsed["addressingDimension"]))}') + X(f'{indent}\t\t{esc_xml_text(str(parsed["addressingDimension"]))}') else: X(f'{indent}\t\t') X(f'{indent}\t\t{parsed.get("fullTextSearch") or "Use"}') @@ -2074,9 +2074,9 @@ def emit_command_picture(indent, cmd): X(f'{indent}') m = re.match(r'^abs:(.*)$', src) if m: - X(f'{indent}\t{esc_xml(m.group(1))}') + X(f'{indent}\t{esc_xml_text(m.group(1))}') else: - X(f'{indent}\t{esc_xml(src)}') + X(f'{indent}\t{esc_xml_text(src)}') X(f'{indent}\t{"true" if lt else "false"}') if tpx: X(f'{indent}\t') @@ -2085,7 +2085,7 @@ def emit_command_picture(indent, cmd): def emit_command(indent, cmd_name, cmd): X(f'{indent}') X(f'{indent}\t') - X(f'{indent}\t\t{esc_xml(cmd_name)}') + X(f'{indent}\t\t{esc_xml_text(cmd_name)}') syn = cmd['synonym'] if cmd.get('synonym') is not None else split_camel_case(cmd_name) emit_mltext(f'{indent}\t\t', 'Synonym', syn) if cmd.get('comment'): @@ -2098,7 +2098,7 @@ def emit_command(indent, cmd_name, cmd): f"командного интерфейса раздела ('{group}'). Тип параметра — только для групп формы " f"(FormCommandBar*/FormNavigationPanel*) или CommandGroup.<Имя>.\n") sys.exit(1) - X(f'{indent}\t\t{esc_xml(group)}') + X(f'{indent}\t\t{esc_xml_text(group)}') if cmd.get('commandParameterType'): X(f'{indent}\t\t') emit_type_content(f'{indent}\t\t\t', str(cmd['commandParameterType'])) @@ -2111,7 +2111,7 @@ def emit_command(indent, cmd_name, cmd): emit_mltext(f'{indent}\t\t', 'ToolTip', cmd.get('tooltip')) emit_command_picture(f'{indent}\t\t', cmd) if cmd.get('shortcut'): - X(f'{indent}\t\t{esc_xml(str(cmd["shortcut"]))}') + X(f'{indent}\t\t{esc_xml_text(str(cmd["shortcut"]))}') else: X(f'{indent}\t\t') X(f'{indent}\t\t{cmd.get("onMainServerUnavalableBehavior") or "Auto"}') @@ -2135,7 +2135,7 @@ def emit_tabular_section(indent, ts_name, columns, object_type, object_name, ts_ X(f'{indent}\t') ts_synonym = ts_synonym_arg if ts_synonym_arg is not None else split_camel_case(ts_name) X(f'{indent}\t') - X(f'{indent}\t\t{esc_xml(ts_name)}') + X(f'{indent}\t\t{esc_xml_text(ts_name)}') emit_mltext(f'{indent}\t\t', 'Synonym', ts_synonym) if ts_comment: X(f'{indent}\t\t{esc_xml_text(ts_comment)}') @@ -2174,7 +2174,7 @@ def emit_enum_value(indent, parsed): uid = new_uuid() X(f'{indent}') X(f'{indent}\t') - X(f'{indent}\t\t{esc_xml(parsed["name"])}') + X(f'{indent}\t\t{esc_xml_text(parsed["name"])}') emit_mltext(f'{indent}\t\t', 'Synonym', parsed['synonym']) if parsed.get('comment'): X(f'{indent}\t\t{esc_xml_text(parsed["comment"])}') @@ -2191,7 +2191,7 @@ def emit_dimension(indent, parsed, register_type): uid = new_uuid() X(f'{indent}') X(f'{indent}\t') - X(f'{indent}\t\t{esc_xml(parsed["name"])}') + X(f'{indent}\t\t{esc_xml_text(parsed["name"])}') emit_mltext(f'{indent}\t\t', 'Synonym', parsed['synonym']) X(f'{indent}\t\t') type_str = parsed['type'] @@ -2227,7 +2227,7 @@ def emit_dimension(indent, parsed, register_type): X(f'{indent}\t\t') X(f'{indent}\t\tAuto') X(f'{indent}\t\tAuto') - X(f'{indent}\t\t{esc_xml(str(parsed["choiceForm"]))}' if parsed.get('choiceForm') else f'{indent}\t\t') + X(f'{indent}\t\t{esc_xml_text(str(parsed["choiceForm"]))}' if parsed.get('choiceForm') else f'{indent}\t\t') X(f'{indent}\t\t') X(f'{indent}\t\tAuto') if register_type == 'InformationRegister': @@ -2261,7 +2261,7 @@ def emit_resource(indent, parsed, register_type): uid = new_uuid() X(f'{indent}') X(f'{indent}\t') - X(f'{indent}\t\t{esc_xml(parsed["name"])}') + X(f'{indent}\t\t{esc_xml_text(parsed["name"])}') emit_mltext(f'{indent}\t\t', 'Synonym', parsed['synonym']) X(f'{indent}\t\t') type_str = parsed['type'] @@ -2301,7 +2301,7 @@ def emit_resource(indent, parsed, register_type): X(f'{indent}\t\t') X(f'{indent}\t\tAuto') X(f'{indent}\t\tAuto') - X(f'{indent}\t\t{esc_xml(str(parsed["choiceForm"]))}' if parsed.get('choiceForm') else f'{indent}\t\t') + X(f'{indent}\t\t{esc_xml_text(str(parsed["choiceForm"]))}' if parsed.get('choiceForm') else f'{indent}\t\t') X(f'{indent}\t\t') X(f'{indent}\t\tAuto') if register_type == 'InformationRegister': @@ -2319,7 +2319,7 @@ def emit_resource(indent, parsed, register_type): def emit_catalog_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) if defn.get('comment'): X(f'{i}{esc_xml_text(str(defn["comment"]))}') @@ -2341,7 +2341,7 @@ def emit_catalog_properties(indent): if owners: X(f'{i}') for owner_ref in owners: - X(f'{i}\t{esc_xml(normalize_md_object_ref(str(owner_ref), "Catalog"))}') + X(f'{i}\t{esc_xml_text(normalize_md_object_ref(str(owner_ref), "Catalog"))}') X(f'{i}') else: X(f'{i}') @@ -2416,7 +2416,7 @@ def emit_catalog_properties(indent): def emit_document_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) if defn.get('comment'): X(f'{i}{esc_xml_text(str(defn["comment"]))}') @@ -2425,7 +2425,7 @@ def emit_document_properties(indent): use_std_cmd = 'true' if get_bool_prop('useStandardCommands', True) else 'false' X(f'{i}{use_std_cmd}') if defn.get('numerator'): - X(f'{i}{esc_xml(str(defn["numerator"]))}') + X(f'{i}{esc_xml_text(str(defn["numerator"]))}') else: X(f'{i}') number_type = get_enum_prop('NumberType', 'numberType', 'String') @@ -2481,7 +2481,7 @@ def emit_document_properties(indent): if reg_records: X(f'{i}') for rr in reg_records: - X(f'{i}\t{esc_xml(normalize_md_object_ref(str(rr)))}') + X(f'{i}\t{esc_xml_text(normalize_md_object_ref(str(rr)))}') X(f'{i}') else: X(f'{i}') @@ -2509,7 +2509,7 @@ def emit_document_properties(indent): def emit_enum_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) if defn.get('comment'): X(f'{i}{esc_xml_text(defn["comment"])}') @@ -2533,7 +2533,7 @@ def emit_enum_properties(indent): def emit_constant_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) if defn.get('comment'): X(f'{i}{esc_xml_text(str(defn["comment"]))}') @@ -2571,7 +2571,7 @@ def emit_constant_properties(indent): emit_choice_parameters(i, defn.get('choiceParameters')) X(f'{i}{get_enum_prop("QuickChoice", "quickChoice", "Auto")}') if defn.get('choiceForm'): - X(f'{i}{esc_xml(str(defn["choiceForm"]))}') + X(f'{i}{esc_xml_text(str(defn["choiceForm"]))}') else: X(f'{i}') emit_link_by_type(i, defn.get('linkByType')) @@ -2583,7 +2583,7 @@ def emit_constant_properties(indent): def emit_information_register_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) if defn.get('comment'): X(f'{i}{esc_xml_text(str(defn["comment"]))}') @@ -2626,7 +2626,7 @@ def emit_information_register_properties(indent): def emit_accumulation_register_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) if defn.get('comment'): X(f'{i}{esc_xml_text(str(defn["comment"]))}') @@ -2655,7 +2655,7 @@ def emit_accumulation_register_properties(indent): def emit_defined_type_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) if defn.get('comment'): X(f'{i}{esc_xml_text(str(defn["comment"]))}') @@ -2675,7 +2675,7 @@ def emit_defined_type_properties(indent): def emit_functional_option_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) if defn.get('comment'): X(f'{i}{esc_xml_text(str(defn["comment"]))}') @@ -2684,7 +2684,7 @@ def emit_functional_option_properties(indent): # Location — хранилище значения опции (ссылка verbatim; location или value). loc = str(defn['location']) if defn.get('location') else (str(defn['value']) if defn.get('value') else '') if loc: - X(f'{i}{esc_xml(normalize_md_object_ref(loc))}') + X(f'{i}{esc_xml_text(normalize_md_object_ref(loc))}') else: X(f'{i}') # PrivilegedGetMode — дефолт true (корпус 2864/2864). @@ -2694,7 +2694,7 @@ def emit_functional_option_properties(indent): if content: X(f'{i}') for obj in content: - X(f'{i}\t{esc_xml(normalize_md_object_ref(str(obj)))}') + X(f'{i}\t{esc_xml_text(normalize_md_object_ref(str(obj)))}') X(f'{i}') else: X(f'{i}') @@ -2705,14 +2705,14 @@ def emit_md_ref_list(indent, tag, items): if arr: X(f'{indent}<{tag}>') for it in arr: - X(f'{indent}\t{esc_xml(normalize_md_object_ref(str(it)))}') + X(f'{indent}\t{esc_xml_text(normalize_md_object_ref(str(it)))}') X(f'{indent}') else: X(f'{indent}<{tag}/>') def emit_sequence_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) if defn.get('comment'): X(f'{i}{esc_xml_text(str(defn["comment"]))}') @@ -2725,7 +2725,7 @@ def emit_sequence_properties(indent): def emit_filter_criterion_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) if defn.get('comment'): X(f'{i}{esc_xml_text(str(defn["comment"]))}') @@ -2747,7 +2747,7 @@ def emit_filter_criterion_properties(indent): if content: X(f'{i}') for obj in content: - X(f'{i}\t{esc_xml(normalize_md_object_ref(str(obj)))}') + X(f'{i}\t{esc_xml_text(normalize_md_object_ref(str(obj)))}') X(f'{i}') else: X(f'{i}') @@ -2759,7 +2759,7 @@ def emit_filter_criterion_properties(indent): def emit_document_numerator_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) if defn.get('comment'): X(f'{i}{esc_xml_text(str(defn["comment"]))}') @@ -2774,7 +2774,7 @@ def emit_document_numerator_properties(indent): def emit_settings_storage_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) if defn.get('comment'): X(f'{i}{esc_xml_text(str(defn["comment"]))}') @@ -2787,7 +2787,7 @@ def emit_settings_storage_properties(indent): def emit_common_form_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) if defn.get('comment'): X(f'{i}{esc_xml_text(str(defn["comment"]))}') @@ -2817,7 +2817,7 @@ def _emit_comment(i): def emit_session_parameter_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) _emit_comment(i) if defn.get('valueType'): @@ -2833,14 +2833,14 @@ def emit_session_parameter_properties(indent): def emit_functional_options_parameter_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) _emit_comment(i) emit_md_ref_list(i, 'Use', defn.get('use')) def emit_ws_reference_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) _emit_comment(i) url = str(defn['locationURL']) if defn.get('locationURL') else (str(defn['locationUrl']) if defn.get('locationUrl') else '') @@ -2851,7 +2851,7 @@ def emit_ws_reference_properties(indent): def emit_common_picture_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) _emit_comment(i) X(f'{i}{"true" if get_bool_prop("availabilityForChoice", False) else "false"}') @@ -2859,14 +2859,14 @@ def emit_common_picture_properties(indent): def emit_common_template_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) _emit_comment(i) X(f'{i}{get_enum_prop("TemplateType", "templateType", "SpreadsheetDocument")}') def emit_command_group_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) _emit_comment(i) X(f'{i}{get_enum_prop("Representation", "representation", "Auto")}') @@ -2876,19 +2876,19 @@ def emit_command_group_properties(indent): def emit_common_command_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) _emit_comment(i) group = str(defn['group']) if defn.get('group') else '' if group: - X(f'{i}{esc_xml(group)}') + X(f'{i}{esc_xml_text(group)}') else: X(f'{i}') X(f'{i}{get_enum_prop("Representation", "representation", "Auto")}') emit_mltext(i, 'ToolTip', defn.get('tooltip')) emit_command_picture(i, defn) if defn.get('shortcut'): - X(f'{i}{esc_xml(str(defn["shortcut"]))}') + X(f'{i}{esc_xml_text(str(defn["shortcut"]))}') else: X(f'{i}') incl_help = 'true' if get_bool_prop('includeHelpInContents', False) else 'false' @@ -2905,7 +2905,7 @@ def emit_common_command_properties(indent): def emit_common_attribute_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) _emit_comment(i) vt = str(defn['valueType']) if defn.get('valueType') else 'String(0)' @@ -2932,7 +2932,7 @@ def emit_common_attribute_properties(indent): X(f'{i}{get_enum_prop("QuickChoice", "quickChoice", "Auto")}') X(f'{i}{get_enum_prop("CreateOnInput", "createOnInput", "Auto")}') if defn.get('choiceForm'): - X(f'{i}{esc_xml(str(defn["choiceForm"]))}') + X(f'{i}{esc_xml_text(str(defn["choiceForm"]))}') else: X(f'{i}') emit_link_by_type(i, defn.get('linkByType')) @@ -2944,11 +2944,11 @@ def emit_common_attribute_properties(indent): md = c if isinstance(c, str) else str(c.get('metadata', '')) use = 'Use' if isinstance(c, str) else (str(c['use']) if c.get('use') else 'Use') X(f'{i}\t') - X(f'{i}\t\t{esc_xml(normalize_md_object_ref(md))}') + X(f'{i}\t\t{esc_xml_text(normalize_md_object_ref(md))}') X(f'{i}\t\t{use}') cs = '' if isinstance(c, str) else (str(c['conditionalSeparation']) if c.get('conditionalSeparation') else '') if cs: - X(f'{i}\t\t{esc_xml(cs)}') + X(f'{i}\t\t{esc_xml_text(cs)}') else: X(f'{i}\t\t') X(f'{i}\t') @@ -2959,11 +2959,11 @@ def emit_common_attribute_properties(indent): X(f'{i}{get_enum_prop("DataSeparation", "dataSeparation", "DontUse")}') X(f'{i}{get_enum_prop("SeparatedDataUse", "separatedDataUse", "Independently")}') dsv = str(defn['dataSeparationValue']) if defn.get('dataSeparationValue') else '' - X(f'{i}{esc_xml(dsv)}' if dsv else f'{i}') + X(f'{i}{esc_xml_text(dsv)}' if dsv else f'{i}') dsu = str(defn['dataSeparationUse']) if defn.get('dataSeparationUse') else '' - X(f'{i}{esc_xml(dsu)}' if dsu else f'{i}') + X(f'{i}{esc_xml_text(dsu)}' if dsu else f'{i}') cs2 = str(defn['conditionalSeparation']) if defn.get('conditionalSeparation') else '' - X(f'{i}{esc_xml(cs2)}' if cs2 else f'{i}') + X(f'{i}{esc_xml_text(cs2)}' if cs2 else f'{i}') X(f'{i}{get_enum_prop("UsersSeparation", "usersSeparation", "DontUse")}') X(f'{i}{get_enum_prop("AuthenticationSeparation", "authenticationSeparation", "DontUse")}') X(f'{i}{get_enum_prop("ConfigurationExtensionsSeparation", "configurationExtensionsSeparation", "DontUse")}') @@ -2976,7 +2976,7 @@ def emit_sequence_dimension(indent, dim_def): parsed = parse_attribute_shorthand(dim_def) X(f'{indent}') X(f'{indent}\t') - X(f'{indent}\t\t{esc_xml(parsed["name"])}') + X(f'{indent}\t\t{esc_xml_text(parsed["name"])}') emit_mltext(f'{indent}\t\t', 'Synonym', parsed['synonym']) if parsed.get('comment'): X(f'{indent}\t\t{esc_xml_text(parsed["comment"])}') @@ -2997,7 +2997,7 @@ def emit_sequence_dimension(indent, dim_def): def emit_common_module_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) if defn.get('comment'): X(f'{i}{esc_xml_text(str(defn["comment"]))}') @@ -3044,7 +3044,7 @@ def emit_common_module_properties(indent): def emit_scheduled_job_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) if defn.get('comment'): X(f'{i}{esc_xml_text(str(defn["comment"]))}') @@ -3054,7 +3054,7 @@ def emit_scheduled_job_properties(indent): # Ensure CommonModule. prefix if method_name and not method_name.startswith('CommonModule.'): method_name = f'CommonModule.{method_name}' - X(f'{i}{esc_xml(method_name)}') + X(f'{i}{esc_xml_text(method_name)}') # Description — плоская строка (дефолт ПУСТО, не синоним — иначе роундтрип рвётся). description = str(defn['description']) if defn.get('description') else '' if description: @@ -3062,7 +3062,7 @@ def emit_scheduled_job_properties(indent): else: X(f'{i}') key = str(defn['key']) if defn.get('key') else '' - X(f'{i}{esc_xml(key)}') + X(f'{i}{esc_xml_text(key)}') use = 'true' if defn.get('use') is True else 'false' X(f'{i}{use}') predefined = 'true' if defn.get('predefined') is True else 'false' @@ -3074,7 +3074,7 @@ def emit_scheduled_job_properties(indent): def emit_event_subscription_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) if defn.get('comment'): X(f'{i}{esc_xml_text(str(defn["comment"]))}') @@ -3094,13 +3094,13 @@ def emit_event_subscription_properties(indent): # Ensure CommonModule. prefix if handler and not handler.startswith('CommonModule.'): handler = f'CommonModule.{handler}' - X(f'{i}{esc_xml(handler)}') + X(f'{i}{esc_xml_text(handler)}') # --- 13b. Report, DataProcessor --- def emit_report_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) if defn.get('comment'): X(f'{i}{esc_xml_text(defn["comment"])}') @@ -3125,7 +3125,7 @@ def emit_report_properties(indent): def emit_data_processor_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) if defn.get('comment'): X(f'{i}{esc_xml_text(defn["comment"])}') @@ -3144,7 +3144,7 @@ def emit_data_processor_properties(indent): def emit_exchange_plan_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) if defn.get('comment'): X(f'{i}{esc_xml_text(str(defn["comment"]))}') @@ -3205,7 +3205,7 @@ def emit_exchange_plan_properties(indent): def emit_chart_of_characteristic_types_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) if defn.get('comment'): X(f'{i}{esc_xml_text(str(defn["comment"]))}') @@ -3214,7 +3214,7 @@ def emit_chart_of_characteristic_types_properties(indent): X(f'{i}{"true" if get_bool_prop("useStandardCommands", True) else "false"}') X(f'{i}{"true" if get_bool_prop("includeHelpInContents", False) else "false"}') if defn.get('characteristicExtValues'): - X(f'{i}{esc_xml(str(defn["characteristicExtValues"]))}') + X(f'{i}{esc_xml_text(str(defn["characteristicExtValues"]))}') else: X(f'{i}') vt = defn.get('valueType') @@ -3300,7 +3300,7 @@ def emit_chart_of_characteristic_types_properties(indent): def emit_document_journal_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) if defn.get('comment'): X(f'{i}{esc_xml_text(str(defn["comment"]))}') @@ -3314,7 +3314,7 @@ def emit_document_journal_properties(indent): if reg_docs: X(f'{i}') for rd in reg_docs: - X(f'{i}\t{esc_xml(normalize_md_object_ref(str(rd)))}') + X(f'{i}\t{esc_xml_text(normalize_md_object_ref(str(rd)))}') X(f'{i}') else: X(f'{i}') @@ -3336,7 +3336,7 @@ def resolve_type_prefix_syn(ref): def emit_chart_of_accounts_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) if defn.get('comment'): X(f'{i}{esc_xml_text(str(defn["comment"]))}') @@ -3348,7 +3348,7 @@ def emit_chart_of_accounts_properties(indent): # ExtDimensionTypes — ссылка на ПВХ видов субконто (прощающий ввод: ПланВидовХарактеристик.X → ChartOfCharacteristicTypes.X). ext_dim_types = resolve_type_prefix_syn(str(defn['extDimensionTypes'])) if defn.get('extDimensionTypes') else '' if ext_dim_types: - X(f'{i}{esc_xml(ext_dim_types)}') + X(f'{i}{esc_xml_text(ext_dim_types)}') else: X(f'{i}') # Количество субконто: без ПВХ (extDimensionTypes) платформа не даёт > 0 → дефолт 0; с ПВХ — 3. @@ -3433,7 +3433,7 @@ def emit_chart_of_accounts_properties(indent): def emit_accounting_register_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) if defn.get('comment'): X(f'{i}{esc_xml_text(str(defn["comment"]))}') @@ -3443,7 +3443,7 @@ def emit_accounting_register_properties(indent): X(f'{i}{"true" if get_bool_prop("includeHelpInContents", False) else "false"}') chart_of_accounts = str(defn['chartOfAccounts']) if defn.get('chartOfAccounts') else '' if chart_of_accounts: - X(f'{i}{esc_xml(chart_of_accounts)}') + X(f'{i}{esc_xml_text(chart_of_accounts)}') else: X(f'{i}') correspondence = 'true' if defn.get('correspondence') is True else 'false' @@ -3492,7 +3492,7 @@ def emit_calc_types_std_tabular(i): def emit_chart_of_calculation_types_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) if defn.get('comment'): X(f'{i}{esc_xml_text(str(defn["comment"]))}') @@ -3535,7 +3535,7 @@ def emit_chart_of_calculation_types_properties(indent): if base_types: X(f'{i}') for bt in base_types: - X(f'{i}\t{esc_xml(normalize_md_object_ref(bt))}') + X(f'{i}\t{esc_xml_text(normalize_md_object_ref(bt))}') X(f'{i}') else: X(f'{i}') @@ -3560,7 +3560,7 @@ def emit_chart_of_calculation_types_properties(indent): def emit_calculation_register_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) if defn.get('comment'): X(f'{i}{esc_xml_text(str(defn["comment"]))}') @@ -3577,22 +3577,22 @@ def emit_calculation_register_properties(indent): X(f'{i}{base_period}') schedule = str(defn['schedule']) if defn.get('schedule') else '' if schedule: - X(f'{i}{esc_xml(schedule)}') + X(f'{i}{esc_xml_text(schedule)}') else: X(f'{i}') schedule_value = str(defn['scheduleValue']) if defn.get('scheduleValue') else '' if schedule_value: - X(f'{i}{esc_xml(schedule_value)}') + X(f'{i}{esc_xml_text(schedule_value)}') else: X(f'{i}') schedule_date = str(defn['scheduleDate']) if defn.get('scheduleDate') else '' if schedule_date: - X(f'{i}{esc_xml(schedule_date)}') + X(f'{i}{esc_xml_text(schedule_date)}') else: X(f'{i}') chart_of_calc_types = str(defn['chartOfCalculationTypes']) if defn.get('chartOfCalculationTypes') else '' if chart_of_calc_types: - X(f'{i}{esc_xml(chart_of_calc_types)}') + X(f'{i}{esc_xml_text(chart_of_calc_types)}') else: X(f'{i}') X(f'{i}{"true" if get_bool_prop("includeHelpInContents", False) else "false"}') @@ -3607,7 +3607,7 @@ def emit_calculation_register_properties(indent): def emit_business_process_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) if defn.get('comment'): X(f'{i}{esc_xml_text(str(defn["comment"]))}') @@ -3646,7 +3646,7 @@ def emit_business_process_properties(indent): X(f'{i}{get_enum_prop("NumberPeriodicity", "numberPeriodicity", "Nonperiodical")}') task_ref = str(defn['task']) if defn.get('task') else '' if task_ref: - X(f'{i}{esc_xml(task_ref)}') + X(f'{i}{esc_xml_text(task_ref)}') else: X(f'{i}') X(f'{i}{"true" if get_bool_prop("createTaskInPrivilegedMode", True) else "false"}') @@ -3666,7 +3666,7 @@ def emit_business_process_properties(indent): def emit_task_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) if defn.get('comment'): X(f'{i}{esc_xml_text(str(defn["comment"]))}') @@ -3687,9 +3687,9 @@ def emit_task_properties(indent): X(f'{i}{autonumbering}') X(f'{i}{task_number_auto_prefix}') X(f'{i}{description_length}') - X(f'{i}{esc_xml(str(defn["addressing"]))}' if defn.get('addressing') else f'{i}') - X(f'{i}{esc_xml(str(defn["mainAddressingAttribute"]))}' if defn.get('mainAddressingAttribute') else f'{i}') - X(f'{i}{esc_xml(str(defn["currentPerformer"]))}' if defn.get('currentPerformer') else f'{i}') + X(f'{i}{esc_xml_text(str(defn["addressing"]))}' if defn.get('addressing') else f'{i}') + X(f'{i}{esc_xml_text(str(defn["mainAddressingAttribute"]))}' if defn.get('mainAddressingAttribute') else f'{i}') + X(f'{i}{esc_xml_text(str(defn["currentPerformer"]))}' if defn.get('currentPerformer') else f'{i}') emit_based_on(i, defn.get('basedOn')) emit_standard_attributes(i, 'Task') emit_characteristics(i, defn.get('characteristics')) @@ -3727,11 +3727,11 @@ def emit_task_properties(indent): def emit_http_service_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) - X(f'{i}{esc_xml(str(defn["comment"]))}' if defn.get('comment') else f'{i}') + X(f'{i}{esc_xml_text(str(defn["comment"]))}' if defn.get('comment') else f'{i}') root_url = str(defn['rootURL']) if defn.get('rootURL') else obj_name.lower() - X(f'{i}{esc_xml(root_url)}') + X(f'{i}{esc_xml_text(root_url)}') reuse_sessions = get_enum_prop('ReuseSessions', 'reuseSessions', 'DontUse') X(f'{i}{reuse_sessions}') session_max_age = str(defn['sessionMaxAge']) if defn.get('sessionMaxAge') is not None else '20' @@ -3744,16 +3744,16 @@ def emit_xdto_type(indent, tag, value): if m: X(f'{indent}<{tag} xmlns:d1p1="{esc_xml(m.group(1))}">d1p1:{esc_xml(m.group(2))}') else: - X(f'{indent}<{tag}>{esc_xml(value)}') + X(f'{indent}<{tag}>{esc_xml_text(value)}') def emit_web_service_properties(indent): i = indent - X(f'{i}{esc_xml(obj_name)}') + X(f'{i}{esc_xml_text(obj_name)}') emit_mltext(i, 'Synonym', synonym) - X(f'{i}{esc_xml(str(defn["comment"]))}' if defn.get('comment') else f'{i}') + X(f'{i}{esc_xml_text(str(defn["comment"]))}' if defn.get('comment') else f'{i}') namespace = str(defn['namespace']) if defn.get('namespace') else '' - X(f'{i}{esc_xml(namespace)}') + X(f'{i}{esc_xml_text(namespace)}') # XDTOPackages — СПИСОК элементов: ссылка на пакет конфигурации (xr:MDObjectRef) либо URI # внешнего пространства имён (xs:string). Presentation пуст, CheckState 0 (корпус: 19/19). pkgs = defn.get('xdtoPackages') or [] @@ -3767,14 +3767,14 @@ def emit_web_service_properties(indent): X(f'{i}\t') X(f'{i}\t\t') X(f'{i}\t\t0') - X(f'{i}\t\t{esc_xml(pv)}') + X(f'{i}\t\t{esc_xml_text(pv)}') X(f'{i}\t') X(f'{i}') else: X(f'{i}') # Имя файла дескриптора не выводится из имени сервиса (DMILService -> dmil.1cws) — только дефолт. descriptor = str(defn['descriptorFileName']) if defn.get('descriptorFileName') else f'{obj_name}.1cws' - X(f'{i}{esc_xml(descriptor)}') + X(f'{i}{esc_xml_text(descriptor)}') reuse_sessions = get_enum_prop('ReuseSessions', 'reuseSessions', 'DontUse') X(f'{i}{reuse_sessions}') session_max_age = str(defn['sessionMaxAge']) if defn.get('sessionMaxAge') is not None else '20' @@ -3804,7 +3804,7 @@ def emit_column(indent, col_def): references = list(col_def['references']) X(f'{indent}') X(f'{indent}\t') - X(f'{indent}\t\t{esc_xml(name)}') + X(f'{indent}\t\t{esc_xml_text(name)}') emit_mltext(f'{indent}\t\t', 'Synonym', col_synonym) if comment: X(f'{indent}\t\t{esc_xml_text(comment)}') @@ -3814,7 +3814,7 @@ def emit_column(indent, col_def): if references: X(f'{indent}\t\t') for ref in references: - X(f'{indent}\t\t\t{esc_xml(normalize_md_object_ref(str(ref)))}') + X(f'{indent}\t\t\t{esc_xml_text(normalize_md_object_ref(str(ref)))}') X(f'{indent}\t\t') else: X(f'{indent}\t\t') @@ -3840,10 +3840,10 @@ def emit_url_template(indent, tmpl_name, tmpl_def): methods[k] = v # строка (HTTP-метод) ЛИБО объект {httpMethod, handler, synonym, comment} X(f'{indent}') X(f'{indent}\t') - X(f'{indent}\t\t{esc_xml(tmpl_name)}') + X(f'{indent}\t\t{esc_xml_text(tmpl_name)}') emit_mltext(f'{indent}\t\t', 'Synonym', tmpl_synonym) - X(f'{indent}\t\t{esc_xml(tmpl_comment)}' if tmpl_comment else f'{indent}\t\t') - X(f'{indent}\t\t') + X(f'{indent}\t\t{esc_xml_text(tmpl_comment)}' if tmpl_comment else f'{indent}\t\t') + X(f'{indent}\t\t') X(f'{indent}\t') if methods: X(f'{indent}\t') @@ -3865,11 +3865,11 @@ def emit_url_template(indent, tmpl_name, tmpl_def): method_comment = str(m_def.get('comment') or '') X(f'{indent}\t\t') X(f'{indent}\t\t\t') - X(f'{indent}\t\t\t\t{esc_xml(method_name)}') + X(f'{indent}\t\t\t\t{esc_xml_text(method_name)}') emit_mltext(f'{indent}\t\t\t\t', 'Synonym', method_synonym) - X(f'{indent}\t\t\t\t{esc_xml(method_comment)}' if method_comment else f'{indent}\t\t\t\t') + X(f'{indent}\t\t\t\t{esc_xml_text(method_comment)}' if method_comment else f'{indent}\t\t\t\t') X(f'{indent}\t\t\t\t{http_method}') - X(f'{indent}\t\t\t\t{esc_xml(handler)}') + X(f'{indent}\t\t\t\t{esc_xml_text(handler)}') X(f'{indent}\t\t\t') X(f'{indent}\t\t') X(f'{indent}\t') @@ -3911,13 +3911,13 @@ def emit_operation(indent, op_name, op_def): params[k] = v X(f'{indent}') X(f'{indent}\t') - X(f'{indent}\t\t{esc_xml(op_name)}') + X(f'{indent}\t\t{esc_xml_text(op_name)}') emit_mltext(f'{indent}\t\t', 'Synonym', op_synonym) - X(f'{indent}\t\t{esc_xml(op_comment)}' if op_comment else f'{indent}\t\t') + X(f'{indent}\t\t{esc_xml_text(op_comment)}' if op_comment else f'{indent}\t\t') emit_xdto_type(f'{indent}\t\t', 'XDTOReturningValueType', return_type) X(f'{indent}\t\t{nillable}') X(f'{indent}\t\t{transactioned}') - X(f'{indent}\t\t{esc_xml(handler)}') + X(f'{indent}\t\t{esc_xml_text(handler)}') X(f'{indent}\t\t{data_lock}') X(f'{indent}\t') if params: @@ -3945,9 +3945,9 @@ def emit_operation(indent, op_name, op_def): param_comment = str(param_def['comment']) X(f'{indent}\t\t') X(f'{indent}\t\t\t') - X(f'{indent}\t\t\t\t{esc_xml(param_name)}') + X(f'{indent}\t\t\t\t{esc_xml_text(param_name)}') emit_mltext(f'{indent}\t\t\t\t', 'Synonym', param_synonym) - X(f'{indent}\t\t\t\t{esc_xml(param_comment)}' if param_comment else f'{indent}\t\t\t\t') + X(f'{indent}\t\t\t\t{esc_xml_text(param_comment)}' if param_comment else f'{indent}\t\t\t\t') emit_xdto_type(f'{indent}\t\t\t\t', 'XDTOValueType', param_type) X(f'{indent}\t\t\t\t{param_nillable}') X(f'{indent}\t\t\t\t{param_dir}') @@ -4755,7 +4755,7 @@ if obj_type == 'ExchangePlan': f'\r\n'] for it in c_items: parts.append('\t\r\n') - parts.append(f'\t\t{esc_xml(it["metadata"])}\r\n') + parts.append(f'\t\t{esc_xml_text(it["metadata"])}\r\n') parts.append(f'\t\t{it["autoRecord"]}\r\n') parts.append('\t\r\n') parts.append('\r\n') @@ -4857,7 +4857,7 @@ if os.path.isfile(config_xml_path): reg_result = 'already' else: eol = '\r\n' if '\r\n' in config_content else '\n' - entry = f'<{child_tag}>{esc_xml(obj_name)}' + entry = f'<{child_tag}>{esc_xml_text(obj_name)}' block = re.search(r'.*?', config_content, re.S) if block is None: diff --git a/.claude/skills/meta-decompile/scripts/meta-decompile.ps1 b/.claude/skills/meta-decompile/scripts/meta-decompile.ps1 index e4573290..4d31f5b0 100644 --- a/.claude/skills/meta-decompile/scripts/meta-decompile.ps1 +++ b/.claude/skills/meta-decompile/scripts/meta-decompile.ps1 @@ -1,4 +1,4 @@ -# meta-decompile v0.61 — XML объекта метаданных 1С → JSON-черновик формата meta-compile +# meta-decompile v0.62 — XML объекта метаданных 1С → JSON-черновик формата meta-compile # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills # # Поддержаны: Catalog, ExchangePlan, ChartOfCharacteristicTypes, ChartOfAccounts, ChartOfCalculationTypes, Document, @@ -1029,7 +1029,13 @@ if ($charsNode) { filterField = Shorten-CharField (& $gt 'TypesFilterField' $ct) $tFrom filterValue = if ($tfvNil -eq 'true') { $null } else { Convert-ChScalarNode $tfvNode } } - $dpf = & $giv 'DataPathField' $ct; if ($dpf -ne -1) { $types['dataPathField'] = $dpf } + # DataPathField полиморфно: обычно -1, но встречается ПУТЬ к полю (8 случаев на корпус). + # Жёсткое [int] на нём роняло декомпиляцию всего объекта. + $dpfN = $ct.SelectSingleNode('xr:DataPathField', $nsm) + $dpfT = if ($dpfN) { $dpfN.InnerText } else { '' } + if ($dpfT -ne '' -and $dpfT -cne '-1') { + $types['dataPathField'] = if ($dpfT -match '^-?\d+$') { [int]$dpfT } else { Shorten-CharField $dpfT $tFrom } + } $mvu = & $giv 'MultipleValuesUseField' $ct; if ($mvu -ne -1) { $types['multipleValuesUseField'] = $mvu } $values = [ordered]@{ from = $vFrom