xpath 0.1.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 71

A library for Dart developers.

Created from templates made available by Stagehand under a BSD-style license.

Usage #

A simple usage example:

import 'package:xpath/xpath.dart';

String html = '''
 <body id="content">

main() {
  var tree = Etree.fromString(html);
  print(tree.xpath('//*[@id="content"]/h1/text()'[0].name); // print hello

Features and bugs #

Please file feature requests and bugs at the issue tracker.

1.0.0 #

  • Initial version, created by Stagehand


import 'package:xpath/xpath.dart';

main() {
 // var awesome = new Awesome();
 // print('awesome: ${awesome.isAwesome}');

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  xpath: ^0.1.0

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:xpath/xpath.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Apr 4, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6

Health issues and suggestions

Document public APIs. (-0.06 points)

30 out of 31 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/src/xpath_base.dart. (-9.99 points)

Analysis of lib/src/xpath_base.dart reported 21 hints, including:

line 2 col 10: The value of the field '_html' isn't used.

line 48 col 7: The value of the field '_depth' isn't used.

line 91 col 7: DO use curly braces for all flow control structures.

line 239 col 23: The type of the function literal can't be inferred because the literal has a block as its body.

line 241 col 36: DO use curly braces for all flow control structures.

Maintenance suggestions

Package is getting outdated. (-53.42 points)

The package was last published 80 weeks ago.

The package description is too short. (-8 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
Dev dependencies
test ^1.0.0