Skip to content

Commit

Permalink
Adding flatfile.reader and format - thus completing the new 'fixed-le…
Browse files Browse the repository at this point in the history
…ngth2' format handler with nested structure support. (#170)

Next steps:
- enable it from omnniv21 schema handler
- add samples
- add more end to end integration tests
- update cli server sample collection
- documentation on 'fixed-length2', deprecation of 'fixed-length' and migration strategy.
  • Loading branch information
jf-tech committed Aug 26, 2022
1 parent fa74a27 commit 1b4997b
Show file tree
Hide file tree
Showing 9 changed files with 1,530 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"Children": [
{
"Children": [
{
"Children": null,
"Data": "world",
"FirstChild": null,
"FormatSpecific": null,
"LastChild": null,
"NextSibling": null,
"Parent": "(ElementNode W)",
"PrevSibling": null,
"Type": "TextNode"
}
],
"Data": "W",
"FirstChild": "(TextNode 'world')",
"FormatSpecific": null,
"LastChild": "(TextNode 'world')",
"NextSibling": "(ElementNode C)",
"Parent": "(ElementNode test-envelope)",
"PrevSibling": null,
"Type": "ElementNode"
},
{
"Children": [
{
"Children": null,
"Data": "c",
"FirstChild": null,
"FormatSpecific": null,
"LastChild": null,
"NextSibling": null,
"Parent": "(ElementNode C)",
"PrevSibling": null,
"Type": "TextNode"
}
],
"Data": "C",
"FirstChild": "(TextNode 'c')",
"FormatSpecific": null,
"LastChild": "(TextNode 'c')",
"NextSibling": null,
"Parent": "(ElementNode test-envelope)",
"PrevSibling": "(ElementNode W)",
"Type": "ElementNode"
}
],
"Data": "test-envelope",
"FirstChild": "(ElementNode W)",
"FormatSpecific": null,
"LastChild": "(ElementNode C)",
"NextSibling": null,
"Parent": null,
"PrevSibling": null,
"Type": "ElementNode"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
{
"Children": [
{
"Children": [
{
"Children": [
{
"Children": null,
"Data": "2",
"FirstChild": null,
"FormatSpecific": null,
"LastChild": null,
"NextSibling": null,
"Parent": "(ElementNode c2)",
"PrevSibling": null,
"Type": "TextNode"
}
],
"Data": "c2",
"FirstChild": "(TextNode '2')",
"FormatSpecific": null,
"LastChild": "(TextNode '2')",
"NextSibling": null,
"Parent": "(ElementNode e2)",
"PrevSibling": null,
"Type": "ElementNode"
}
],
"Data": "e2",
"FirstChild": "(ElementNode c2)",
"FormatSpecific": null,
"LastChild": "(ElementNode c2)",
"NextSibling": "(ElementNode e3)",
"Parent": "(ElementNode e1)",
"PrevSibling": null,
"Type": "ElementNode"
},
{
"Children": [
{
"Children": [
{
"Children": null,
"Data": "1",
"FirstChild": null,
"FormatSpecific": null,
"LastChild": null,
"NextSibling": null,
"Parent": "(ElementNode c31)",
"PrevSibling": null,
"Type": "TextNode"
}
],
"Data": "c31",
"FirstChild": "(TextNode '1')",
"FormatSpecific": null,
"LastChild": "(TextNode '1')",
"NextSibling": "(ElementNode c32)",
"Parent": "(ElementNode e3)",
"PrevSibling": null,
"Type": "ElementNode"
},
{
"Children": [
{
"Children": null,
"Data": "2",
"FirstChild": null,
"FormatSpecific": null,
"LastChild": null,
"NextSibling": null,
"Parent": "(ElementNode c32)",
"PrevSibling": null,
"Type": "TextNode"
}
],
"Data": "c32",
"FirstChild": "(TextNode '2')",
"FormatSpecific": null,
"LastChild": "(TextNode '2')",
"NextSibling": null,
"Parent": "(ElementNode e3)",
"PrevSibling": "(ElementNode c31)",
"Type": "ElementNode"
}
],
"Data": "e3",
"FirstChild": "(ElementNode c31)",
"FormatSpecific": null,
"LastChild": "(ElementNode c32)",
"NextSibling": "(ElementNode e3)",
"Parent": "(ElementNode e1)",
"PrevSibling": "(ElementNode e2)",
"Type": "ElementNode"
},
{
"Children": [
{
"Children": [
{
"Children": null,
"Data": "3",
"FirstChild": null,
"FormatSpecific": null,
"LastChild": null,
"NextSibling": null,
"Parent": "(ElementNode c31)",
"PrevSibling": null,
"Type": "TextNode"
}
],
"Data": "c31",
"FirstChild": "(TextNode '3')",
"FormatSpecific": null,
"LastChild": "(TextNode '3')",
"NextSibling": "(ElementNode c32)",
"Parent": "(ElementNode e3)",
"PrevSibling": null,
"Type": "ElementNode"
},
{
"Children": [
{
"Children": null,
"Data": "4",
"FirstChild": null,
"FormatSpecific": null,
"LastChild": null,
"NextSibling": null,
"Parent": "(ElementNode c32)",
"PrevSibling": null,
"Type": "TextNode"
}
],
"Data": "c32",
"FirstChild": "(TextNode '4')",
"FormatSpecific": null,
"LastChild": "(TextNode '4')",
"NextSibling": null,
"Parent": "(ElementNode e3)",
"PrevSibling": "(ElementNode c31)",
"Type": "ElementNode"
}
],
"Data": "e3",
"FirstChild": "(ElementNode c31)",
"FormatSpecific": null,
"LastChild": "(ElementNode c32)",
"NextSibling": "(ElementNode e4)",
"Parent": "(ElementNode e1)",
"PrevSibling": "(ElementNode e3)",
"Type": "ElementNode"
},
{
"Children": [
{
"Children": [
{
"Children": null,
"Data": "4",
"FirstChild": null,
"FormatSpecific": null,
"LastChild": null,
"NextSibling": null,
"Parent": "(ElementNode c4)",
"PrevSibling": null,
"Type": "TextNode"
}
],
"Data": "c4",
"FirstChild": "(TextNode '4')",
"FormatSpecific": null,
"LastChild": "(TextNode '4')",
"NextSibling": null,
"Parent": "(ElementNode e4)",
"PrevSibling": null,
"Type": "ElementNode"
}
],
"Data": "e4",
"FirstChild": "(ElementNode c4)",
"FormatSpecific": null,
"LastChild": "(ElementNode c4)",
"NextSibling": null,
"Parent": "(ElementNode e1)",
"PrevSibling": "(ElementNode e3)",
"Type": "ElementNode"
}
],
"Data": "e1",
"FirstChild": "(ElementNode e2)",
"FormatSpecific": null,
"LastChild": "(ElementNode e4)",
"NextSibling": null,
"Parent": "(DocumentNode)",
"PrevSibling": null,
"Type": "ElementNode"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"Children": [
{
"Children": [
{
"Children": null,
"Data": "1",
"FirstChild": null,
"FormatSpecific": null,
"LastChild": null,
"NextSibling": null,
"Parent": "(ElementNode C)",
"PrevSibling": null,
"Type": "TextNode"
}
],
"Data": "C",
"FirstChild": "(TextNode '1')",
"FormatSpecific": null,
"LastChild": "(TextNode '1')",
"NextSibling": null,
"Parent": "(ElementNode E)",
"PrevSibling": null,
"Type": "ElementNode"
}
],
"Data": "E",
"FirstChild": "(ElementNode C)",
"FormatSpecific": null,
"LastChild": "(ElementNode C)",
"NextSibling": null,
"Parent": null,
"PrevSibling": null,
"Type": "ElementNode"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"Children": [
{
"Children": [
{
"Children": null,
"Data": "1",
"FirstChild": null,
"FormatSpecific": null,
"LastChild": null,
"NextSibling": null,
"Parent": "(ElementNode C1)",
"PrevSibling": null,
"Type": "TextNode"
}
],
"Data": "C1",
"FirstChild": "(TextNode '1')",
"FormatSpecific": null,
"LastChild": "(TextNode '1')",
"NextSibling": "(ElementNode C2)",
"Parent": "(ElementNode E)",
"PrevSibling": null,
"Type": "ElementNode"
},
{
"Children": [
{
"Children": null,
"Data": "2",
"FirstChild": null,
"FormatSpecific": null,
"LastChild": null,
"NextSibling": null,
"Parent": "(ElementNode C2)",
"PrevSibling": null,
"Type": "TextNode"
}
],
"Data": "C2",
"FirstChild": "(TextNode '2')",
"FormatSpecific": null,
"LastChild": "(TextNode '2')",
"NextSibling": null,
"Parent": "(ElementNode E)",
"PrevSibling": "(ElementNode C1)",
"Type": "ElementNode"
}
],
"Data": "E",
"FirstChild": "(ElementNode C1)",
"FormatSpecific": null,
"LastChild": "(ElementNode C2)",
"NextSibling": null,
"Parent": null,
"PrevSibling": null,
"Type": "ElementNode"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"file_declaration": {
"envelopes": [
{
"name": "e1",
"type": "envelope_group",
"is_target": true,
"min": 1,
"max": 1,
"child_envelopes": [
{
"name": "e2",
"max": 5,
"columns": [
{
"name": "c1",
"start_pos": 1,
"length": 3
}
]
},
{
"name": "e2",
"header": "^ABC$",
"columns": [
{
"name": "c2",
"start_pos": 2,
"length": 5,
"line_pattern": "^H00"
}
]
}
]
}
]
},
"XPath": ".[c1 != 'skip']"
}
Loading

0 comments on commit 1b4997b

Please sign in to comment.