---
title: "QueryPath的问题"
author: "bardo"
date: "2010-04-25T23:02:57Z"
tags: []
categories: ["编程语言"]
slug: "querypath"
draft: false
lastmod: "2010-04-25T23:14:34Z"
id: 652877
url: "https://bardo.iteye.com/blog/652877"
---

QueryPath的问题：

    I found some problems in QueryPath code:
 
    In the line 463 to 470 of the file QueryPath.php :
        If no match is found, we set an empty.
    but the setting is not the outer of foreach! 
 
    In the line 484:
        $vals = explode(' ', $nl->item($i)->getAttribute('class')); 
        $nl->item($i) is a DOMNode and there is no method getAttribute in class DOMNode. （maybe $nl->item($i) is a DOMElement!）
 
    In line 2973:
        if ($lastDot !== FALSE && (strtolower(substr($filename, $lastDot)) == '.html'
        but many file's extension are ".htm" and not ".html". What i can do?
 
    In line 2788
        $test = substr($string, 0, 255);
        The variant $test is never used again from here.