Changes one element of the package without requiring reading and rewriting the whole schema — for large
packages (EnterpriseData — about a megabyte) this is the only practical way.
If you need to rework the schema as a whole or first understand how it is structured, —
/xdto-decompile → XSD editing → /xdto-compile -Force.
Parameters
| Parameter | Required | Description |
|---|---|---|
PackagePath |
yes | Package directory, Ext/Package.bin or <Имя>.xml. Alias — -Path |
Operation |
yes | Operation from the table below |
Target |
depends | Address: type name or path Тип.Свойство |
Value |
depends | XSD fragment, literal, URI, or text. @путь — take the content from a file |
NoValidate |
no | Do not run xdto-validate after editing |
powershell.exe -NoProfile -File "${CLAUDE_SKILL_DIR}/scripts/xdto-edit.ps1" -PackagePath "<путь>" -Operation <op> -Target "<адрес>" -Value "<значение>"
Operations
| Operation | -Target |
-Value |
|---|---|---|
add-property |
type name | <xs:element> or <xs:attribute> |
replace-property |
Тип.Свойство |
new declaration as a whole |
remove-property |
Тип.Свойство |
— |
add-type |
— | <xs:complexType> or <xs:simpleType> |
remove-type |
type name | — |
add-enum |
value type name | literal |
add-import |
— | namespace URI |
rename |
— | new metadata object name |
set-synonym |
— | synonym |
set-comment |
— | comment |
set-namespace |
— | new namespace URI |
Batch via ;; where enumeration makes sense: remove-property, remove-type,
add-enum, add-import.
... -Operation add-property -Target "Платёж" -Value '<xs:element name="Комментарий" type="xs:string" minOccurs="0"/>'
... -Operation remove-property -Target "Платёж.Комментарий ;; Платёж.Черновик"
... -Operation add-enum -Target "ВидДокумента" -Value "Инкассо ;; Аккредитив"
... -Operation rename -Value ОбменСБанком
The content is always described by an XML schema fragment — in the same language as in
/xdto-compile. There are no separate parameters of the form -MinOccurs no: to change a property,
give its new declaration as a whole via replace-property.
The length restriction and other facets are specified by a nested type:
<xs:element name="Комментарий" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string"><xs:maxLength value="200"/></xs:restriction>
</xs:simpleType>
</xs:element>
Pass a multi-line fragment as a file: -Value "@frag.xsd". Inline via the shell
is reliable only for single-line fragments without nested quotes.
Addressing
Path Тип.Свойство. The dot is safe: type and property names are 1C identifiers.
The path continues into built-in types: ПлатежныйДокумент.ДатаСписано.ИдПлатежа.
To see what is in the package and what the needed type is called, — /xdto-info.
Before editing a type, it is useful to /xdto-info -Mode used-by -Name <Тип>: it will show
who will be affected by the change.
What renaming and changing the namespace entail
rename changes the name in the metadata object, renames the file <Имя>.xml and the directory
<Имя>/, edits the registration in Configuration.xml. The new name is checked for
validity as a 1C identifier and for being taken.
set-namespace changes targetNamespace, all internal references to its own types
and <Namespace> of the metadata object. Packages that import the old namespace
are not changed — during versioning they should continue to look at the previous one.
The skill will list them; if the edit is not versioned, fix their imports yourself.
After the edit, it automatically starts /xdto-validate — it is disabled via -NoValidate.
Typical workflow
/xdto-info <пакет>— find the needed type/xdto-info <пакет> -Mode used-by -Name <Тип>— if you are changing an existing one/xdto-edit <пакет> -Operation <op> …/db-load-xml+/db-update