BookmarkSubscribeRSS Feed
Choose Language Hide Translation Bar
edwardlyx
Community Member

Difficult XML to parse

I don't know how to parse this kind of XML. I would like to get a simillar format as importing to Excel as attached.

 

 

<?xml version="1.0"?>
<results rack="1" drawer="1" lastResult="33" test="Sweep2_6A_1pct">
<!-- Sweep test. -->
<resultSet tag="ZONE_TEMPERATURE" time="Tue Jun 25 10:36:07 2019" elapsedTime="2" type="T" pinset="">
<result lotID="" carrierId="" carrier="0" position="1" lowlimit="0.0" highlimit="50.0" value="18.8125" passfail="0" />
</resultSet>
<resultSet tag="ZONE_TEMPERATURE" time="Tue Jun 25 10:36:07 2019" elapsedTime="2" type="T" pinset="">
<result lotID="" carrierId="" carrier="0" position="2" lowlimit="0.0" highlimit="50.0" value="18.28125" passfail="0" />
</resultSet>
<resultSet tag="INLET_TEMP" time="Tue Jun 25 10:36:07 2019" elapsedTime="2" type="T" pinset="">
<result lotID="" carrierId="" carrier="0" position="3" lowlimit="0.0" highlimit="50.0" value="18.09375" passfail="0" />
</resultSet>
<resultSet tag="M12_OS_MV" time="Tue Jun 25 10:36:09 2019" elapsedTime="4" type="V" pinset="M12">
<result lotID="101" carrierId="BP190001_04" carrier="1" position="1" lowlimit="2.5" highlimit="3.2999" value="2.9867653" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="2" lowlimit="2.5" highlimit="3.2999" value="2.9699957" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="3" lowlimit="2.5" highlimit="3.2999" value="2.9929226" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="4" lowlimit="2.5" highlimit="3.2999" value="2.9898474" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="5" lowlimit="2.5" highlimit="3.2999" value="3.0037852" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="6" lowlimit="2.5" highlimit="3.2999" value="2.9640567" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="7" lowlimit="2.5" highlimit="3.2999" value="2.9866076" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="8" lowlimit="2.5" highlimit="3.2999" value="2.9952315" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="9" lowlimit="2.5" highlimit="3.2999" value="2.9707197" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="10" lowlimit="2.5" highlimit="3.2999" value="3.0008683" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="11" lowlimit="2.5" highlimit="3.2999" value="2.9599822" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="12" lowlimit="2.5" highlimit="3.2999" value="2.9678346" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="13" lowlimit="2.5" highlimit="3.2999" value="2.9620826" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="14" lowlimit="2.5" highlimit="3.2999" value="2.9952638" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="15" lowlimit="2.5" highlimit="3.2999" value="3.0111032" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="16" lowlimit="2.5" highlimit="3.2999" value="2.9743756" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="17" lowlimit="2.5" highlimit="3.2999" value="3.0070123" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="18" lowlimit="2.5" highlimit="3.2999" value="2.9889807" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="19" lowlimit="2.5" highlimit="3.2999" value="2.9652241" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="20" lowlimit="2.5" highlimit="3.2999" value="2.9614325" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="21" lowlimit="2.5" highlimit="3.2999" value="2.9465721" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="22" lowlimit="2.5" highlimit="3.2999" value="2.9570839" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="23" lowlimit="2.5" highlimit="3.2999" value="2.9671987" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="24" lowlimit="2.5" highlimit="3.2999" value="2.9724225" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="25" lowlimit="2.5" highlimit="3.2999" value="2.9774479" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="26" lowlimit="2.5" highlimit="3.2999" value="2.9980375" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="27" lowlimit="2.5" highlimit="3.2999" value="2.9608353" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="28" lowlimit="2.5" highlimit="3.2999" value="2.9959008" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="29" lowlimit="2.5" highlimit="3.2999" value="2.9858496" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="30" lowlimit="2.5" highlimit="3.2999" value="2.9579059" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="31" lowlimit="2.5" highlimit="3.2999" value="2.9742712" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="32" lowlimit="2.5" highlimit="3.2999" value="3.0135734" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="33" lowlimit="2.5" highlimit="3.2999" value="2.9591594" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="34" lowlimit="2.5" highlimit="3.2999" value="3.0121541" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="35" lowlimit="2.5" highlimit="3.2999" value="2.9734409" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="36" lowlimit="2.5" highlimit="3.2999" value="2.9629708" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="37" lowlimit="2.5" highlimit="3.2999" value="2.9565778" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="38" lowlimit="2.5" highlimit="3.2999" value="2.9824185" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="39" lowlimit="2.5" highlimit="3.2999" value="2.9504160" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="40" lowlimit="2.5" highlimit="3.2999" value="3.0030125" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="41" lowlimit="2.5" highlimit="3.2999" value="3.0116538" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="42" lowlimit="2.5" highlimit="3.2999" value="2.9625268" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="43" lowlimit="2.5" highlimit="3.2999" value="2.9513306" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="44" lowlimit="2.5" highlimit="3.2999" value="2.9748085" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="45" lowlimit="2.5" highlimit="3.2999" value="2.9597665" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="46" lowlimit="2.5" highlimit="3.2999" value="2.9712721" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="47" lowlimit="2.5" highlimit="3.2999" value="2.9658842" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="48" lowlimit="2.5" highlimit="3.2999" value="2.9841024" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="1" lowlimit="2.5" highlimit="3.2999" value="2.9392833" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="2" lowlimit="2.5" highlimit="3.2999" value="2.9644701" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="3" lowlimit="2.5" highlimit="3.2999" value="3.0099091" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="4" lowlimit="2.5" highlimit="3.2999" value="2.9614213" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="5" lowlimit="2.5" highlimit="3.2999" value="2.9704292" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="6" lowlimit="2.5" highlimit="3.2999" value="2.9943084" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="7" lowlimit="2.5" highlimit="3.2999" value="2.9906189" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="8" lowlimit="2.5" highlimit="3.2999" value="2.9884645" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="9" lowlimit="2.5" highlimit="3.2999" value="2.9693026" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="10" lowlimit="2.5" highlimit="3.2999" value="3.0151057" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="11" lowlimit="2.5" highlimit="3.2999" value="2.9836918" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="12" lowlimit="2.5" highlimit="3.2999" value="2.9822493" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="13" lowlimit="2.5" highlimit="3.2999" value="2.9700089" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="14" lowlimit="2.5" highlimit="3.2999" value="2.9720713" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="15" lowlimit="2.5" highlimit="3.2999" value="2.9942497" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="16" lowlimit="2.5" highlimit="3.2999" value="2.9827324" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="17" lowlimit="2.5" highlimit="3.2999" value="2.9800398" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="18" lowlimit="2.5" highlimit="3.2999" value="3.0113474" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="19" lowlimit="2.5" highlimit="3.2999" value="3.0382665" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="20" lowlimit="2.5" highlimit="3.2999" value="2.9720780" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="21" lowlimit="2.5" highlimit="3.2999" value="3.0046468" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="22" lowlimit="2.5" highlimit="3.2999" value="2.9954825" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="23" lowlimit="2.5" highlimit="3.2999" value="2.9769267" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="24" lowlimit="2.5" highlimit="3.2999" value="3.0083729" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="25" lowlimit="2.5" highlimit="3.2999" value="3.0132922" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="26" lowlimit="2.5" highlimit="3.2999" value="2.9677128" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="27" lowlimit="2.5" highlimit="3.2999" value="2.9976133" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="28" lowlimit="2.5" highlimit="3.2999" value="2.9990932" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="29" lowlimit="2.5" highlimit="3.2999" value="2.9801547" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="30" lowlimit="2.5" highlimit="3.2999" value="2.9795655" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="31" lowlimit="2.5" highlimit="3.2999" value="2.9749486" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="32" lowlimit="2.5" highlimit="3.2999" value="3.0116300" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="33" lowlimit="2.5" highlimit="3.2999" value="2.9811147" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="34" lowlimit="2.5" highlimit="3.2999" value="3.3828641" passfail="2" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="35" lowlimit="2.5" highlimit="3.2999" value="2.9941288" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="36" lowlimit="2.5" highlimit="3.2999" value="2.9735823" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="37" lowlimit="2.5" highlimit="3.2999" value="2.9971145" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="38" lowlimit="2.5" highlimit="3.2999" value="2.9708339" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="39" lowlimit="2.5" highlimit="3.2999" value="2.9951428" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="40" lowlimit="2.5" highlimit="3.2999" value="3.0052295" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="41" lowlimit="2.5" highlimit="3.2999" value="3.0138145" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="42" lowlimit="2.5" highlimit="3.2999" value="3.0274135" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="43" lowlimit="2.5" highlimit="3.2999" value="2.9737510" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="44" lowlimit="2.5" highlimit="3.2999" value="3.0091046" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="45" lowlimit="2.5" highlimit="3.2999" value="2.9839984" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="46" lowlimit="2.5" highlimit="3.2999" value="2.9795057" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="47" lowlimit="2.5" highlimit="3.2999" value="2.9693818" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="48" lowlimit="2.5" highlimit="3.2999" value="2.9762840" passfail="0" />
</resultSet>
<resultSet tag="M12_OS_MI" time="Tue Jun 25 10:36:09 2019" elapsedTime="4" type="I" pinset="M12">
<result lotID="101" carrierId="BP190001_04" carrier="1" position="1" lowlimit="0.0179" highlimit="0.0420" value="0.0301608" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="2" lowlimit="0.0179" highlimit="0.0420" value="0.0292581" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="3" lowlimit="0.0179" highlimit="0.0420" value="0.0273318" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="4" lowlimit="0.0179" highlimit="0.0420" value="0.0280621" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="5" lowlimit="0.0179" highlimit="0.0420" value="0.0286762" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="6" lowlimit="0.0179" highlimit="0.0420" value="0.0273440" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="7" lowlimit="0.0179" highlimit="0.0420" value="0.0285752" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="8" lowlimit="0.0179" highlimit="0.0420" value="0.0301871" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="9" lowlimit="0.0179" highlimit="0.0420" value="0.0312417" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="10" lowlimit="0.0179" highlimit="0.0420" value="0.0308501" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="11" lowlimit="0.0179" highlimit="0.0420" value="0.0302170" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="12" lowlimit="0.0179" highlimit="0.0420" value="0.0304579" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="13" lowlimit="0.0179" highlimit="0.0420" value="0.0272142" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="14" lowlimit="0.0179" highlimit="0.0420" value="0.0306634" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="15" lowlimit="0.0179" highlimit="0.0420" value="0.0299505" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="16" lowlimit="0.0179" highlimit="0.0420" value="0.0308591" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="17" lowlimit="0.0179" highlimit="0.0420" value="0.0280244" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="18" lowlimit="0.0179" highlimit="0.0420" value="0.0295401" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="19" lowlimit="0.0179" highlimit="0.0420" value="0.0279139" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="20" lowlimit="0.0179" highlimit="0.0420" value="0.0297626" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="21" lowlimit="0.0179" highlimit="0.0420" value="0.0289340" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="22" lowlimit="0.0179" highlimit="0.0420" value="0.0282260" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="23" lowlimit="0.0179" highlimit="0.0420" value="0.0263496" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="24" lowlimit="0.0179" highlimit="0.0420" value="0.0291138" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="25" lowlimit="0.0179" highlimit="0.0420" value="0.0319618" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="26" lowlimit="0.0179" highlimit="0.0420" value="0.0293948" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="27" lowlimit="0.0179" highlimit="0.0420" value="0.0270696" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="28" lowlimit="0.0179" highlimit="0.0420" value="0.0266332" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="29" lowlimit="0.0179" highlimit="0.0420" value="0.0318235" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="30" lowlimit="0.0179" highlimit="0.0420" value="0.0288235" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="31" lowlimit="0.0179" highlimit="0.0420" value="0.0284436" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="32" lowlimit="0.0179" highlimit="0.0420" value="0.0323886" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="33" lowlimit="0.0179" highlimit="0.0420" value="0.0292092" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="34" lowlimit="0.0179" highlimit="0.0420" value="0.0313667" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="35" lowlimit="0.0179" highlimit="0.0420" value="0.0289719" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="36" lowlimit="0.0179" highlimit="0.0420" value="0.0261483" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="37" lowlimit="0.0179" highlimit="0.0420" value="0.0265422" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="38" lowlimit="0.0179" highlimit="0.0420" value="0.0287989" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="39" lowlimit="0.0179" highlimit="0.0420" value="0.0277767" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="40" lowlimit="0.0179" highlimit="0.0420" value="0.0333334" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="41" lowlimit="0.0179" highlimit="0.0420" value="0.0283150" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="42" lowlimit="0.0179" highlimit="0.0420" value="0.0288436" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="43" lowlimit="0.0179" highlimit="0.0420" value="0.0253397" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="44" lowlimit="0.0179" highlimit="0.0420" value="0.0287853" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="45" lowlimit="0.0179" highlimit="0.0420" value="0.0264629" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="46" lowlimit="0.0179" highlimit="0.0420" value="0.0299729" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="47" lowlimit="0.0179" highlimit="0.0420" value="0.0314928" passfail="0" />
<result lotID="101" carrierId="BP190001_04" carrier="1" position="48" lowlimit="0.0179" highlimit="0.0420" value="0.0301450" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="1" lowlimit="0.0179" highlimit="0.0420" value="0.0272615" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="2" lowlimit="0.0179" highlimit="0.0420" value="0.0276836" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="3" lowlimit="0.0179" highlimit="0.0420" value="0.0279979" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="4" lowlimit="0.0179" highlimit="0.0420" value="0.0282931" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="5" lowlimit="0.0179" highlimit="0.0420" value="0.0284571" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="6" lowlimit="0.0179" highlimit="0.0420" value="0.0291926" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="7" lowlimit="0.0179" highlimit="0.0420" value="0.0271083" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="8" lowlimit="0.0179" highlimit="0.0420" value="0.0314896" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="9" lowlimit="0.0179" highlimit="0.0420" value="0.0270711" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="10" lowlimit="0.0179" highlimit="0.0420" value="0.0306606" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="11" lowlimit="0.0179" highlimit="0.0420" value="0.0276102" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="12" lowlimit="0.0179" highlimit="0.0420" value="0.0254009" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="13" lowlimit="0.0179" highlimit="0.0420" value="0.0360063" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="14" lowlimit="0.0179" highlimit="0.0420" value="0.0281311" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="15" lowlimit="0.0179" highlimit="0.0420" value="0.0331938" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="16" lowlimit="0.0179" highlimit="0.0420" value="0.0297464" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="17" lowlimit="0.0179" highlimit="0.0420" value="0.0283546" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="18" lowlimit="0.0179" highlimit="0.0420" value="0.0308208" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="19" lowlimit="0.0179" highlimit="0.0420" value="0.0275788" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="20" lowlimit="0.0179" highlimit="0.0420" value="0.0275271" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="21" lowlimit="0.0179" highlimit="0.0420" value="0.0288286" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="22" lowlimit="0.0179" highlimit="0.0420" value="0.0277621" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="23" lowlimit="0.0179" highlimit="0.0420" value="0.0296104" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="24" lowlimit="0.0179" highlimit="0.0420" value="0.0279647" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="25" lowlimit="0.0179" highlimit="0.0420" value="0.0335523" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="26" lowlimit="0.0179" highlimit="0.0420" value="0.0269796" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="27" lowlimit="0.0179" highlimit="0.0420" value="0.0274787" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="28" lowlimit="0.0179" highlimit="0.0420" value="0.0298272" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="29" lowlimit="0.0179" highlimit="0.0420" value="0.0305208" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="30" lowlimit="0.0179" highlimit="0.0420" value="0.0305273" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="31" lowlimit="0.0179" highlimit="0.0420" value="0.0315206" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="32" lowlimit="0.0179" highlimit="0.0420" value="0.0325032" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="33" lowlimit="0.0179" highlimit="0.0420" value="0.0290343" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="34" lowlimit="0.0179" highlimit="0.0420" value="0.0300742" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="35" lowlimit="0.0179" highlimit="0.0420" value="0.0313892" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="36" lowlimit="0.0179" highlimit="0.0420" value="0.0291076" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="37" lowlimit="0.0179" highlimit="0.0420" value="0.0329704" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="38" lowlimit="0.0179" highlimit="0.0420" value="0.0288232" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="39" lowlimit="0.0179" highlimit="0.0420" value="0.0275461" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="40" lowlimit="0.0179" highlimit="0.0420" value="0.0273308" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="41" lowlimit="0.0179" highlimit="0.0420" value="0.0308057" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="42" lowlimit="0.0179" highlimit="0.0420" value="0.0351733" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="43" lowlimit="0.0179" highlimit="0.0420" value="0.0282786" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="44" lowlimit="0.0179" highlimit="0.0420" value="0.0276664" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="45" lowlimit="0.0179" highlimit="0.0420" value="0.0282979" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="46" lowlimit="0.0179" highlimit="0.0420" value="0.0270716" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="47" lowlimit="0.0179" highlimit="0.0420" value="0.0273330" passfail="0" />
<result lotID="102" carrierId="BP190002_01" carrier="2" position="48" lowlimit="0.0179" highlimit="0.0420" value="0.0297707" passfail="0" />
</resultSet>
<resultSet tag="ZONE_TEMPERATURE" time="Tue Jun 25 10:38:18 2019" elapsedTime="133" type="T" pinset="">
<result lotID="" carrierId="" carrier="0" position="1" lowlimit="0.0" highlimit="50.0" value="23.46875" passfail="0" />
</resultSet>
<resultSet tag="ZONE_TEMPERATURE" time="Tue Jun 25 10:38:18 2019" elapsedTime="133" type="T" pinset="">
<result lotID="" carrierId="" carrier="0" position="2" lowlimit="0.0" highlimit="50.0" value="22.90625" passfail="0" />
</resultSet>
<resultSet tag="INLET_TEMP" time="Tue Jun 25 10:38:18 2019" elapsedTime="133" type="T" pinset="">
<result lotID="" carrierId="" carrier="0" position="3" lowlimit="0.0" highlimit="50.0" value="18.1875" passfail="0" />
</resultSet>
<!-- TEST ENDED -->
</results>

 

0 Kudos
3 REPLIES 3
gzmorgan0
Super User

Re: Difficult XML to parse

@edwardlyx ,

 

Your task provides an excellent example of the power of JMP XML parsing functions and JMP associative arrays.  If you are not familiar with these concepts, the script might leave you wondering how this works.  Associative Arrays are keyed lists, also known as a dictionary, often an ordered list of name-value pairs. The JMP implemenation of associative arrays includes very useful methods such as insert to combine (used in the script), as well as, intersect and other nice  features. 

 

XML Attr() if unnamed returns all attributes in a tag as an associative array with name value pairs.

 

Attached are two files:

  1. the .txt file was created by copying and pasting the embedded xml code in your blog post to a text file [Sorry this site will not allow me to add the XML file even if I rename it as .txt; an error reports the contents does not match the file type.]
  2. the script that creates the table.

If this script does not work, please post your version of JMP and your OS. 

 

Names Default to Here(1);
path = "C:\temp\";
fid = "blog_question_parse.xml";
file_contents = Load Text File( path || fid );


//-- Create a display of the XML format
nw_xml = New Window( "Blog XML", Text Box( file_contents ) );
wait(5);
dt = New Table( word(1, fid,"."),
	New Column( "rack", character ),
	New Column( "drawer", character ),
	New Column( "lastResult", character ),
	New Column( "test", character ),
	New Column( "tag", character ),
	New Column( "time", character ),
	New Column( "elapsedTime", character ),
	New Column( "type", character ),
	New Column( "pinset", character ),
	New Column( "lotID", character ),
	New Column( "carrierId", character ),
	New Column( "carrier", character ),
	New Column( "position", character ),
	New Column( "lowlimit", character ),
	New Column( "highlimit", character ),
	New Column( "value", character ),
	New Column( "passfail", character ),
);  //end New Table
clist = dt << get column names("string");

//XML Attr() returns an Associative array of all attribute values in a tag
Parse XML( file_contents,
	OnElement( "results", 
	  Start Tag( 
         tag_aa = XML Attr();  //get all attributes as name value pairs
	    ) 
	),
	OnElement( "resultSet", 
	 End Tag(
      set_aa = XML Attr();    //get all attributes as name value pairs
	 )
	), 
	OnElement( "result", 
	  Start Tag( dt << Add Rows( 1 ); crow = nrow(dt) ), 
	  End Tag( 
	   row_aa = XML Attr();        //get all attributes as name value pairs 
	   row_aa << Insert(tag_aa);   //JMP Associative Arrays can be joined with Insert
	   row_aa << Insert(set_aa);   // do it again and now row_aa has all values for the columns
	   for(i=1, i<=nitems(clist), i++,
	   	 column(dt,clist[i])[crow] = row_aa[clist[i]]
	   	
	   );
	  )
	)
);  //end Parse XML

numcol = {"rack", "drawer", "lastResult", "elapsedTime", 
  "carrier", "position", "lowlimit", "highlimit",
"value", "passfail"};

for(i=1, i<=nitems(numcol), i++,
	column(dt,numcol[i]) << Data Type("Numeric");
);

 

Craige_Hales
Staff (Retired)

Re: Difficult XML to parse

Nice script! needs one tiny (important!) change

 

	OnElement( "resultSet", 
	 Start Tag(
      set_aa = XML Attr();    //get all attributes as name value pairs
	 )
	), 

Using the start tag rather than the end tag will get the resultSet data straightened out.

 

JMP 15 (later this year) has a new import XML feature that can do this without writing JSL.

Craige
Highlighted
gzmorgan0
Super User

Re: Difficult XML to parse

Thanks, @Craige_Hales

 

I added the join of Associative arrays instead of using 3 different arrays to fill out the table with simpler syntax, as a last minute edit.  Then did not test tested thoroughly.  Yes, bitten by a rookie mistake.

 

 The updated script is attached.