diff --git a/.claude/skills/skd-compile/scripts/skd-compile.ps1 b/.claude/skills/skd-compile/scripts/skd-compile.ps1
index ff40fd6a..c1b4df93 100644
--- a/.claude/skills/skd-compile/scripts/skd-compile.ps1
+++ b/.claude/skills/skd-compile/scripts/skd-compile.ps1
@@ -1,4 +1,4 @@
-# skd-compile v1.38 — Compile 1C DCS from JSON
+# skd-compile v1.39 — Compile 1C DCS from JSON
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
param(
[string]$DefinitionFile,
@@ -989,7 +989,7 @@ function Emit-Field {
# === DataSets ===
function Emit-DataSet {
- param($ds, [string]$indent)
+ param($ds, [string]$indent, [string]$tagName = "dataSet")
# Determine type
if ($ds.items) {
@@ -1000,7 +1000,7 @@ function Emit-DataSet {
$dsType = "DataSetQuery"
}
- X "$indent"
+ X "$indent<$tagName xsi:type=`"$dsType`">"
X "$indent`t$(Esc-Xml "$($ds.name)")"
# Fields
@@ -1027,12 +1027,12 @@ function Emit-DataSet {
X "$indent`t$(Esc-Xml "$($ds.objectName)")"
} elseif ($dsType -eq "DataSetUnion") {
foreach ($item in $ds.items) {
- # Union items are nested dataSets
- Emit-DataSet -ds $item -indent "$indent`t" | Out-Null
+ # Union inner items are wrapped as -
+ Emit-DataSet -ds $item -indent "$indent`t" -tagName "item" | Out-Null
}
}
- X "$indent
"
+ X "$indent$tagName>"
}
function Emit-DataSets {
diff --git a/.claude/skills/skd-compile/scripts/skd-compile.py b/.claude/skills/skd-compile/scripts/skd-compile.py
index 0b99b07e..aa5ee862 100644
--- a/.claude/skills/skd-compile/scripts/skd-compile.py
+++ b/.claude/skills/skd-compile/scripts/skd-compile.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
-# skd-compile v1.38 — Compile 1C DCS from JSON
+# skd-compile v1.39 — Compile 1C DCS from JSON
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
import argparse
import json
@@ -759,7 +759,7 @@ def emit_field(lines, field_def, indent):
# === DataSets ===
-def emit_data_set(lines, ds, indent, default_source):
+def emit_data_set(lines, ds, indent, default_source, tag_name='dataSet'):
# Determine type
if ds.get('items'):
ds_type = 'DataSetUnion'
@@ -768,7 +768,7 @@ def emit_data_set(lines, ds, indent, default_source):
else:
ds_type = 'DataSetQuery'
- lines.append(f'{indent}')
+ lines.append(f'{indent}<{tag_name} xsi:type="{ds_type}">')
lines.append(f'{indent}\t{esc_xml(str(ds.get("name", "")))}')
# Fields
@@ -791,9 +791,10 @@ def emit_data_set(lines, ds, indent, default_source):
lines.append(f'{indent}\t{esc_xml(str(ds["objectName"]))}')
elif ds_type == 'DataSetUnion':
for item in ds['items']:
- emit_data_set(lines, item, f'{indent}\t', default_source)
+ # Union inner items are wrapped as -
+ emit_data_set(lines, item, f'{indent}\t', default_source, tag_name='item')
- lines.append(f'{indent}
')
+ lines.append(f'{indent}{tag_name}>')
def emit_data_sets(lines, defn, default_source):
diff --git a/tests/skills/cases/skd-decompile/snapshots/dataset-types/Template.xml b/tests/skills/cases/skd-decompile/snapshots/dataset-types/Template.xml
index cf140321..bc0e20cc 100644
--- a/tests/skills/cases/skd-decompile/snapshots/dataset-types/Template.xml
+++ b/tests/skills/cases/skd-decompile/snapshots/dataset-types/Template.xml
@@ -56,7 +56,7 @@
Объединение
-
+ -
Часть1
Поле
@@ -72,8 +72,8 @@
ИсточникДанных1
ВЫБРАТЬ 1 КАК Поле
-
-
+
+ -
Часть2
Поле
@@ -89,7 +89,7 @@
ИсточникДанных1
ВЫБРАТЬ 2 КАК Поле
-
+
Основной
diff --git a/tests/skills/cases/skd-decompile/snapshots/structure-nested-and-folder/Template.xml b/tests/skills/cases/skd-decompile/snapshots/structure-nested-and-folder/Template.xml
index 07046a4a..c8d62202 100644
--- a/tests/skills/cases/skd-decompile/snapshots/structure-nested-and-folder/Template.xml
+++ b/tests/skills/cases/skd-decompile/snapshots/structure-nested-and-folder/Template.xml
@@ -49,16 +49,16 @@
d5p1:CatalogRef.Подразделения
-
+ -
Часть1
ИсточникДанных1
ДанныеЧасть1
-
-
+
+ -
Часть2
ИсточникДанных1
ДанныеЧасть2
-
+
Основной