0

parseXML: Assign corresponding elements of same hierarchy level

Hi everyone,

I am trying to import an XML file (GAEB, German construction industry format) and I want to create a Ninox table from it. The XML file always has some categories and one category can have an Itemlist (but doesn' have to).

The challenge: I want to find out to which category an itemlist belongs. But since the itemlist is an element on the same hierarchy level as its category, the only solution (?) is to find out, wether there is an itemlist directly behind the category or not.

The XML looks like that (BoqCtgy is the category and Itemlist the itemlist:

<BoQCtgy RNoPart="001">
    ...
</BoQCtgy>
<Itemlist>
    <Item RNoPart="01">
        ...
    </Item>
    <Item RNoPart="02">
        ...
    </Item>
</Itemlist>
<BoQCtgy RNoPart="002">
    ...
</BoQCtgy>
<BoQCtgy RNoPart="003">
    ...
</BoQCtgy>
<Itemlist>
    <Item RNoPart="01">
        ...
    </Item>
    <Item RNoPart="02">
        ...
    </Item>
</Itemlist>

My very concrete challenge is to create a Ninox items table that contains the structure based on RNoPart:

001.01
001.02
(002 - no items / not relevant)
003.01
003.02

Does anybody have a solution for that?

Reply

null

Content aside

  • 1 yr agoLast active
  • 49Views
  • 1 Following