LANGREITER.COM plain, simple | |||||||
![]() ![]() | |||||||
helma-select helma-select is a prototypical JavaScript implementation of XPath object graph navigation for Helma. It works by providing a Jaxen Navigator (object graph adaptor). Examples of Use <HopObject>.select(xpathExpr[, hierarchyMode]) var children = root.select("*"); var josefsPages = root.select("company/team/*[creator/@name='josef']"); var friendsOfFriends = chris.select("friends/*/friends/*"); var wahreFreunde = chris.select("friends/*[@rating > 5]"); var allTexts = root.select("//@text", true); // note the hierarchyMode! Caveats As there's no 1:1 object graph/XML Infoset mapping, a few tradeoffs concerning graph expansion had to be made: In "hierarchy mode", the navigator follows only the hierarchy defined by _parent relationships (plus one expansion at the leaves), in "graph mode" all child nodes are always expanded, which can result in infinite loops when using recursive queries like //<element>. It is thought that this is one of the more practical approaches to solve that problem. helma-select in its current incarnation is probably not exactly fast. If usefulness warrants the effort, a native Java version should replace this implementation. The primary purpose of this version is to gather experience as for what effects more advanced object graph navigation and querying facilities might have on application design and code size. Besides, it also demonstrates some of the new JavaScript constructs available thanks to the recently integrated Rhino engine (syntactical support for first-class functions, JavaAdapter). So far I've only tested helma-select with a fairly simple application and an accordingly simple object graph. It seems to work nicely. Prerequisites ![]() ![]() Installation Put the files into the hopobject directory of an application. Download ![]() Comments &c. To me, please. |
![]() ![]() ![]() So log in, fella — or finally get your langreiter.com account. You always wanted one. Nearby in the temporal dimension: Nobody. ... and 15 of the anonymous kind. Click on ![]() BACKLINKS ![]() RECENT EDITS (MORE) ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() POWERED BY ![]() &c. GeoURL RSS 0.92 FRIENDLY SHOPS Uncut Games bei Gameware OFFEN! Offenlegung gem. §25 MedienG: Christian Langreiter, Langkampfen See also: Privacy policy. |