GitXplorerGitXplorer
a

Fizzler

public
135 stars
29 forks
14 issues

Commits

List of commits on branch master.
Unverified
1edd2005a21473a4b32fa8e04ed3f70d4af616cf

Package read-me doc

aatifaziz committed 6 months ago
Unverified
a594da51e8a1853bf16f11fd1e1a7add2ff20a90

Mark "Either.Fold" lambdas as static

aatifaziz committed 6 months ago
Unverified
cd99eb5e250108295bb030c59cb3c05a46d96c05

Remove empty class declaration body

aatifaziz committed 6 months ago
Unverified
6e537be1278f337952a06926bba6910dc61504ba

Consistently format casts (csharp_space_after_cast = false)

aatifaziz committed 6 months ago
Unverified
e3075ced17ef7eb5e4d451faa5ba2741c321ad34

Convert "Token" & "NamespacePrefix" to records structs

aatifaziz committed 6 months ago
Unverified
49d14f567b5cd7875f4805f27e4751f03953bc05

Enforce & address code & style analysis

aatifaziz committed 6 months ago

README

The README file for this repository.

Fizzler: .NET CSS Selector Engine

Build Status NuGet MyGet

Fizzler is a .NET Standard 1.0 library; it is a W3C Selectors (Level 3) parser and generic selector framework over document hierarchies.

The default implementation is based on HTMLAgilityPack and selects from HTML documents. The unit tests are based on the jQuery selector engine tests.

Contributions are welcome in forms of:

  • Increased selector support
  • Implementation over an HTML-like hierarchical document model
  • Re-factorings
  • Improved tests

Examples

The following example uses Fizzler.Systems.HtmlAgilityPack:

// Load the document using HTMLAgilityPack as normal
var html = new HtmlDocument();
html.LoadHtml(@"
  <html>
      <head></head>
      <body>
        <div>
          <p class='content'>Fizzler</p>
          <p>CSS Selector Engine</p></div>
      </body>
  </html>");

// Fizzler for HtmlAgilityPack is implemented as the
// QuerySelectorAll extension method on HtmlNode

var document = html.DocumentNode;

// yields: [<p class="content">Fizzler</p>]
document.QuerySelectorAll(".content");

// yields: [<p class="content">Fizzler</p>,<p>CSS Selector Engine</p>]
document.QuerySelectorAll("p");

// yields empty sequence
document.QuerySelectorAll("body>p");

// yields [<p class="content">Fizzler</p>,<p>CSS Selector Engine</p>]
document.QuerySelectorAll("body p");

// yields [<p class="content">Fizzler</p>]
document.QuerySelectorAll("p:first-child");