function nestingLevelFix(&$dom) {
        $startingNestingLevel = $this->parent->nestingLevel();
        foreach($dom['.SimplOn.Element, .SimplOn.Data'] as $node) {
            $domNode = pq($node);
            $classes = explode(' ', $domNode->attr('class'));
            if(substr($classes[2], 0, 4) == 'SNL-') {
                $nestingLevel = substr($classes[2], 4) + $startingNestingLevel;
                $classes[2] = 'SNL-' . $nestingLevel;
                $domNode->attr('class', implode(' ', $classes));
            }
        }
    }
function nestingLevelFix(&$dom) {
        $startingNestingLevel = $this->parent->nestingLevel();
        foreach($dom['.SimplOn.Element, .SimplOn.Data'] as $node) {
            $domNode = pq($node);
            $classes = explode(' ', $domNode->attr('class'));
            if(substr($classes[2], 0, 4) == 'SNL-') {
                $nestingLevel = substr($classes[2], 4) + $startingNestingLevel;
                $classes[2] = 'SNL-' . $nestingLevel;
                $domNode->attr('class', implode(' ', $classes));
            }
        }
    }
function nestingLevelFix ( & $ dom ) { $ startingNestingLevel = $ this -> parent -> nestingLevel ( ) ; foreach ( $ dom [ '.SimplOn.Element, .SimplOn.Data' ] as $ node ) { $ domNode = pq ( $ node ) ; $ classes = explode ( ' ' , $ domNode -> attr ( 'class' ) ) ; if ( substr ( $ classes [ 2 ] , 0 , 4 ) == 'SNL-' ) { $ nestingLevel = substr ( $ classes [ 2 ] , 4 ) + $ startingNestingLevel ; $ classes [ 2 ] = 'SNL-' . $ nestingLevel ; $ domNode -> attr ( 'class' , implode ( ' ' , $ classes ) ) ; } } }
function nestingLevelFix - this function update the nesting level of the elements
every time that a new element is added.

@param type $dom
function nestingLevelFix - this function update the nesting level of the elements every time that a new element is added .