mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-09-18 15:45:52 +03:00
feat(skd-decompile): чтение additionalProperties в settings
<dcsset:additionalProperties> → dict в settings.additionalProperties. Все значения xs:string, простые key→value пары. Эффект на sample30: −121 строка diff. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
f19032594c
commit
092cd8ebb4
@@ -1,4 +1,4 @@
|
|||||||
# skd-decompile v0.38 — Decompile 1C DCS Template.xml to JSON DSL (draft)
|
# skd-decompile v0.39 — Decompile 1C DCS Template.xml to JSON DSL (draft)
|
||||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||||
param(
|
param(
|
||||||
[Parameter(Mandatory)]
|
[Parameter(Mandatory)]
|
||||||
@@ -2317,6 +2317,18 @@ foreach ($sv in $svNodes) {
|
|||||||
$sivmNode = $settingsNode.SelectSingleNode("dcsset:itemsViewMode", $ns)
|
$sivmNode = $settingsNode.SelectSingleNode("dcsset:itemsViewMode", $ns)
|
||||||
if ($sivmNode) { $settings['itemsViewMode'] = $sivmNode.InnerText }
|
if ($sivmNode) { $settings['itemsViewMode'] = $sivmNode.InnerText }
|
||||||
|
|
||||||
|
# <dcsset:additionalProperties> — key→value свойства варианта (URL, имя, GUID и т.п.)
|
||||||
|
$apNode = $settingsNode.SelectSingleNode("dcsset:additionalProperties", $ns)
|
||||||
|
if ($apNode) {
|
||||||
|
$apDict = [ordered]@{}
|
||||||
|
foreach ($prop in $apNode.SelectNodes("v8:Property", $ns)) {
|
||||||
|
$pName = $prop.GetAttribute("name")
|
||||||
|
$valEl = $prop.SelectSingleNode("v8:Value", $ns)
|
||||||
|
if ($pName -and $valEl) { $apDict[$pName] = $valEl.InnerText }
|
||||||
|
}
|
||||||
|
if ($apDict.Count -gt 0) { $settings['additionalProperties'] = $apDict }
|
||||||
|
}
|
||||||
|
|
||||||
# Skip pure-default variants: settings contains only "details" structure (or nothing) +
|
# Skip pure-default variants: settings contains only "details" structure (or nothing) +
|
||||||
# name=Основной + no distinctive title.
|
# name=Основной + no distinctive title.
|
||||||
$nonStructKeys = @($settings.Keys | Where-Object { $_ -ne 'structure' })
|
$nonStructKeys = @($settings.Keys | Where-Object { $_ -ne 'structure' })
|
||||||
|
|||||||
Reference in New Issue
Block a user