Skip to content

Phantom text events #95

Open
chrismatheson opened this Issue Apr 3, 2013 · 0 comments

1 participant

@chrismatheson

I seem to be getting "phantom" text events that point to the middle of a tag when i check out the line/col ref.

<TestRun end-time="2013-03-05T10:18:20+00:00" grade="PASS" name="OQ-004:Standby Voltages" start-time="2013-03-05T10:18:13+00:00">
    <TestRun end-time="2013-03-05T10:18:20+00:00" grade="PASS" name="OQ-004.001:+1V2" start-time="2013-03-05T10:18:13+00:00">
        <Result>
            <Property>
                <ValueDouble lsl="1.1" name="+1V2" uom="V" usl="1.3">1.18947673</ValueDouble>
            </Property>
        </Result>
        <Property>
            <ValueString name="COMP">GELE(&gt;= &lt;=)</ValueString>
        </Property>
    </TestRun>
    <TestRun end-time="2013-03-05T10:18:20+00:00" grade="PASS" name="OQ-004.002:3Vref" start-time="2013-03-05T10:18:13+00:00">
        <Result>
            <Property>
                <ValueDouble lsl="2.9" name="3Vref" uom="V" usl="3.1">2.96849859</ValueDouble>
            </Property>
        </Result>
        <Property>
            <ValueString name="COMP">GELE(&gt;= &lt;=)</ValueString>
        </Property>
    </TestRun>
</TestRun>
parser.on("text", function(text) {
  //dont care about other text than valuedouble
  if(parser._parser.tag.name != "VALUEDOUBLE"){return}
  //check parent chain to look for result tag.
  _.find(parser._parser.tags, function(tag){
    if(tag.name == "RESULT"){
      var _mat = _.last(reportdata.material);
      parser.currentMeas.meas.push({
        "material":_mat["PART-NO"],
        "serial":_mat["SERIAL-NO"],
        "ll":parser._parser.tag.attributes.LSL || "",
        "ul":parser._parser.tag.attributes.USL || "",
        "val":text,
        "grade":"default"
      });
      return true;
    }
    return false;
  });
});

Im using Cloud9IDE so if you want to look at it i can give you some access to my exact env. But in the mean time ill keep hunting and see if i can't figure it out.

just so i can check my understanding though, "text" events should only be emitted for text between tags?

<tag att="this is not next">this IS text</tag>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.