Announcement

Collapse
No announcement yet.

GetSegmentsAfter not working now

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • GetSegmentsAfter not working now

    I've been using this code template a good while now but now it is throwing an error. Has something changed? Is there a newer version? The one I have is from

    Author: Nick Rupley
    Date Modified: 2/13/2013


    function call:

    var nteSegments = getSegmentsAfter(msg,msg.ORC,'NTE',true);

    Error:

    SOURCE CODE:
    196: // Return the output array
    197: return out;
    198: }
    199: function getSegmentsAfter(root, startSeg, segName, consecutiveInd, stopSegNames) {
    200: // The index to start collection is the next one up from the starting segment
    201: var index = startSeg.childIndex()+1;
    202: // The return array
    203: var out = [];
    204: // Boolean placeholder to stop iteration
    205: var done = false;
    LINE NUMBER: 201
    DETAILS: TypeError: childIndex is not a function, it is xml.
    at 30b99ead-72de-4fd3-8034-5f791b2c08ba:201 (getSegmentsAfter)
    at 30b99ead-72de-4fd3-8034-5f791b2c08ba:838 (doTransform)
    at 30b99ead-72de-4fd3-8034-5f791b2c08ba:898 (doScript)
    at 30b99ead-72de-4fd3-8034-5f791b2c08ba:900

  • #2
    My guess would be that either your message doesn't have an ORC segment or it has more than one. You have to pass a single node for startSeg so it knows which segment you are "getting after."

    Comment

    Working...
    X