src/Data/Xml.php
public function parseXPath($pPath)
    {
        $path = str_replace('@app', '/', $pPath);
        $path = preg_replace('#^@module\[([a-z0-9/]+)\]|@layout#', '', $path);

        $pathArr = explode('/', $path);

        foreach($pathArr as $key => $node) {
            if (preg_match('/^([a-zA-Z0-9\[\]@\'"=_-]+):([a-zA-Z0-9_-]+)$/', $node, $matches)) {
                $pathArr[$key] = $matches[1] . '/attribute::' . $matches[2];
            } else if (preg_match('/^([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)=([a-zA-Z0-9_-]+)$/', $node, $matches)) {
                $pathArr[$key] = $matches[1] . '[@' . $matches[2] . '="' . $matches[3] . '"]';
            } else if (preg_match('/^([a-zA-Z0-9_-]+)>([a-zA-Z0-9_-]+)=([a-zA-Z0-9_-]+)$/', $node, $matches)) {
                $pathArr[$key] = $matches[1] . '[' . $matches[2] . '="' . $matches[3] . '"]';
            }
        }

        return '//' . implode('/', $pathArr);
    }
public function parseXPath($pPath)
    {
        $path = str_replace('@app', '/', $pPath);
        $path = preg_replace('#^@module\[([a-z0-9/]+)\]|@layout#', '', $path);

        $pathArr = explode('/', $path);

        foreach($pathArr as $key => $node) {
            if (preg_match('/^([a-zA-Z0-9\[\]@\'"=_-]+):([a-zA-Z0-9_-]+)$/', $node, $matches)) {
                $pathArr[$key] = $matches[1] . '/attribute::' . $matches[2];
            } else if (preg_match('/^([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)=([a-zA-Z0-9_-]+)$/', $node, $matches)) {
                $pathArr[$key] = $matches[1] . '[@' . $matches[2] . '="' . $matches[3] . '"]';
            } else if (preg_match('/^([a-zA-Z0-9_-]+)>([a-zA-Z0-9_-]+)=([a-zA-Z0-9_-]+)$/', $node, $matches)) {
                $pathArr[$key] = $matches[1] . '[' . $matches[2] . '="' . $matches[3] . '"]';
            }
        }

        return '//' . implode('/', $pathArr);
    }
public function parseXPath ( $ pPath ) { $ path = str_replace ( '@app' , '/' , $ pPath ) ; $ path = preg_replace ( '#^@module\[([a-z0-9/]+)\]|@layout#' , '' , $ path ) ; $ pathArr = explode ( '/' , $ path ) ; foreach ( $ pathArr as $ key => $ node ) { if ( preg_match ( '/^([a-zA-Z0-9\[\]@\'"=_-]+):([a-zA-Z0-9_-]+)$/' , $ node , $ matches ) ) { $ pathArr [ $ key ] = $ matches [ 1 ] . '/attribute::' . $ matches [ 2 ] ; } else if ( preg_match ( '/^([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)=([a-zA-Z0-9_-]+)$/' , $ node , $ matches ) ) { $ pathArr [ $ key ] = $ matches [ 1 ] . '[@' . $ matches [ 2 ] . '="' . $ matches [ 3 ] . '"]' ; } else if ( preg_match ( '/^([a-zA-Z0-9_-]+)>([a-zA-Z0-9_-]+)=([a-zA-Z0-9_-]+)$/' , $ node , $ matches ) ) { $ pathArr [ $ key ] = $ matches [ 1 ] . '[' . $ matches [ 2 ] . '="' . $ matches [ 3 ] . '"]' ; } } return '//' . implode ( '/' , $ pathArr ) ; }
Parse the required config path in order to convert the Agl syntax into a
valid XPath query.

@param string $pPath Requested path
@return string XPath query
Parse the required config path in order to convert the Agl syntax into a valid XPath query .