Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error of node searching #3

Closed
R3D9477 opened this issue Jun 1, 2016 · 0 comments
Closed

error of node searching #3

R3D9477 opened this issue Jun 1, 2016 · 0 comments

Comments

@R3D9477
Copy link

R3D9477 commented Jun 1, 2016

Hi. I have error of node searching in my simple example:

package;

import xmlTools.XPath;

class Main {
    public static function main () {
        var xml = Xml.parse("<a></a>");

        var xpath = new XPath();
        var result = xpath.resolve(xml, "//a");
    }
}

error:

Called from ? line 1
Called from Main.hx line 10
Called from xmlTools/XPath.hx line 113
Called from xmlTools/XPath.hx line 205
Uncaught exception - Bad node type, expected Element but found 6

any ideas?

thanks

upd
I added * instread of // in my XPath and it works fine!

package;

import xmlTools.XPath;

class Main {
    public static function main () {
        var xml = Xml.parse("<a></a>"); 
        var xpath = new XPath();
        var result = xpath.resolve(xml, "*/a");
        trace(Lambda.array(result).length);
    }
}
@R3D9477 R3D9477 closed this as completed Jun 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant