„In a previous post, I talked about using CSS selectors with yui-ext. Because of it’s dependency on an external library for selector processing, I haven’t been able to leverage the flexibility of CSS selectors at all within yui-ext. With 0.40, that is going to change.
DomQuery
Support for more complex schemas and document structures in the grid’s XMLDataModel class has been requested many times. Currently, you are limited to a schema which consists of only element level tag names and attributes. That is where DomQuery started. When loading a grid from an XML Document, there would be quite a few rapidly executing queries so great performance was imperative. Thanks to the FireBug Profiler, I was able to trace the bottlenecks and test different execution plans to see what was the fastest.
XPath Support
The current Xpath support is basic (not like Google’s full implementation). It works very well though and is very fast.
CSS Selectors
As you will see on the testing and benchmark page, the range of supported queries grew well beyond basic XPath and most of the CSS3 spec for selectors was implemented. There are few limitations, but I will go over those later.
Benchmarks
Once it was working it was time to gather some performance numbers. I decided to see how it performed head to head with some of the other popular selector implementations. Like the benchmarks for DomHelper, I was pretty happy with the results.“

Jack Slocums Blog & DomQuery – A lightweight CSS Selector / Basic XPath implementation

Von admin

Ähnlicher Beitrag

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert