Skip to content

Commit

Permalink
update documentation, initial sample version. fixes apache#3086
Browse files Browse the repository at this point in the history
  • Loading branch information
bamaer committed Jul 18, 2023
1 parent 1d63254 commit 5de6712
Show file tree
Hide file tree
Showing 2 changed files with 373 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ The Get Data From XML transform provides the ability to read data from any type

Get Data From XML can read data from 3 kind of sources (files, stream and url) in 2 modes (user can define files and urls at static mode or in a dynamic way).

See also:

* xref:pipeline/transforms/xmlinputstream.adoc[XML Input Stream (StAX)] transform.

Samples (Samples project):

* transforms/get-data-from-xml.hpl

|
== Supported Engines
[%noheader,cols="2,1a",frame=none, role="table-supported-engines"]
Expand All @@ -47,7 +55,7 @@ Get Data From XML can read data from 3 kind of sources (files, stream and url) i
The files tab is where you define the location of the XML files from which you want to read.
The table below contains options associated with the Files tab.

[options="header"]
[options="header", cols="1,3"]
|===
|Option|Description
|Transform name|Name of the transform.
Expand All @@ -58,8 +66,9 @@ These are read.
* Read source as URL : the previous transform is giving URLs in a certain field in the input stream.
These are read.
* Get XML source from a field : specify the field to read XML, filename or URL from.
|File or directory|Specifies the location and/or name of the input text file.
Note: Click Add to add the file/directory/wildcard combination to the list of selected files (grid) below.
|File or directory a|Specifies the location and/or name of the input text file.

TIP: Click Add to add the file/directory/wildcard combination to the list of selected files (grid) below.
|Regular expression|Specifies the regular expression you want to use to select the files in the directory specified in the previous option.
|Selected Files|Contains a list of selected files (or wildcard selections) and a property specifying if file is required or not.
If a file is required and it is not found, an error is generated;otherwise, the file name is skipped.
Expand All @@ -68,7 +77,7 @@ If a file is required and it is not found, an error is generated;otherwise, the

=== Content Tab

[options="header"]
[options="header", cols="1,3"]
|===
|Option|Description
|Settings a|
Expand All @@ -88,7 +97,7 @@ Please see the Example 1 to see how it works.
Check this if you want to ignore those altogether.
* Do not raise an error if no file: Don't raise a stink if no files are found.
* Limit : Limits the number of rows to this number (zero (0) means all rows).
* Prune path to handle large files: almost the same value as the "Loop XPath" property with some exceptions, see Get Data from XML - Handling Large Files for more details.
* Prune path to handle large files: almost the same value as the "Loop XPath" property with some exceptions. Use the prune path to speed up processing of large files, or consider using the xref:pipeline/transforms/xmlinputstream.adoc[XML Input Stream (StAX)] transform.
Note that you can use this parameter to avoid multiple HTTP URL requests.

|Additional fields a|
Expand All @@ -105,12 +114,17 @@ A unique list is being kept in memory that can be used in the next workflow acti

=== Fields Tab

[options="header"]
[options="header", cols="1,3"]
|===
|Option|Description
|Name|The name of the output field
|XPath|The path to the element node or attribute to read
|Element|The element type to read: Node or Attribute
|Result Type a|"Value of" or "Single node"

* Value of: retrieve the value of your XPath expression, e.g. the contents of an element or the value of an attribute.
* Single node: retrieve the XML contents returned by an XPath expression. Contrary to "Value of", the result of "Single node" is an XML snippet.

|Type|The data type to convert to
|Format|The format or conversion mask to use in the data type conversion
|Length|The length of the output data type
Expand Down
Loading

0 comments on commit 5de6712

Please sign in to comment.