kernel/classes/datatypes/ezxmltext/ezxmlinputparser.php
function processBySchemaTree( $element )
    {
        $parent = $element->parentNode;

        if ( $parent instanceof DOMElement )
        {
            $schemaCheckResult = $this->XMLSchema->check( $parent, $element );
            if ( !$schemaCheckResult )
            {
                if ( $schemaCheckResult === false )
                {
                    // Remove indenting spaces
                    if ( $element->nodeType == XML_TEXT_NODE && !trim( $element->textContent ) )
                    {
                        $element = $parent->removeChild( $element );
                        return false;
                    }

                    $elementName = $element->nodeType == XML_ELEMENT_NODE ? '&lt;' . $element->nodeName . '&gt;' : $element->nodeName;
                    $this->handleError( self::ERROR_SCHEMA, ezpI18n::tr( 'kernel/classes/datatypes/ezxmltext', "%1 is not allowed to be a child of &lt;%2&gt;.",
                                        false, array( $elementName, $parent->nodeName ) ) );
                }
                $this->fixSubtree( $element, $element );
                return false;
            }
        }
        // TODO: break processing of any node that doesn't have parent
        //       and is not a root node.
        elseif ( $element->nodeName != 'section' )
        {
            return false;
        }
        return true;
    }
function processBySchemaTree( $element )
    {
        $parent = $element->parentNode;

        if ( $parent instanceof DOMElement )
        {
            $schemaCheckResult = $this->XMLSchema->check( $parent, $element );
            if ( !$schemaCheckResult )
            {
                if ( $schemaCheckResult === false )
                {
                    // Remove indenting spaces
                    if ( $element->nodeType == XML_TEXT_NODE && !trim( $element->textContent ) )
                    {
                        $element = $parent->removeChild( $element );
                        return false;
                    }

                    $elementName = $element->nodeType == XML_ELEMENT_NODE ? '&lt;' . $element->nodeName . '&gt;' : $element->nodeName;
                    $this->handleError( self::ERROR_SCHEMA, ezpI18n::tr( 'kernel/classes/datatypes/ezxmltext', "%1 is not allowed to be a child of &lt;%2&gt;.",
                                        false, array( $elementName, $parent->nodeName ) ) );
                }
                $this->fixSubtree( $element, $element );
                return false;
            }
        }
        // TODO: break processing of any node that doesn't have parent
        //       and is not a root node.
        elseif ( $element->nodeName != 'section' )
        {
            return false;
        }
        return true;
    }
function processBySchemaTree ( $ element ) { $ parent = $ element -> parentNode ; if ( $ parent instanceof DOMElement ) { $ schemaCheckResult = $ this -> XMLSchema -> check ( $ parent , $ element ) ; if ( ! $ schemaCheckResult ) { if ( $ schemaCheckResult === false ) { // Remove indenting spaces if ( $ element -> nodeType == XML_TEXT_NODE && ! trim ( $ element -> textContent ) ) { $ element = $ parent -> removeChild ( $ element ) ; return false ; } $ elementName = $ element -> nodeType == XML_ELEMENT_NODE ? '&lt;' . $ element -> nodeName . '&gt;' : $ element -> nodeName ; $ this -> handleError ( self :: ERROR_SCHEMA , ezpI18n :: tr ( 'kernel/classes/datatypes/ezxmltext' , "%1 is not allowed to be a child of &lt;%2&gt;." , false , array ( $ elementName , $ parent -> nodeName ) ) ) ; } $ this -> fixSubtree ( $ element , $ element ) ; return false ; } } // TODO: break processing of any node that doesn't have parent //       and is not a root node. elseif ( $ element -> nodeName != 'section' ) { return false ; } return true ; }
Check that element has a correct position in the tree and fix it if not.
Check that element has a correct position in the tree and fix it if not .