{"id":5514,"date":"2017-11-15T21:13:24","date_gmt":"2017-11-15T21:13:24","guid":{"rendered":"https:\/\/alt2.minisoft.com\/support\/?p=5514"},"modified":"2020-07-01T12:57:47","modified_gmt":"2020-07-01T19:57:47","slug":"eformz-txt-to-xml-guide-states","status":"publish","type":"post","link":"https:\/\/www.minisoft.com\/support\/eformz-txt-to-xml-guide-states\/","title":{"rendered":"eFORMz TXT To XML Guide: States"},"content":{"rendered":"<p>Part One:\u00a0<a href=\"\/support\/index.php\/eformz-txt-to-xml-guide-getting-started\/\">eFORMz TXT to XML Guide: Getting Started<\/a><br \/>\nPart Two:\u00a0<a href=\"\/support\/index.php\/eformz-txt-to-xml-guide-reset-line-number-count\/\">eFORMz TXT to XML Guide: Reset Line Number Count<\/a><br \/>\nPart Four:\u00a0<a href=\"\/support\/index.php\/eformz-txt-to-xml-guide-state-loops\/\">eFORMz TXT To XML Guide: State Loops<\/a><\/p>\n<p>In <a href=\"\/support\/index.php\/eformz-txt-to-xml-guide-reset-line-number-count\/\">Part 2<\/a> we set up a \u201cState\u201d inside of a \u201cState\u201d to reset the line number count. This post looks more at the \u201cState\u201d variables.<\/p>\n<p>The structure of our states was set-up as the following:<\/p>\n<table style=\"height: 434px;\" width=\"699\">\n<tbody>\n<tr>\n<td><\/td>\n<td>Level<\/td>\n<td>State<\/td>\n<td>EndState<\/td>\n<td>XML Variable Tag<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>0<\/td>\n<td>Null<\/td>\n<td><\/td>\n<td>\\PackSlipData\\<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>1<\/td>\n<td>OrderDetail<\/td>\n<td>EndOfFile<\/td>\n<td>\\PackSlipData\\PackSlip\\<\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td>2<\/td>\n<td>CustomerNumber<\/td>\n<td><\/td>\n<td>\\PackSlipData\\PackSlip\\CustomerNumber<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Notice how there are levels to each State. If you want to go down a level you must create a nested folder. Ex. eFORMz defaults the \u201cNull\u201d state to be set at level 0. So when we created the state \u201cOrderDetail\u201d inside of the state \u201cNull\u201d it was at level 1. Since the OrderDetail state we created was a has a value in the \u201cTag\u201d row, which means it is creating a XML Folder Tag, it then creates a new level for any variables that are put inside of it. This would mean CustomerNumber is level 2 and inside of OrderDetail, which is at level 1.<\/p>\n<p>Another way to think about this is how the file system is setup on Windows. There can be folders, with folders inside of them, and information inside of those folders. Each folder that is inside of a folder is a deeper level.<\/p>\n<p>We have talked about the levels of the states, the states themselves, but we haven\u2019t talked about the endstates. The endstates determine when the state is going to end. For example, our state OrderDetail has the endstate \u201cEndOfFile\u201d. If you wanted to extract a line that was after the \u201cEndOfFile\u201d endstate you would not be able to grab that line in the \u201cOrderDetail\u201d state. Below is an example:<\/p>\n<p>Here I am moving my endstate\u2019s line, \u201cEndOfFile\u201d, to line 2.<\/p>\n<p><a href=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo1.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-5515\" src=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo1.jpg\" alt=\"\" width=\"632\" height=\"137\" srcset=\"https:\/\/www.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo1.jpg 632w, https:\/\/www.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo1-300x65.jpg 300w, https:\/\/www.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo1-150x33.jpg 150w, https:\/\/www.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo1-250x54.jpg 250w, https:\/\/www.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo1-550x119.jpg 550w\" sizes=\"(max-width: 632px) 100vw, 632px\" \/><\/a><a href=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo2.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-5516\" src=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo2.jpg\" alt=\"\" width=\"205\" height=\"270\" srcset=\"https:\/\/www.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo2.jpg 205w, https:\/\/www.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo2-114x150.jpg 114w, https:\/\/www.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo2-137x180.jpg 137w\" sizes=\"(max-width: 205px) 100vw, 205px\" \/><\/a><\/p>\n<p>If I wanted to grab a line after the endstate\u2019s line in the same state that has the endstate it will not work.<\/p>\n<p>I have a created a new variable that is after my \u201cEndOfFile\u201d \u201cEndState\u201d. EndOfFile is at line 2 and \u201cLineWeWant\u2026\u201d is at line 3. Don\u2019t forget that since these states are inside of the \u201cOrderDetail\u201d state that the line number count resets, so you should set your line number to be set at \u201c2\u201d because it is two down from the \u201cOrderDetail\u201d state, whom\u2019s line is at 0. When you click on your line variable it will <b>NOT<\/b> correctly update the line that it is currently on. Here it looks like it is on line 2, which is highlighted, but it is on line 3.<\/p>\n<p><a href=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo3.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-5517\" src=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo3.jpg\" alt=\"\" width=\"684\" height=\"51\" srcset=\"https:\/\/www.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo3.jpg 684w, https:\/\/www.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo3-300x22.jpg 300w, https:\/\/www.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo3-150x11.jpg 150w, https:\/\/www.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo3-250x19.jpg 250w, https:\/\/www.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo3-550x41.jpg 550w\" sizes=\"(max-width: 684px) 100vw, 684px\" \/><\/a><\/p>\n<p>Here is the state view with our state\u2019s \u201cLineWeWantAfterEndState\u201d line.<\/p>\n<p><a href=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo4.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-5518\" src=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo4.jpg\" alt=\"\" width=\"248\" height=\"81\" srcset=\"https:\/\/www.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo4.jpg 248w, https:\/\/www.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo4-150x49.jpg 150w\" sizes=\"(max-width: 248px) 100vw, 248px\" \/><\/a><\/p>\n<p>Notice when you select \u201cSet\u201d and \u201cTest\u201d that variable will not come up. There are two reasons for this. Number one being that each state will need a \u201cEndState\u201d. CustomerNumber and LineWeWantAfterEndState does not have a \u201cEndState\u201d. Number two is that the \u201cEndOfFile\u201d state is a line above \u201cLineWeWantAfterEndState\u201d. Let\u2019s fix that.<\/p>\n<p>I have created a new line for our new \u201cEndState\u201d. It is after the text that we want to extract.<\/p>\n<p><a href=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo5.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-5519\" src=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo5.jpg\" alt=\"\" width=\"371\" height=\"58\" srcset=\"https:\/\/www.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo5.jpg 371w, https:\/\/www.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo5-300x47.jpg 300w, https:\/\/www.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo5-150x23.jpg 150w, https:\/\/www.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo5-250x39.jpg 250w\" sizes=\"(max-width: 371px) 100vw, 371px\" \/><\/a><\/p>\n<p>We then place in our \u201cEndState\u201ds to each state. We can leave them empty and they will default to the \u201cOrderDetail\u201d\u2019s \u201cEndState\u201d, which is our new \u201cEndState\u201d, \u201cNewEndOfStateLine\u201d.<\/p>\n<p><a href=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo7.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-5520\" src=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo7.jpg\" alt=\"\" width=\"258\" height=\"110\" srcset=\"https:\/\/www.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo7.jpg 258w, https:\/\/www.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo7-150x64.jpg 150w, https:\/\/www.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo7-250x107.jpg 250w\" sizes=\"(max-width: 258px) 100vw, 258px\" \/><\/a><\/p>\n<p>Select \u201cSet\u201d and select \u201cTest\u201d and you will see your new variable.<\/p>\n<p><a href=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo8.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-5521\" src=\"https:\/\/alt2.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo8.jpg\" alt=\"\" width=\"497\" height=\"66\" srcset=\"https:\/\/www.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo8.jpg 497w, https:\/\/www.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo8-300x40.jpg 300w, https:\/\/www.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo8-150x20.jpg 150w, https:\/\/www.minisoft.com\/support\/wp-content\/uploads\/2017\/11\/XMLGuidePartTwo8-250x33.jpg 250w\" sizes=\"(max-width: 497px) 100vw, 497px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Part One:\u00a0eFORMz TXT to XML Guide: Getting Started Part Two:\u00a0eFORMz TXT to XML Guide: Reset Line Number Count Part Four:\u00a0eFORMz TXT To XML Guide: State Loops In Part 2 we set up a \u201cState\u201d inside of a \u201cState\u201d to reset the line number count. This post looks more at the \u201cState\u201d variables. The structure of [&hellip;]<\/p>\n","protected":false},"author":15,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58],"tags":[244,275,274,277,276,273,6,265,266],"_links":{"self":[{"href":"https:\/\/www.minisoft.com\/support\/wp-json\/wp\/v2\/posts\/5514"}],"collection":[{"href":"https:\/\/www.minisoft.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.minisoft.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.minisoft.com\/support\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/www.minisoft.com\/support\/wp-json\/wp\/v2\/comments?post=5514"}],"version-history":[{"count":5,"href":"https:\/\/www.minisoft.com\/support\/wp-json\/wp\/v2\/posts\/5514\/revisions"}],"predecessor-version":[{"id":8164,"href":"https:\/\/www.minisoft.com\/support\/wp-json\/wp\/v2\/posts\/5514\/revisions\/8164"}],"wp:attachment":[{"href":"https:\/\/www.minisoft.com\/support\/wp-json\/wp\/v2\/media?parent=5514"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.minisoft.com\/support\/wp-json\/wp\/v2\/categories?post=5514"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.minisoft.com\/support\/wp-json\/wp\/v2\/tags?post=5514"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}