История страницы
...
Get elements XPath Version 7 (Net)
Группа действийAction group: XML
Описание
Получает коллекцию, содержащую контент элементов с указанным тегом.
...
Description
Gets a collection containing the content of elements with the specified tag.
Action icon
...
Settings
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
XML context | XML- |
context | Robin.XML | XML context | Yes | |
XPath | Path to XML-element in DOM model | Robin.String | Yes | |
Results | ||||
Result | A collection with the content of XML elements at the specified path | Robin.Collection |
Особые условия использования
Если XPath не определяет тэг однозначно, то мы получаем коллекцию из содержимого тэгов, удовлетворяющих указанному XPath.
Если элемент по тэгу имеет дочерние элементы, то содержимое этих дочерних элементов склеивается в одну строчку.
Пример использования
Special conditions of use
If XPath does not explicitly define a tag, we get a collection of the contents of tags that satisfy the specified XPath.
If a tagged element has daughter elements, the their contents are glued into a single string.
Example of use
Task
Get the collection of elements with tag AUTOR from the XML file Задача: получить коллекцию элементов с тегом AUTOR из XML файла Text.xml
Solution
Use the "Load XMLРешение: воспользоваться действиями "Открыть", "Получить элементы по Xpath"Get elements XPath" actions.
Реализация:
Implementation
- Assemble a robot scheme with the actionsСобрать схему робота, состоящего из действий:
- Настроить параметр действия "Открыть"Set the "Load XML" action parameter.
- Set the "Get elements XPath" action parameters.Настроить параметры действия "Получить элементы по Xpath".
- Нажать на кнопку Click "Старт" в верхней панели.
Результат:
- Start" in the top panel.
Result
The program robot completed successfully. The collection of the elements with tag AUTHOR was obtained.Программный робот отработал успешно. Коллекция элементов для тега AUTHOR получена.