URI processing module
Bug #867376 reported by
William Candillon
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zorba |
Fix Released
|
High
|
Luis Rodriguez Gonzalez |
Bug Description
URI processing is a very common operation in XQuery and expath http client requires a lot of URI processing,
Zorba should provide the following functions:
uri:parse($uri as xs:string) as schema-
uri:serialize($uri as schema-
Related branches
lp:~zorba-coders/zorba/bug-867376
- Matthias Brantner: Approve
- Chris Hillery: Approve
-
Diff: 2405 lines (+1391/-162)40 files modifiedChangeLog (+1/-0)
include/zorba/pregenerated/diagnostic_list.h (+6/-0)
modules/com/zorba-xquery/www/modules/pregenerated/errors.xq (+16/-1)
modules/com/zorba-xquery/www/modules/uri.xq (+99/-4)
src/diagnostics/diagnostic_en.xml (+17/-0)
src/diagnostics/pregenerated/diagnostic_list.cpp (+9/-0)
src/diagnostics/pregenerated/dict_en.cpp (+3/-0)
src/diagnostics/qname.cpp (+1/-0)
src/functions/pregenerated/func_uris.cpp (+44/-0)
src/functions/pregenerated/func_uris.h (+30/-0)
src/functions/pregenerated/function_enum.h (+2/-0)
src/runtime/pregenerated/iterator_enum.h (+2/-0)
src/runtime/spec/uris/uris.xml (+28/-0)
src/runtime/uris/pregenerated/uris.cpp (+56/-0)
src/runtime/uris/pregenerated/uris.h (+64/-0)
src/runtime/uris/uris_impl.cpp (+216/-0)
src/runtime/visitors/pregenerated/planiter_visitor.h (+10/-0)
src/runtime/visitors/pregenerated/printer_visitor.cpp (+28/-0)
src/runtime/visitors/pregenerated/printer_visitor.h (+6/-0)
src/unit_tests/test_uri.cpp (+153/-38)
src/zorbatypes/URI.cpp (+165/-105)
src/zorbatypes/URI.h (+36/-13)
test/fots/CMakeLists.txt (+0/-1)
test/rbkt/ExpQueryResults/zorba/uris/parse-uri.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/uris/serialize-direct-uri.xml.res (+37/-0)
test/rbkt/ExpQueryResults/zorba/uris/serialize-uri.xml.res (+44/-0)
test/rbkt/Queries/zorba/uris/parse-invalid.spec (+1/-0)
test/rbkt/Queries/zorba/uris/parse-invalid.xq (+3/-0)
test/rbkt/Queries/zorba/uris/parse-uri.xq (+6/-0)
test/rbkt/Queries/zorba/uris/serialize-direct-uri.xq (+211/-0)
test/rbkt/Queries/zorba/uris/serialize-uri.xq (+9/-0)
test/rbkt/Queries/zorba/uris/serialize-wrong-opaque-noscheme.spec (+1/-0)
test/rbkt/Queries/zorba/uris/serialize-wrong-opaque-noscheme.xq (+8/-0)
test/rbkt/Queries/zorba/uris/serialize-wrong-opaque.spec (+1/-0)
test/rbkt/Queries/zorba/uris/serialize-wrong-opaque.xq (+10/-0)
test/rbkt/Queries/zorba/uris/serialize-wrong-path1.spec (+1/-0)
test/rbkt/Queries/zorba/uris/serialize-wrong-path1.xq (+9/-0)
test/rbkt/Queries/zorba/uris/serialize-wrong-path2.spec (+1/-0)
test/rbkt/Queries/zorba/uris/serialize-wrong-path2.xq (+10/-0)
test/rbkt/Queries/zorba/uris/uri-source.xml (+46/-0)
Changed in zorba: | |
assignee: | nobody (nobody-users) → Sorin Marian Nasoi (sorin.marian.nasoi) |
milestone: | none → 2.8 |
Changed in zorba: | |
milestone: | 2.8 → none |
Changed in zorba: | |
assignee: | Sorin Marian Nasoi (sorin.marian.nasoi) → Luis Rodriguez Gonzalez (kuraru) |
milestone: | none → 2.9 |
tags: | added: hotist |
tags: |
added: hotlist removed: hotist |
Changed in zorba: | |
status: | New → In Progress |
tags: |
added: new-functionality-requirement removed: function-library |
Changed in zorba: | |
status: | In Progress → Fix Committed |
Changed in zorba: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Luis - this should be implemented using Zorba's internal URI class (src/zorbatypes /URI.cpp) , so it'll have to be a built-in module.
Suggested steps:
1. Define a schema for the <uri:uri> element in the function signatures above. It should be fairly simple - just needs child elements or attributes for all the component parts of a URI: scheme, authority, path, query, fragment, and possibly host, username, etc. See http:// docs.oracle. com/javase/ 1.4.2/docs/ api/java/ net/URI. html for a good discussion of the form of a URI. Time: 1 day for initial proposal, plus some discussion.
2. Implement uri:parse() using URI.cpp to break apart the URI into a <uri:uri> element; don't forget lots of tests for all possible forms. Time: 2 days.
3. Implement uri:serialize() to put it back together again; tests. Time: 2 days.
4. Extend URI.cpp to more clearly support opaque URIs, and extend schema and module to support them. Time: 2 days.