Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Req] navigating with XPath #27

Closed
ArsenShnurkov opened this issue Sep 9, 2015 · 4 comments
Closed

[Req] navigating with XPath #27

ArsenShnurkov opened this issue Sep 9, 2015 · 4 comments

Comments

@ArsenShnurkov
Copy link

XPath uses path expressions to select nodes or node-sets.

brief introduction:
http://www.w3schools.com/xsl/xpath_syntax.asp

EBNF-like grammar:
http://www.w3.org/TR/xquery-xpath-parsing/#id-grammar

.net class library contains a set of classes and interfaces which automates that.
(starting from System.Xml.XPath, IXPathNavigable )

I propose to implement such access to the tree of Match-es, which are returned as result of parsing

@furesoft
Copy link

good idea

@ArsenShnurkov
Copy link
Author

2003-03-02, XPath Querying Over Objects with ObjectXPathNavigator, Steve Saxon, https://msdn.microsoft.com/en-us/library/ms950764.aspx

"You could pass the IXPathNavigator over the object directly into an XSLT transform without needing to serialize it first."

https://github.com/AndrewMayorov/ObjectXPathNavigator

...

Another approach is Linq to Objects

@ArsenShnurkov
Copy link
Author

http://goessner.net/articles/JsonPath/

XPath JSONPath Description
/ $ the root object/element
. @ the current object/element
/ . or [] child operator
.. n/a parent operator
// .. recursive descent. JSONPath borrows this syntax from E4X.
* * wildcard. All objects/elements regardless their names.
@ n/a attribute access. JSON structures don't have attributes.
[] [] subscript operator. XPath uses it to iterate over element collections and for predicates. In Javascript and JSON it is the native array operator.
| [,] Union operator in XPath results in a combination of node sets. JSONPath allows alternate names or array indices as a set.
n/a [start:‌end:step] array slice operator borrowed from ES4.
[] ?() applies a filter (script) expression.
n/a () script expression, using the underlying script engine.
() n/a grouping in Xpath

http://programmers.stackexchange.com/questions/264706/xslt-equivalent-for-json

@ArsenShnurkov
Copy link
Author

https://www.sitepen.com/blog/2010/11/02/resource-query-language-a-query-language-for-the-web-nosql/

RQL is designed to be URI friendly, leveraging URI encoding and designated delimiters for syntax that works perfectly in web requests.
RQL is designed to be extensible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants