Using an automation task, Athento allows the extraction of specific data from an XML file to insert into fields. To extract data from an XML, install the op_extract_from_xml automation task.
Once it is installed, to configure it, you will have to tell the operation where to extract the data from and where to save it once extracted. This information is stored in the JSON configuration of the extraction parameter of the operation.
For example, you want to extract the value of <path> in the XML shown below, to put it in a "Documentation Example" field.
<?xml version="1.0" encoding="UTF-8"?>
<example>
<path>Example value</path>
</example>
The value could be extracted with the configuration:
{"metadata.documentation_example": "example.path"}
Where metadata.documentation_example is the internal name of the field in which you want to store the data and example.path is the location of the data you want to extract within the XML.
You can indicate multiple data to extract, separating the data with commas.
{"metadata.documentation_example": "example.path", "metadata.another_field": "XMLpath"}
If there were an array in the file, it could be accessed with the following path:
example.path[0].value
Comments
0 comments
Please sign in to leave a comment.