CodeExplorer getXPath example
if (isset($rule['nodeName'
]) &&
is_array($rule['nodeName'
]) && !
in_array($ele->localName,
$rule['nodeName'
], true
)) { continue;
} if (isset($rule['attrName'
]) && !
is_array($rule['attrName'
]) &&
$rule['attrName'
] !==
$attr->localName
) { continue;
} if (isset($rule['attrName'
]) &&
is_array($rule['attrName'
]) && !
in_array($attr->localName,
$rule['attrName'
], true
)) { continue;
} if (isset($rule['xpath'
])) { $xp =
$this->
getXPath($attr);
if (isset($rule['prefixes'
])) { foreach ($rule['prefixes'
] as $nsPrefix =>
$ns) { $xp->
registerNamespace($nsPrefix,
$ns);
} } if (!
$xp->
evaluate($rule['xpath'
],
$attr)) { continue;
} } return true;
}