Skip to content

XPath 1.0 Query Support

Pre-release
Pre-release
Compare
Choose a tag to compare
@keith-hall keith-hall released this 05 Feb 16:32

New features:

  • Query XML and HTML documents using XPath 1.0 expressions
    • with syntax highlighting and intelligent auto-completion
    • with a custom print function that can be used as a debugging aid by logging nodesets etc. to the console
    • option to display results or select the nodes in the document
    • optionally normalize whitespace when displaying text results (via a setting)
    • with history
    • with support for variables
    • with the node under the first selection/cursor as the context node, and all the nodes under the cursors available in the $contexts variable
  • Select entire contents of tag(s) at cursor(s), with or without the open/close tags
  • Show XML well-formedness parse errors, with a new entry in the command pallette to move the cursor to the location where the error occurred
  • Clean HTML/"tag soup" into valid XML
  • option to only show the current xpath in the status bar if the view is not dirty

Compared to the beta4 release, the following changes have been made:

  • intelligent auto completion has been added! see the readme for a demonstration
  • better syntax highlighting
  • some automated tests
  • a few tweaks and bug fixes

known bugs:

  • auto complete doesn't handle nested functions brilliantly, unless separated by whitespace eg. starts-with(name( would cause issues but starts-with( name( wouldn't. This is due to the way scopes work in ST, specifically finding specific scopes. A fix will be made shortly.