# form-decompile v0.81 — Decompile 1C managed Form.xml to JSON DSL (draft) # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills # ВНИМАНИЕ: раундтрип не гарантируется. Навык исключён из авто-использования моделью. param( [Parameter(Mandatory)] [Alias('Path')] [string]$FormPath, [string]$OutputPath ) $ErrorActionPreference = "Stop" [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 # --- 0. Resolve and validate input --- if (-not (Test-Path $FormPath)) { Write-Error "Form not found: $FormPath" exit 1 } $FormPath = (Resolve-Path $FormPath).Path $xmlDoc = New-Object System.Xml.XmlDocument $xmlDoc.PreserveWhitespace = $false $xmlDoc.Load($FormPath) $root = $xmlDoc.DocumentElement # Ring 2: not a managed Form if ($root.LocalName -ne 'Form') { [Console]::Error.WriteLine("form-decompile: корневой элемент <$($root.LocalName)> не