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

Issues when referencing attributes from domino DOMs #32

Open
niedzielski opened this issue Aug 18, 2015 · 3 comments
Open

Issues when referencing attributes from domino DOMs #32

niedzielski opened this issue Aug 18, 2015 · 3 comments

Comments

@niedzielski
Copy link

var doc = domino.createDocument("<div><table class='infobox biota'></table></div>");
var select = xpath.useNamespaces({"x": "http://www.w3.org/1999/xhtml"});
var nodes = select("//x:table[contains(@class,'infobox')]", doc);

TypeError: Cannot call method 'indexOf' of undefined
    at Object.Functions.contains (/home/stephen/dev/wmf/restbase/mobileapps/node_modules/xpath/xpath.js:3436:25)
    at FunctionCall.evaluate (/home/stephen/dev/wmf/restbase/mobileapps/node_modules/xpath/xpath.js:2320:11)
    at PathExpr.evaluate (/home/stephen/dev/wmf/restbase/mobileapps/node_modules/xpath/xpath.js:1673:24)
    at PathExpr.predicateMatches (/home/stephen/dev/wmf/restbase/mobileapps/node_modules/xpath/xpath.js:1973:17)
    at PathExpr.evaluate (/home/stephen/dev/wmf/restbase/mobileapps/node_modules/xpath/xpath.js:1958:15)
    at XPath.evaluate (/home/stephen/dev/wmf/restbase/mobileapps/node_modules/xpath/xpath.js:1215:25)
    at XPathExpression.evaluate (/home/stephen/dev/wmf/restbase/mobileapps/node_modules/xpath/xpath.js:4124:26)
    at Object.exports.selectWithResolver (/home/stephen/dev/wmf/restbase/mobileapps/node_modules/xpath/xpath.js:4313:26)
    at /home/stephen/dev/wmf/restbase/mobileapps/node_modules/xpath/xpath.js:4305:18
    at Object.removeInfobox (/home/stephen/dev/wmf/restbase/mobileapps/lib/transforms.js:53:15)
    at buildInfobox (/home/stephen/dev/wmf/restbase/mobileapps/routes/mobile-html-sections.js:84:23)
    at buildLead (/home/stephen/dev/wmf/restbase/mobileapps/routes/mobile-html-sections.js:100:18)
    at /home/stephen/dev/wmf/restbase/mobileapps/routes/mobile-html-sections.js:140:30
    at tryCatcher (/home/stephen/dev/wmf/restbase/mobileapps/node_modules/bluebird/js/main/util.js:24:31)
    at Promise._settlePromiseFromHandler (/home/stephen/dev/wmf/restbase/mobileapps/node_modules/bluebird/js/main/promise.js:582:31)
    at Promise._settlePromiseAt (/home/stephen/dev/wmf/restbase/mobileapps/node_modules/bluebird/js/main/promise.js:727:18)
@JLRishe
Copy link
Collaborator

JLRishe commented Jan 26, 2016

This is not a bug in this library but rather the result of incomplete DOM compliance in domino. I will open an issue there.

@JLRishe
Copy link
Collaborator

JLRishe commented Jan 26, 2016

I have modified the xpath library to account for this issue: ca913d9

@JLRishe
Copy link
Collaborator

JLRishe commented Jan 26, 2016

I think this may still not be remedied yet.

@JLRishe JLRishe reopened this Jan 26, 2016
@JLRishe JLRishe changed the title XPath for nodes with containing attributes unsupported Issues when referencing attributes from domino DOMs Feb 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants