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


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

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/

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.

  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.
     
  3. In the "Parameters" field set elements parameters.The substitution will follow the order in which the elements are specified.
         

Click "Start" in the top panel.

Result

The program robot completed successfully.

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


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

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.

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

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



  • Нет меток