xpath가 FireFox에서 작동하는 방식을 알아 내려고했지만 단순한 네임 스페이스 접두사를 해결할 수 없습니다. lookupNamespaceURI는 null을 반환합니다.createNSResolver와 lookupNamespaceURI를 직접 사용하는 방법은 무엇입니까?
인터넷에서 작동 예제를 찾을 수 없으므로이 기능을 올바르게 사용하고 있는지 궁금합니다. 모든 통찰력이 도움이 될 것입니다.
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ev="http://www.w3.org/2001/xml-events">
<head>
<script type="text/javascript">
var testResolver = function()
{
var resolver = document.createNSResolver(document.documentElement);
alert(resolver.lookupNamespaceURI('ev'));
}
</script>
</head>
<body onload="testResolver()">
</body>
</html>
보인다. 감사! –