Difference between revisions of "OS4X plugin os4xplugin manipulate xml"
Jump to navigation
Jump to search
(New page: Category:Plugins == Purpose == Manipulate job XML nodes via regular expressions, based on the content of the same or other XML nodes of the job XML. == Requirements == *OS4X Enterpris...) |
|||
| Line 11: | Line 11: | ||
*Target XPath: the target XPath expression, where the target extrapolated information is stored. | *Target XPath: the target XPath expression, where the target extrapolated information is stored. | ||
*Create non-existing target XPath: if the last node of the target XPath is not-existant, the plugin will create it. | *Create non-existing target XPath: if the last node of the target XPath is not-existant, the plugin will create it. | ||
| + | |||
| + | |||
| + | == Examples == | ||
| + | === Scenario 1: change virtual filename based on real filename === | ||
| + | Filename example: | ||
| + | Yanfeng_DESADV.dat | ||
| + | |||
| + | *Source XPath: /OS4X_job/job_information/job_file/real_filename | ||
| + | *Modification regular expression: .*_(.*)..* | ||
| + | *Target XPath: /OS4X_job/job_information/job_file/virtual_filename | ||
| + | |||
| + | Plugin output: | ||
| + | <pre> | ||
| + | Source XPath: '/OS4X_job/job_information/job_file/real_filename'. | ||
| + | Modifying regular expression: '.*_(.*)\..*'. | ||
| + | Target XPath: '/OS4X_job/job_information/job_file/virtual_filename'. | ||
| + | |||
| + | Source information #1: [Yanfeng_DESADV.dat] | ||
| + | Replacement of regular expression #1: [DESADV] | ||
| + | Target XPath expression found with one resultset. | ||
| + | </pre> | ||
Revision as of 09:48, 27 July 2017
Purpose
Manipulate job XML nodes via regular expressions, based on the content of the same or other XML nodes of the job XML.
Requirements
- OS4X Enterprise license
Configuration
- Source XPath: the source XPath expression of a XML node which contains the source text information.
- Modification regular expression: the Perl regular expression (preg) rule which defines the result text, based on the source XML node text.
- Target XPath: the target XPath expression, where the target extrapolated information is stored.
- Create non-existing target XPath: if the last node of the target XPath is not-existant, the plugin will create it.
Examples
Scenario 1: change virtual filename based on real filename
Filename example:
Yanfeng_DESADV.dat
- Source XPath: /OS4X_job/job_information/job_file/real_filename
- Modification regular expression: .*_(.*)..*
- Target XPath: /OS4X_job/job_information/job_file/virtual_filename
Plugin output:
Source XPath: '/OS4X_job/job_information/job_file/real_filename'. Modifying regular expression: '.*_(.*)\..*'. Target XPath: '/OS4X_job/job_information/job_file/virtual_filename'. Source information #1: [Yanfeng_DESADV.dat] Replacement of regular expression #1: [DESADV] Target XPath expression found with one resultset.