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

Sync ${} inside content #3

Open
denis-migdal opened this issue Feb 28, 2024 · 1 comment
Open

Sync ${} inside content #3

denis-migdal opened this issue Feb 28, 2024 · 1 comment

Comments

@denis-migdal
Copy link
Owner

  1. Fetch text node having "${" with XPath.
  2. Fetch nodes having an attribute containing "${".
  3. Build an updater (set of nodes to update)
  4. On changes, call the updater
document.evaluate(
  '//text()[contains(.,'${')]',
  document,
  null,
  XPathResult.ORDERED_NODE_ITERATOR_TYPE
)
.iterateNext()
it = document.evaluate(
  '//@*[contains(., "${")]',
  document,
  null,
  XPathResult.ORDERED_NODE_ITERATOR_TYPE
)
@denis-migdal
Copy link
Owner Author

  1. Get unique path ( list of childNodes idx).
  2. deep clone(true)
  3. template string with local var.

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