Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.

Create new with XSD Version  8 (Net)

Action group: XML

...

Description

The action creates the XML-file context according to the schema specified in the XSD-file.

Action icon

Image Removed

Parameters

...

Image Added

Settings of parameters

ParameterDescription
XSD-filePath to the file with .xsd extension that contains an XML schema.
OptionsA collection with the values of the elements to be set.

Output parameters

XSD-файл                         Path to the file with .xsd extension that contains an XML schema

Параметры                      A collection with the values of the elements to be set

Выходные параметры

Контекст                          XML-контекст

...

Context - context of a new XML-document. 

Settings

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
XSD fileFile with XSD-schemeRobin.FilePath
Yes
OptionsValue of parametersRobin.Collection
No
Results
ContextContext of a new XML documentRobin.XMLXML context

Подробнее о More about XSD https://habr.com/ru/post/90696/

Особые условия использования

В действие  заложена "проверка" типов данных, переданных в коллекцию:

  • Если переданные данные из коллекции, не соответствуют типам данных XSD-файла, то выдается сообщение: "Тип значений, указанных в коллекции, не соответствуют типам данных, которые указаны в XSD-файле."
  • Если в коллекции не указаны значения для обязательных параметров, то выдается сообщение: "В коллекции не указаны значения для элементов, которые указаны в XSD-файле как обязательные."
  • Если пользователь указывает некорректный параметр, то выдается сообщение: "Указан файл с некорректным расширением. Допустимое расширение - xsd."
  • Если пользователь указывает невалидный XSD-файл (неправильный синтаксис), то выдается сообщение: "Указанный файл имеет недопустимый синтаксис."

Пример использования 

Задача

Создать новый контекст по работе с XML- документом, используя XSD.

Решение

Воспользоваться действием "Создать по XSD". 

Реализация

  1. Перенести действие "Создать по XSD" на рабочую область 
    Image Removed
  2. Настроить параметры действия "Создать по XSD". 
    В поле "XSD файл" указать путь к файлу, где хранится шаблон XSD файла или указать шаблон для XML файла, который будет указывать в каком порядке и какие элементы будут созданы в XSD - файле.
    Image Removed 
  3. В поле "Параметры" указать значения для элементов. Подстановка будет идти по порядку указания элементов. 
    Image Removed

     

Нажать на кнопку "Старт" в верхней панели. 

Результат:

Программный робот отработал успешно. 

Image Removed

Посмотреть результат можно в файле File_XSD по адресу, куда был сохранен файл

Image Removed

Результат можно посмотреть в файле File_XSD по адресу, куда был сохранен файл

Image Removed

Для того, чтобы указать шаблон для XML файла, который будет указывать в каком порядке и какие элементы будут созданы в XSD - файле нужно:

...

Special conditions of use

The action involves "checking" the types of data passed to the collection:

  • If the transferred data from the collection does not match the data types of the XSD-file, the following message is displayed: "The type of values specified in the collection do not match the data types that are specified in the XSD-file."
  • If no values for mandatory parameters are specified in the collection, the following message is displayed: "The collection does not contain values for items that are specified as mandatory in the XSD-file".
  • If the user specifies an invalid parameter, the following message will be displayed: "Specified file has an invalid extension. The valid extension is xsd."
  • If the user specifies an invalid XSD-file (invalid syntax), the following message will be displayed: "The specified file has invalid syntax".

Example of use

Task

Create a new context on working with XML-documents using XSD. 

Solution

Use the "Create new with XSD" action.

Implementation

  1. Move the "Create new with XSD" action to the workspace.
    Image Added
  2. Set the "Create new with XSD" action parameters.
    In the "XSD-file" field, specify the path to the file where the XSD-file template is stored or specify a template for XML-file, which will specify in what order and which elements will be created in the XSD-file.
    Image Added 
  3. In the "Parameters" field set elements parameters.The substitution will follow the order in which the elements are specified.
    Image Added     

Click "Start" in the top panel.

Result

The program robot completed successfully.

Image Added

You can see the result in the File_XSD file at the address where the file was saved to.

Image Added

You can see the result in the File_XSD file at the address where the file was saved to

Image Added

In order to specify a template for XML-file, which will specify in what order and which elements will be created in XSD-file do the following:

  • In the "XSD-file" field specify "XSD" parameter.

Image Added

  • In the "Parameters" field set values for the elements. The substitution will follow the order in which the elements are specified.

Image Added

After setting the parameters, similarly to the previous example, click "Start" and start the robot scheme

Image Removed

  • В поле "Параметры" указать значения для элементов. Подстановка будет идти по порядку указания элементов

Image Removed

После задания параметров нужно аналогично предыдущему примеру  нажать на "Старт" и запустить схему робота.