Skip to content
This repository has been archived by the owner on Dec 13, 2021. It is now read-only.

haxe 3.2.1? #26

Closed
R3D9477 opened this issue May 27, 2016 · 0 comments
Closed

haxe 3.2.1? #26

R3D9477 opened this issue May 27, 2016 · 0 comments

Comments

@R3D9477
Copy link

R3D9477 commented May 27, 2016

Hi. Do haxe-xpath supports Haxe 3.2.1 and Haxelib 3.2.0 ?

I tried to install this from git:
haxelib git xpath https://github.com/djcsdy/haxe-xpath.git

but when I try to compile simple code, like this:

build.hxml:

-main Main
-lib xpath
-neko Main.n

Main.hx:

package;
import xpath.XPath;
...

it fail with error "Type not found : xpath.XPath"
and autocompletion in my IDE show error "No classes found in xpath"

thanks

upd:

if I copy "xpath" sources into directory with Main.hx then I have other error:

Source/xpath/expression/PathStep.hx:51: characters 20-72 : Iterator<xpath.xml.XPathXml> should be _List.ListIterator<xpath.xml.XPathXml>
Source/xpath/expression/PathStep.hx:51: characters 20-72 : { next : Void -> xpath.xml.XPathXml, hasNext : Void -> Bool } should be _List.ListIterator<xpath.xml.XPathXml>

upd2:

with this changes

xpath/expression/PathStep.hx:51:    var nextStepNodes = Lambda.list(nextStepResult.getNodes()).iterator();
xpath/xml/XPathHxXml.hx:522:        return Lambda.list({ iterator: function () return { hasNext: hasNext, next: next } }).iterator();

my program was already compiled, but it can't find easy xpath expression:

package;

import xpath.XPath;
import xpath.xml.XPathHxXml;

class Main {
    public static function main () {
        var xml = Xml.parse("<a><b><c>asdasd</c></b></a>");
        var xpathXml = XPathHxXml.wrapNode(xml);
        var xpExpr   = new XPath("/a/b/c");
        var result   = xpExpr.selectNodes(xpathXml);
        trace(Lambda.list(result).length);
    }
}

as result I have:

Main.hx:18: 0

upd3:
code from "upd2" work's fine now. just needed some changes in xpath lib:

in xpath/expression/PathStep.hx change line 51 to:
nextStepNodes = Lambda.list(nextStepResult.getNodes()).iterator();

in xpath/xml/XPathHxXml.hx change line 522 to:
return Lambda.list({ iterator: function () return { hasNext: hasNext, next: next } }).iterator();

@R3D9477 R3D9477 closed this as completed May 31, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant