Hello, does anybody have an example of processsing an XML file with occurrences? The file I have to process has the following structure:
Root_element (Element1, Element2)
Element1 (Element11, Element12)
Element11 (#PCDATA)
Element12 (#PCDATA)
Element2 (Element21+)
Element21 (Element211, Element212+)
Element211 (#PCDATA)
Element212 (Element2121, Element2122)
Element2121 (#PCDATA)
Element2122 (#PCDATA)
As you can see in the structure above there are occurrences at Element21 and also at Element212.
I have used the XML2NAT utility to generate parser and serialization for the structure, but I need to read this info into Natural variables.
I am trying that way, problem is that I am not acquainted as of how to get the occurrences of each of the elements at execution time. I have found some info on that and will try. There should be occurrence values coming to Natural after parsing the document … at least that is what I understood from documentation.
:idea: The counter variables C@ are necessary, because for each multiple elements can have different number of occurrences, but the data space has to be expanded to the maximum value to be saved.
:arrow: Depending on the platform and Natural version and plattform you use, a specific PDA for your datastructure, an implemtation for parsing and serialisation is generated.