Need function to canonicalize XML
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zorba |
Fix Released
|
High
|
Juan Zacarias |
Bug Description
We need an XQuery function to canonicalize XML (that is, implement the "canonical XML" spec: http://
I propose the following signature:
declare function xml:canonicaliz
That would allow people to feed the output of fn:serialize() directly into this function.
Another option would be to have a Zorba-specific option for fn:serialize(); however, I think this would be more work, and from what I can see of the libxml2 interface, it wouldn't necessarily allow for more efficient code anyway. But if it can be done that way, great!
Related branches
- Chris Hillery: Approve
- Matthias Brantner: Approve
- Luis Rodriguez Gonzalez: Approve
-
Diff: 1282 lines (+548/-104)47 files modifiedChangeLog (+1/-0)
cmake_modules/GenZorbaRuntime.cmake (+1/-1)
cmake_modules/ZorbaRuntimeGenerator.cmake (+1/-1)
include/zorba/pregenerated/diagnostic_list.h (+2/-0)
modules/com/zorba-xquery/www/modules/CMakeLists.txt (+1/-1)
modules/com/zorba-xquery/www/modules/xml-options.xsd (+4/-1)
modules/com/zorba-xquery/www/modules/xml.xq (+110/-38)
modules/w3c/pregenerated/xqt-errors.xq (+8/-0)
src/diagnostics/diagnostic_en.xml (+6/-0)
src/diagnostics/pregenerated/diagnostic_list.cpp (+3/-0)
src/diagnostics/pregenerated/dict_en.cpp (+1/-0)
src/functions/func_parse_fragment_impl.cpp (+1/-0)
src/functions/pregenerated/func_parse_fragment.cpp (+23/-0)
src/functions/pregenerated/func_parse_fragment.h (+15/-0)
src/functions/pregenerated/function_enum.h (+1/-0)
src/runtime/parsing_and_serializing/parse_fragment_impl.cpp (+77/-0)
src/runtime/parsing_and_serializing/pregenerated/parse_fragment.cpp (+36/-0)
src/runtime/parsing_and_serializing/pregenerated/parse_fragment.h (+43/-0)
src/runtime/pregenerated/iterator_enum.h (+1/-0)
src/runtime/spec/mappings.xml (+1/-1)
src/runtime/spec/parsing_and_serializing/parse_fragment.xml (+25/-2)
src/runtime/visitors/pregenerated/planiter_visitor.h (+5/-0)
src/runtime/visitors/pregenerated/printer_visitor.cpp (+14/-0)
src/runtime/visitors/pregenerated/printer_visitor.h (+3/-0)
src/store/api/load_properties.h (+73/-1)
src/store/naive/loader_dtd.cpp (+1/-30)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/canonicalize-1.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/canonicalize-3-buggy-old-libxml.xml.res (+14/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/canonicalize-3.xml.res (+14/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/canonicalize-1.xq (+4/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/canonicalize-2.spec (+2/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/canonicalize-2.xq (+4/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/canonicalize-3.spec (+5/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/canonicalize-3.xq (+18/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-20.xq (+2/-2)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-21.xq (+2/-2)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-22.xq (+2/-2)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-23.xq (+2/-2)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-24.xq (+2/-2)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-25.xq (+2/-2)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-26.xq (+2/-2)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-27.xq (+2/-2)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-28.xq (+2/-2)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-29.xq (+2/-2)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-31.xq (+3/-3)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-32.xq (+3/-3)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-33.xq (+2/-2)
Changed in zorba: | |
status: | Confirmed → In Progress |
Changed in zorba: | |
milestone: | 2.8 → 2.9 |
tags: | added: hotlist |
Changed in zorba: | |
status: | In Progress → Fix Committed |
Changed in zorba: | |
status: | Fix Committed → Fix Released |
This functionality needs to be in a core Zorba module. It would make sense for it to be in the core XML module http:// www.zorba- xquery. com/modules/ xml - although that module current uses the prefix "parse-xml" which perhaps should be changed.
However, implementing functions in a built-in module is difficult. I therefore propose the following plan:
1. Luis implements a core module to do this, http:// www.zorba- xquery. com/modules/ xml/canonicaliz e . Use the normal DECLARE_ ZORBA_MODULE( ) method of having the C++ code in canonicalize.xq.src and so on.
2. After that is done, if we feel it is necessary, Matthias or someone else with Zorba runtime knowledge can either do the work to make it a true built-in module, or explain the necessary steps to Luis to do it.