Help to parse xml

asked 2018-04-18 07:59:55 -0500

juju gravatar image

Hello:

I am looking for help to parse the xml below in streamsets. The structure of the xml is throwing me off a bit. The cname nodes are column headers, with the corresponding r and c nodes providing the vlaue for each row of the data. Also, each row has a timestamp that is calculated based on the variables in the data node. I havevent been able to figure out how to parse this to asign the row data to the column headers and also create the datestamp column for each row. Thanks

<group serial="0x757c6ce4">
    <data columns="13" time_stamp="0x582e5290" time_delta="3600" epoch="0x58110bb8">
    <cname t="P">Grid</cname>
    <cname t="S">Grid*</cname>
    <cname t="P">Gen Set</cname>
    <cname t="S">Gen Set*</cname>
    <cname t="I">I CT1</cname>
    <cname t="I">I CT2</cname>
    <cname t="I">I CT3</cname>
    <cname t="I">I CT4</cname>
    <cname t="I">I CT5</cname>
    <cname t="I">I CT6</cname>
    <cname t="V">V L1</cname>
    <cname t="V">V L2</cname>
    <cname t="V">V L3</cname>
    <r>
    <c>5767921882</c>
    <c>9191660779</c>
    <c>-10086911</c>
    <c>74160204</c>
    <c>6797464335</c>
    <c>13344163875</c>
    <c>22469766027</c>
    <c>434394781</c>
    <c>370902463</c>
    <c>584404781</c>
    <c>363009180326</c>
    <c>358965953018</c>
    <c>302435738676</c>
    </r>
    </data>
</group>
edit retag flag offensive close merge delete