-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
How to get xpath in epubjs ? #1360
Comments
Can anyone help me on this ? |
1 similar comment
Can anyone help me on this ? |
I need a help on this , Please anyone guide me on this ? |
Step 1. Use Step 2. Construct a Step 3. Use |
Is there any method to generate xpath ? |
Short answer: Don't. Use CFI instead. Long answer: Firstly, generating XPaths has nothing to do with Epub.js. Second, XPath isn't designed to be used as an identifier. If you want identifiers, you should use CFI. Finally, if you still want to use XPath for whatever reason, there are virtually an infinite number of ways to get XPaths of any given node, depending on what you want to do. The most common approach is:
|
Can you tell me stepToXpath(steps) , what does step means here and how to generate it ? |
I don't know anything about "stepToXpath(steps)". Where does this function even come from? In general, a step in XPath just means an expression that moves you towards the desired result. In practice you can just think of it as everything that comes after a |
![IMG20230922112134.jpg](https://github.com/futurepress/epub.js/assets/115630669/60c07ecf-5859-45ab-b264-06dc452af9c3 |
It's "stepsToXpath", not "stepToXpath". Steps here means the parsed CFI steps, an array of objects in the form |
No description provided.
The text was updated successfully, but these errors were encountered: