-
Notifications
You must be signed in to change notification settings - Fork 71
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
Little informative examples. #81
Comments
If you use namespaces correctly, you should be able to use a full path just fine: /ns:html/ns:body/ns:child/ns:child2 However, this library has an HTML mode which ignores namespaces on unprefixed node tests and is case insensitive on node names. I would advise using that in your case: var expr = xpath.parse('/html/body/child1/child1');
var result = expr.select({ node: dom, isHtml: true }); |
"isHtml" flag is working. But I do not see it in the documentation. Alternatively, I tried to do this without a flag, and nothing works for me. But maybe it's planned :) |
I will add it to the documentation. Thank you for pointing that out. The example in your pastebin doesn't work because the path is wrong. |
Excellent. Thanks (this works). I do not know if it's worth describing the situation with my example and the '/ns:html/ns:head/ns: title' solution in the documentation. This I leave to your discretion. topic may be closed. |
Hello.
The idea of using namespaces is certainly original, but it is not always convenient. In general, I load the page from somewhere and I do not want to set namespaces.
It would be convenient to turn them off optionally.
Further.
I'm trying to parse the next line:
const htmlString=
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Galleries</title></head><body></body></html>
;I can not select /html/head/title for this line using namespace.
In your examples, a search is made for part of the path (for example, "/namespace:DeepChild").
I want/need to use the full path - /html/body/child1/child2/....
If I use namespaces, it does not work.
The text was updated successfully, but these errors were encountered: