Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lassy-xpath

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lassy-xpath

XPath format and editor for searching LASSY XML files

  • 0.3.0
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-37.5%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status

Lassy XPATH

Module for working with XPATH queries on LASSY XML files. It includes a graphical editor including auto completion, macros and validation based on Ace, a parser and validator based on ts-xpath and an "extractinator" for determining XPATHs to get each node from the returned tree separately. It also has a "reconstructor" to create an XML structure representing the query tree. The functionality can be used as an Angular module, using JQuery or as plain JavaScript.

Angular 2+

(Only tested in Angular 6)

Import the module:

import { LassyXPathModule } from 'lassy-xpath/ng';

@NgModule({
    imports: [LassyXPathModule]
})
export class AppModule {}

Includes the services:

import { MacroService, ExtractinatorService, ValueEvent } from 'lassy-xpath/ng';


@Component()
export class ExampleComponent {
    constructor(
        macroService: MacroService,
        private extractinatorService: ExtractinatorService) {
        // set the macros to use in the editor
        macroService.loadDefault();
    }

    inputChanged(event: ValueEvent) {
        this.valid = !event.error;
        this.value = event.xpath;
        console.log(this.extractinatorService.extract(event.xpath));
    }
}

Embeds an editor:

<lx-editor [value]="value" (onChange)="inputChanged($event)" autofocus="true"></lx-editor>

Use the ParserService for parsing/validating a LASSY XML XPath.

JQuery

Make sure the following scss is included:

@import 'lassy-xpath/scss/xpath-editor';

Extend JQuery by importing lassy-xpath/jquery.

import 'lassy-xpath/jquery';

let $xpathEditor = $('.xpath-editor');
$xpathEditor.xpathEditor({
    macrosUrl: $xpathEditor.data('macros-url')
});

let $xpathVariables = $('.xpath-variables');
$xpathVariables.xpathVariables({
    formName: $xpathVariables.data('name'),
    source: $xpathVariables.data('source'),
});

FAQs

Package last updated on 05 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc