Merge lp:~nbrinza/zorba/parse-fragment into lp:zorba

Proposed by Nicolae Brinza on 2012-03-15
Status: Merged
Approved by: Matthias Brantner on 2012-03-16
Approved revision: 10518
Merged at revision: 10724
Proposed branch: lp:~nbrinza/zorba/parse-fragment
Merge into: lp:zorba
Diff against target: 5731 lines (+2968/-642)
158 files modified
CMakeLists.txt (+15/-5)
ChangeLog (+2/-0)
modules/com/zorba-xquery/www/modules/CMakeLists.txt (+2/-0)
modules/com/zorba-xquery/www/modules/xml-options.xsd (+86/-0)
modules/com/zorba-xquery/www/modules/xml.xq (+240/-4)
src/api/xmldatamanagerimpl.cpp (+72/-38)
src/context/static_context.cpp (+78/-72)
src/context/static_context.h (+4/-3)
src/diagnostics/diagnostic_en.xml (+10/-6)
src/diagnostics/pregenerated/dict_en.cpp (+4/-3)
src/functions/pregenerated/func_parse_fragment.cpp (+7/-21)
src/functions/pregenerated/func_parse_fragment.h (+3/-3)
src/functions/pregenerated/function_enum.h (+1/-2)
src/runtime/parsing_and_serializing/fragment_istream.h (+54/-10)
src/runtime/parsing_and_serializing/parse_fragment_impl.cpp (+167/-168)
src/runtime/parsing_and_serializing/pregenerated/parse_fragment.h (+1/-1)
src/runtime/sequences/sequences_impl.cpp (+10/-10)
src/runtime/spec/parsing_and_serializing/parse_fragment.xml (+5/-12)
src/store/api/load_properties.h (+224/-38)
src/store/naive/loader.h (+23/-6)
src/store/naive/loader_dtd.cpp (+307/-165)
src/store/naive/loader_fast.cpp (+9/-1)
src/store/naive/simple_store.cpp (+14/-12)
src/types/typeimpl.cpp (+20/-4)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-01.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-02.xml.res (+6/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-03.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-04.xml.res (+12/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-05.xml.res (+12/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-06.xml.res (+8/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-07.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-08.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-09.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-10.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-11.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-12.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-13.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-14.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-15.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-16.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-17.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-18.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-19.xml.res (+8/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-20.xml.res (+8/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-21.xml.res (+6/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-22.xml.res (+4/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-23.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-24.xml.res (+5/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-25.xml.res (+14/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-26.xml.res (+14/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-27.xml.res (+10/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-28.xml.res (+6/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-29.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-30.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-31.xml.res (+59/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-32.xml.res (+50/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-33.xml.res (+34/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-34.xml.res (+18/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-35.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-36.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-37.xml.res (+14/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-38.xml.res (+14/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-39.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-40.xml.res (+3/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-41.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-42.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-43.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-44.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-45.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-46.xml.res (+31/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-53.xml.res (+8/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-54.xml.res (+7/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-55.xml.res (+8/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-56.xml.res (+7/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-xml-fragment-12.xml.res (+1/-1)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-01.xq (+8/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-02.xq (+13/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-03.xq (+13/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-04.xq (+19/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-05.xq (+19/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-06.xq (+19/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-07.xq (+19/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-08.xq (+9/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-09.xq (+9/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-10.xq (+9/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-11.xq (+9/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-12.xq (+9/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-13.xq (+9/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-14.xq (+9/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-15.xq (+8/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-16.xq (+8/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-17.xq (+8/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-18.xq (+9/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-19.xq (+15/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-20.xq (+15/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-21.xq (+15/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-22.xq (+15/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-23.xq (+15/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-24.xq (+16/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-25.xq (+21/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-26.xq (+21/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-27.xq (+21/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-28.xq (+21/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-29.xq (+21/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-30.xq (+21/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-31.xq (+65/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-32.xq (+65/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-33.xq (+65/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-34.xq (+65/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-35.xq (+65/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-36.xq (+65/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-37.xq (+20/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-38.xq (+20/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-39.xq (+20/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-40.xq (+9/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-41.xq (+9/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-42.xq (+9/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-43.xq (+9/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-44.xq (+9/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-45.xq (+9/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-46.xq (+37/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-47.spec (+1/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-47.xq (+13/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-48.spec (+1/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-48.xq (+13/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-49.spec (+1/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-49.xq (+13/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-50.spec (+1/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-50.xq (+13/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-51.spec (+1/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-51.xq (+11/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-52.spec (+1/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-52.xq (+11/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-53.xq (+13/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-54.xq (+14/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-55.xq (+14/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-56.xq (+14/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-01.xq (+6/-2)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-02.xq (+6/-2)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-03.xq (+6/-2)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-04.xq (+6/-2)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-05.xq (+8/-2)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-06.xq (+6/-2)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-07.xq (+6/-2)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-08.xq (+7/-2)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-09.xq (+6/-2)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-10.xq (+2/-2)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-11.xq (+7/-2)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-12.xq (+6/-2)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-13.xq (+7/-1)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-14.xq (+6/-2)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-15.xq (+8/-2)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-16.spec (+0/-1)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-16.xq (+0/-8)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-17.spec (+0/-1)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-17.xq (+0/-8)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-18.spec (+1/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-18.xq (+0/-10)
To merge this branch: bzr merge lp:~nbrinza/zorba/parse-fragment
Reviewer Review Type Date Requested Status
David Graf (community) 2012-03-15 Approve on 2012-03-16
William Candillon 2012-03-15 Approve on 2012-03-16
Matthias Brantner 2012-03-15 Approve on 2012-03-16
Review via email: mp+97701@code.launchpad.net

This proposal supersedes a proposal from 2012-03-15.

Commit Message

Fully streaming parse-xml module.

Description of the Change

Fully streaming parse-xml module.

To post a comment you must log in.
William Candillon (wcandillon) wrote : Posted in a previous version of this proposal

The branch doesn't compile on my machine:
[ 0%] Building CXX object src/CMakeFiles/zorba_simplestore.dir/functions/func_nodes.cpp.o
In file included from /Users/wcandillon/tmp/parse-fragment/build/src/functions/func_nodes.cpp:26:
/Users/wcandillon/tmp/parse-fragment/build/src/runtime/nodes/nodes.h:211: error: stray '#' in program
/Users/wcandillon/tmp/parse-fragment/build/src/runtime/nodes/nodes.h:212: error: stray '#' in program
/Users/wcandillon/tmp/parse-fragment/build/src/runtime/nodes/nodes.h:212: error: stray '#' in program
/Users/wcandillon/tmp/parse-fragment/build/src/runtime/nodes/nodes.h:211: error: expected ',' or '...' before numeric constant
/Users/wcandillon/tmp/parse-fragment/build/src/runtime/nodes/nodes.h:211: error: expected `)' before ';' token
/Users/wcandillon/tmp/parse-fragment/build/src/runtime/nodes/nodes.h:211: error: ISO C++ forbids declaration of 'aAttr' with no type
/Users/wcandillon/tmp/parse-fragment/build/src/runtime/nodes/nodes.h:211: error: expected ';' before ')' token
/Users/wcandillon/tmp/parse-fragment/build/src/runtime/nodes/nodes.h:212: error: expected ',' or '...' before numeric constant
/Users/wcandillon/tmp/parse-fragment/build/src/runtime/nodes/nodes.h:212: error: expected `)' before ';' token
/Users/wcandillon/tmp/parse-fragment/build/src/runtime/nodes/nodes.h:212: error: ISO C++ forbids declaration of 'aLangAttr' with no type
/Users/wcandillon/tmp/parse-fragment/build/src/runtime/nodes/nodes.h:212: error: expected unqualified-id before 'const'
/Users/wcandillon/tmp/parse-fragment/build/src/runtime/nodes/nodes.h:212: error: ISO C++ forbids declaration of 'aRequestLang' with no type
/Users/wcandillon/tmp/parse-fragment/build/src/runtime/nodes/nodes.h:212: error: expected ';' before ')' token

@Matthias, are you experiencing the same issue on mac?

William Candillon (wcandillon) wrote : Posted in a previous version of this proposal

It seems to be a problem with the diff:
- bool isLangAttr(const store::Item_t& aAttr) const;
- bool matchesReqLang(const store::Item_t& aLangAttr, const zstring& aRequestLang) const;
+ bool isLangAttr(const store::Item_t& aAttr) const;
+ bool matchesReqLang(const store::Item_t& aLangAttr, const zstring& aRequestLang) const;

review: Needs Fixing
Nicolae Brinza (nbrinza) wrote : Posted in a previous version of this proposal

Yes, indeed, this is a strange corruption that I sometimes get after a merge. I've fixed the issue, resubmitting.

Matthias Brantner (matthias-brantner) wrote : Posted in a previous version of this proposal

WOW, that's really cool. I just tried parsing a huge file and memory consumption was constant at a low level. Also, skipping root nodes worked like a charm.

I have some question/remarks:
- In the schema, there is a typo skip-top-Level-text-nodes => skip-top-level-text-nodes
- If validation is enabled, will the validation copy or validate-in-place? I think it should validate-in-place for performance reasons.
- From the documentation, it's not clear on which nodes validation will happen if root nodes are skipped.
- Why does the schema have the following copyright notice "Copyright (c)2010 Elsevier, Inc."?
- The copyright should be 2006-2012
- Parsing the following document with <opt:parse-external-parsed-entity opt:skip-root-nodes="1"/> results in an infinite loop:
<root><a id='0'>
 0
 </b>
</a>
<a id='1'>
 1
</a>
<a id='2'>
 2
</a>
</root>
- The feature is not added to the ChangeLog

review: Needs Fixing
Matthias Brantner (matthias-brantner) wrote : Posted in a previous version of this proposal

Also, the branch doesn't build without schema support (i.e. ZORBA_NO_XMLSCHEMA:BOOL=ON)

[ 1%] Building CXX object src/CMakeFiles/zorba_simplestore.dir/runtime/parsing_and_serializing/parse_fragment_impl.cpp.o
/home/mbrantner/zorba/sandbox/src/runtime/parsing_and_serializing/parse_fragment_impl.cpp: In function ‘void zorba::processOptions(zorba::store::Item_t, zorba::store::LoadProperties&, zorba::static_context*, const zorba::QueryLoc&)’:
/home/mbrantner/zorba/sandbox/src/runtime/parsing_and_serializing/parse_fragment_impl.cpp:62:3: error: ‘Validator’ has not been declared
/home/mbrantner/zorba/sandbox/src/runtime/parsing_and_serializing/parse_fragment_impl.cpp:67:7: error: ‘ParseConstants’ has not been declared

review: Needs Information
William Candillon (wcandillon) wrote : Posted in a previous version of this proposal

Why is there an Elsevier copyright for modules/com/zorba-xquery/www/modules/xml-options.xsd ?

review: Needs Information
Nicolae Brinza (nbrinza) wrote : Posted in a previous version of this proposal

The Elsevier copyright came from the xqdoc.xsd, which I think I used as a base for the options file. I fixed it together with the other issues Matthias has raised. I've also fixed a couple of other cases where malformed XMLs where handled incorrectly. Resubmitting for merging.

William Candillon (wcandillon) wrote : Posted in a previous version of this proposal

I tried the forecast data with the parse function: very impressive!!

For documentation purposes, I would rename the parse-xml prefix to xml, this is more consistent right?

review: Needs Information
William Candillon (wcandillon) wrote : Posted in a previous version of this proposal

Would xmldoc be a good prefix?

Nicolae Brinza (nbrinza) wrote : Posted in a previous version of this proposal

It certainly is the closest allowed alternative...

Matthias Brantner (matthias-brantner) wrote : Posted in a previous version of this proposal

- The branch doesn't build without schema support (i.e. ZORBA_NO_XMLSCHEMA:BOOL=ON)

[ 1%] Building CXX object src/CMakeFiles/zorba_simplestore.dir/runtime/parsing_and_serializing/parse_fragment_impl.cpp.o
/home/mbrantner/zorba/sandbox/src/runtime/parsing_and_serializing/parse_fragment_impl.cpp: In function ‘void zorba::processOptions(zorba::store::Item_t, zorba::store::LoadProperties&, zorba::static_context*, const zorba::QueryLoc&)’:
/home/mbrantner/zorba/sandbox/src/runtime/parsing_and_serializing/parse_fragment_impl.cpp:62:3: error: ‘Validator’ has not been declared
/home/mbrantner/zorba/sandbox/src/runtime/parsing_and_serializing/parse_fragment_impl.cpp:67:7: error: ‘ParseConstants’ has not been declared
make[2]: *** [src/CMakeFiles/zorba_simplestore.dir/runtime/parsing_and_serializing/parse_fragment_impl.cpp.o] Error 1

- If validation is enabled, will the validation copy or validate-in-place? I think it should validate-in-place for performance reasons.

review: Needs Fixing
William Candillon (wcandillon) : Posted in a previous version of this proposal
review: Approve
Nicolae Brinza (nbrinza) wrote : Posted in a previous version of this proposal

All pending issues have been fixed. Resubmitting the proposal for merging.

William Candillon (wcandillon) wrote : Posted in a previous version of this proposal

I tried it and it looks like just the best.

review: Approve
William Candillon (wcandillon) wrote : Posted in a previous version of this proposal

Adding David to the review, I think he found a bug.

David Graf (davidagraf) : Posted in a previous version of this proposal
review: Approve
Nicolae Brinza (nbrinza) wrote : Posted in a previous version of this proposal

I've fixed the conflict in the Changelog. Resubmitting for merging into the trunk.

Matthias Brantner (matthias-brantner) : Posted in a previous version of this proposal
review: Approve
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal
William Candillon (wcandillon) : Posted in a previous version of this proposal
review: Approve
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal

The attempt to merge lp:~nbrinza/zorba/parse-fragment into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:274 (message):
  Validation queue job parse-fragment-2012-02-23T17-50-09.456Z is finished.
  The final status was:

  1136 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

David Graf (davidagraf) : Posted in a previous version of this proposal
review: Approve
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal

Attempt to merge into lp:zorba failed due to conflicts:

text conflict in ChangeLog

Nicolae Brinza (nbrinza) wrote : Posted in a previous version of this proposal

I have fixed the regressions and the conflicts. Resubmitting.

William Candillon (wcandillon) : Posted in a previous version of this proposal
review: Approve
William Candillon (wcandillon) : Posted in a previous version of this proposal
review: Approve
Matthias Brantner (matthias-brantner) : Posted in a previous version of this proposal
review: Approve
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal

The attempt to merge lp:~nbrinza/zorba/parse-fragment into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:274 (message):
  Validation queue job parse-fragment-2012-02-29T15-41-14.921Z is finished.
  The final status was:

  1 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

David Graf (davidagraf) : Posted in a previous version of this proposal
review: Approve
Nicolae Brinza (nbrinza) wrote : Posted in a previous version of this proposal

I have added the backwards-compatible parse-xml:parse-xml-fragment() function and now the link crawler test passes ok. Resubmitting for mergeing into the trunk.

Matthias Brantner (matthias-brantner) wrote : Posted in a previous version of this proposal

I won't pass the remote queue because not all of the parameters of the old functions are documented.

review: Needs Fixing
Nicolae Brinza (nbrinza) wrote : Posted in a previous version of this proposal

Which parameters of the old functions are not documented?

Matthias Brantner (matthias-brantner) wrote : Posted in a previous version of this proposal

> Which parameters of the old functions are not documented?
Sorry, I got confused by the diff. Everything seems to be fine.

review: Approve
William Candillon (wcandillon) wrote : Posted in a previous version of this proposal

The module works nicely but the documentation needs more example:
- In the introduction
- For each function

review: Needs Fixing
Nicolae Brinza (nbrinza) wrote : Posted in a previous version of this proposal

I have merged Matthias' example and added another one. Resubmitting.

William Candillon (wcandillon) wrote : Posted in a previous version of this proposal

Looks good

review: Approve
William Candillon (wcandillon) : Posted in a previous version of this proposal
review: Approve
David Graf (davidagraf) : Posted in a previous version of this proposal
review: Approve
Nicolae Brinza (nbrinza) wrote : Posted in a previous version of this proposal

I have fixed the formatting of the code examples.

Matthias Brantner (matthias-brantner) : Posted in a previous version of this proposal
review: Approve
William Candillon (wcandillon) : Posted in a previous version of this proposal
review: Approve
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal

Attempt to merge into lp:zorba failed due to conflicts:

text conflict in ChangeLog

Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal

The attempt to merge lp:~nbrinza/zorba/parse-fragment into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:274 (message):
  Validation queue job parse-fragment-2012-03-14T15-37-11.771Z is finished.
  The final status was:

  1 tests did not succeed - changes not commited.

Error in read script: /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake

David Graf (davidagraf) : Posted in a previous version of this proposal
review: Approve
Nicolae Brinza (nbrinza) wrote : Posted in a previous version of this proposal

I have fixed the failing test, which apparently fails only in the Release build.

Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

William Candillon (wcandillon) : Posted in a previous version of this proposal
review: Approve
Matthias Brantner (matthias-brantner) : Posted in a previous version of this proposal
review: Approve
Nicolae Brinza (nbrinza) wrote : Posted in a previous version of this proposal

It seems the remote queue is stuck again, probably because I have approved it before anyone else. I'll resubmit.

review: Approve
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job parse-fragment-2012-03-16T10-27-37.083Z is finished. The final status was:

All tests succeeded!

Zorba Build Bot (zorba-buildbot) wrote :

Voting does not meet specified criteria. Required: Approve > 1, Disapprove < 1, Needs Fixing < 1, Pending < 1. Got: 1 Approve, 2 Pending.

review: Approve
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job parse-fragment-2012-03-16T12-40-35.74Z is finished. The final status was:

All tests succeeded!

Zorba Build Bot (zorba-buildbot) wrote :

Voting does not meet specified criteria. Required: Approve > 1, Disapprove < 1, Needs Fixing < 1, Pending < 1. Got: 2 Approve, 1 Pending.

Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job parse-fragment-2012-03-16T18-41-11.65Z is finished. The final status was:

All tests succeeded!

Zorba Build Bot (zorba-buildbot) wrote :

Voting does not meet specified criteria. Required: Approve > 1, Disapprove < 1, Needs Fixing < 1, Pending < 1. Got: 2 Approve, 1 Pending.

David Graf (davidagraf) :
review: Approve
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job parse-fragment-2012-03-16T21-14-18.821Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2012-03-12 20:01:39 +0000
3+++ CMakeLists.txt 2012-03-15 17:04:36 +0000
4@@ -237,11 +237,21 @@
5 MESSAGE(STATUS "Looking for LibXml2")
6 FIND_PACKAGE(LibXml2)
7 IF(LIBXML2_FOUND)
8- MESSAGE(STATUS "Found LIBXML2 library -- " ${LIBXML2_LIBRARIES})
9-
10- INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
11- SET(requiredlibs-store ${requiredlibs-store} ${LIBXML2_LIBRARIES})
12- SET(CXXFLAGS ${CXXFLAGS} ${LIBXML2_DEFINITONS})
13+ # Now check LibXml2's version
14+ FILE(STRINGS ${LIBXML2_INCLUDE_DIR}/libxml/xmlversion.h LIBXML2_VERSION_TMP REGEX
15+ "^#define[ \t]+LIBXML_DOTTED_VERSION[ \t]+\".*\"")
16+ STRING(REGEX REPLACE "^#define[ \t]+LIBXML_DOTTED_VERSION[ \t]+\"(.*)\"" "\\1"
17+ LIBXML2_VERSION ${LIBXML2_VERSION_TMP})
18+
19+ IF(LIBXML2_VERSION VERSION_EQUAL "2.7.0" OR LIBXML2_VERSION VERSION_GREATER "2.7.0")
20+ MESSAGE(STATUS "Found LIBXML2 library -- " ${LIBXML2_LIBRARIES})
21+ INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
22+ SET(requiredlibs-store ${requiredlibs-store} ${LIBXML2_LIBRARIES})
23+ SET(CXXFLAGS ${CXXFLAGS} ${LIBXML2_DEFINITONS})
24+ ELSE(LIBXML2_VERSION VERSION_EQUAL "2.7.0" OR LIBXML2_VERSION VERSION_GREATER "2.7.0")
25+ MESSAGE(FATAL_ERROR "The libxml2 library version 2.7.0 or higher is required in order to build Zorba.")
26+ ENDIF(LIBXML2_VERSION VERSION_EQUAL "2.7.0" OR LIBXML2_VERSION VERSION_GREATER "2.7.0")
27+
28 ELSE(LIBXML2_FOUND)
29 MESSAGE(FATAL_ERROR "The libxml2 library and headers are required in order to build simple store.")
30 ENDIF(LIBXML2_FOUND)
31
32=== modified file 'ChangeLog'
33--- ChangeLog 2012-03-12 20:01:39 +0000
34+++ ChangeLog 2012-03-15 17:04:36 +0000
35@@ -6,6 +6,8 @@
36 * Add --compile-plan (-c) and --execute-plan (-e) options to zorba command line.
37 * Add XQuery 3.0 concat operator (http://www.w3.org/TR/xquery-30/#id-string-concat-expr)
38 * New URI module providing percent-decoding functions.
39+ * The core parse-xml module is now able to parse input files in a streaming mode. A number of new options have also been added.
40+ * LibXml2 version 2.7.0 or higher is now required in order to build Zorba.
41 * Added index management function to the C++ api's StaticCollectionManager.
42 * Added createDayTimeDuration, createYearMonthDuration, createDocumentNode, createCommentNode, createPiNode to api's ItemFactory.
43 * Fixed bug #905050 (setting and getting the context item type via the c++ api).
44
45=== modified file 'modules/com/zorba-xquery/www/modules/CMakeLists.txt'
46--- modules/com/zorba-xquery/www/modules/CMakeLists.txt 2012-03-07 15:49:25 +0000
47+++ modules/com/zorba-xquery/www/modules/CMakeLists.txt 2012-03-15 17:04:36 +0000
48@@ -63,6 +63,8 @@
49 URI "http://www.zorba-xquery.com/modules/schema")
50 DECLARE_ZORBA_MODULE(FILE string.xq VERSION 2.1
51 URI "http://www.zorba-xquery.com/modules/string")
52+DECLARE_ZORBA_SCHEMA(FILE xml-options.xsd
53+ URI "http://www.zorba-xquery.com/modules/xml-options")
54 DECLARE_ZORBA_MODULE(FILE uri.xq VERSION 1.0
55 URI "http://www.zorba-xquery.com/modules/uri")
56 DECLARE_ZORBA_MODULE(FILE xml.xq VERSION 2.0
57
58=== added file 'modules/com/zorba-xquery/www/modules/xml-options.xsd'
59--- modules/com/zorba-xquery/www/modules/xml-options.xsd 1970-01-01 00:00:00 +0000
60+++ modules/com/zorba-xquery/www/modules/xml-options.xsd 2012-03-15 17:04:36 +0000
61@@ -0,0 +1,86 @@
62+<?xml version="1.0"?>
63+<!--
64+ - Copyright 2006-2012 The FLWOR Foundation.
65+ -
66+ - Licensed under the Apache License, Version 2.0 (the "License");
67+ - you may not use this file except in compliance with the License.
68+ - You may obtain a copy of the License at
69+ -
70+ - http://www.apache.org/licenses/LICENSE-2.0
71+ -
72+ - Unless required by applicable law or agreed to in writing, software
73+ - distributed under the License is distributed on an "AS IS" BASIS,
74+ - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
75+ - See the License for the specific language governing permissions and
76+ - limitations under the License.
77+-->
78+<schema xmlns="http://www.w3.org/2001/XMLSchema"
79+ targetNamespace="http://www.zorba-xquery.com/modules/xml-options"
80+ elementFormDefault="qualified" attributeFormDefault="qualified">
81+
82+ <element name="options">
83+ <complexType>
84+ <all>
85+
86+ <element name="base-uri" minOccurs="0" maxOccurs="1">
87+ <complexType>
88+ <attribute name="value" type="anyURI" use="required"/>
89+ </complexType>
90+ </element>
91+ <element name="no-error" minOccurs="0" maxOccurs="1">
92+ <complexType/>
93+ </element>
94+ <element name="schema-validate" minOccurs="0" maxOccurs="1">
95+ <complexType>
96+ <attribute name="mode" default="strict">
97+ <simpleType>
98+ <restriction base="string">
99+ <enumeration value="strict"/>
100+ <enumeration value="lax"/>
101+ </restriction>
102+ </simpleType>
103+ </attribute>
104+ </complexType>
105+ </element>
106+ <element name="DTD-validate" minOccurs="0" maxOccurs="1">
107+ <complexType/>
108+ </element>
109+ <element name="DTD-load" minOccurs="0" maxOccurs="1">
110+ <complexType/>
111+ </element>
112+ <element name="default-DTD-attributes" minOccurs="0" maxOccurs="1">
113+ <complexType/>
114+ </element>
115+ <element name="parse-external-parsed-entity" minOccurs="0" maxOccurs="1">
116+ <complexType>
117+ <attribute name="skip-root-nodes" use="optional">
118+ <simpleType>
119+ <restriction base="int">
120+ <minInclusive value="0"/>
121+ </restriction>
122+ </simpleType>
123+ </attribute>
124+ <attribute name="skip-top-level-text-nodes" type="boolean" use="optional"/>
125+ </complexType>
126+ </element>
127+ <element name="substitute-entities" minOccurs="0" maxOccurs="1">
128+ <complexType/>
129+ </element>
130+ <element name="xinclude-substitutions" minOccurs="0" maxOccurs="1">
131+ <complexType/>
132+ </element>
133+ <element name="remove-redundant-ns" minOccurs="0" maxOccurs="1">
134+ <complexType/>
135+ </element>
136+ <element name="no-CDATA" minOccurs="0" maxOccurs="1">
137+ <complexType/>
138+ </element>
139+ <element name="no-xinclude-nodes" minOccurs="0" maxOccurs="1">
140+ <complexType/>
141+ </element>
142+
143+ </all>
144+ </complexType>
145+ </element>
146+
147+</schema>
148
149=== modified file 'modules/com/zorba-xquery/www/modules/xml.xq' (properties changed: +x to -x)
150--- modules/com/zorba-xquery/www/modules/xml.xq 2011-08-10 02:50:23 +0000
151+++ modules/com/zorba-xquery/www/modules/xml.xq 2012-03-15 17:04:36 +0000
152@@ -1,4 +1,4 @@
153-xquery version "1.0";
154+xquery version "3.0";
155
156 (:
157 : Copyright 2006-2010 The FLWOR Foundation.
158@@ -23,13 +23,46 @@
159 : external parsed entities, described by
160 : <a href="http://www.w3.org/TR/xml/#wf-entities">XML 1.0 Well-Formed
161 : Parsed Entities</a>. The functions can also perform Schema and DTD
162- : validation of the input documents.
163+ : validation of the input documents.
164 : </p>
165 :
166+ : <p>The following example parses a sequence of XML elements and returns
167+ : them in a streaming fashion - each at a time:</p>
168+ :
169+ : <pre class="brush: xquery;">
170+ : import module namespace parse-xml = "http://www.zorba-xquery.com/modules/xml";
171+ : import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
172+ : parse-xml:parse(
173+ : "&lt;from1>Jani&lt;/from1>&lt;from2>Jani&lt;/from2>&lt;from3>Jani&lt;/from3>",
174+ : &lt;opt:options>
175+ : &lt;opt:parse-external-parsed-entity/>
176+ : &lt;/opt:options>
177+ : )
178+ : </pre>
179+ :
180+ : <p>Another useful option allows to skip an arbitrary number of levels
181+ : before returning a sequence of nodes as shown in the following example:</p>
182+ :
183+ : <pre class="brush: xquery;">
184+ : import module namespace parse-xml = "http://www.zorba-xquery.com/modules/xml";
185+ : import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
186+ : parse-xml:parse(
187+ : "&lt;root>
188+ : &lt;from1>Jani1&lt;/from1>
189+ : &lt;from2>Jani2&lt;/from2>
190+ : &lt;from3>Jani3&lt;/from3>
191+ : &lt;/root>",
192+ : &lt;opt:options>
193+ : &lt;opt:parse-external-parsed-entity opt:skip-root-nodes="1"/>
194+ : &lt;/opt:options>
195+ : )
196+ : </pre>
197+ :
198 : @see <a href="http://www.w3.org/TR/xml/#wf-entities">XML 1.0 Well-Formed
199 : Parsed Entities</a>
200 : @see <a href="http://www.w3.org/TR/xpath-functions-30/#func-parse-xml">
201 : fn:parse-xml() function in XPath and XQuery Functions and Operators 3.0</a>
202+ : @see <a href="http://xmlsoft.org/html/libxml-parser.html">LibXml2 parser</a>
203 :
204 : @author Nicolae Brinza
205 : @project data processing/data converters
206@@ -37,6 +70,8 @@
207 :)
208 module namespace parse-xml = "http://www.zorba-xquery.com/modules/xml";
209
210+import schema namespace parse-xml-options = "http://www.zorba-xquery.com/modules/xml-options";
211+
212 declare namespace zerr = "http://www.zorba-xquery.com/errors";
213 declare namespace err = "http://www.w3.org/xqt-errors";
214
215@@ -48,6 +83,159 @@
216 : A function to parse XML files and fragments (i.e.
217 : <a href="http://www.w3.org/TR/xml/#wf-entities">external general parsed
218 : entities</a>). The functions takes two arguments: the first one is the
219+ : string to be parsed and the second argument is an &lt;options/&gt; element that
220+ : passes a list of options to the parsing function. They are described below.
221+ : The options element must conform to the xml-options.xsd schema. Some of these
222+ : will be passed to the underlying library (LibXml2) and further documentation
223+ : for them can be found at <a href="http://xmlsoft.org/html/libxml-parser.html">
224+ : LibXml2 parser</a>.
225+ :
226+ : The list of available options:
227+ :
228+ : <ul>
229+ : <li>
230+ : &lt;base-uri/&gt; - the element must have a "value" attribute, which will provide
231+ : the baseURI that will be used as the baseURI for every node returned by this
232+ : function.
233+ : </li>
234+ :
235+ : <li>
236+ : &lt;no-error/&gt; - if present, the option will disable fatal error processing. Any
237+ : failure to parse or validate the input in the requested manner will result
238+ : in the function returning an empty sequence and no error will raised.
239+ : </li>
240+ :
241+ : <li>
242+ : &lt;schema-validate/&gt; - if present, it will request that the input string be Schema
243+ : validated. The element accepts an attribute named "mode" which can have two
244+ : values: "strict and "lax". Enabling the option will produce a result that is
245+ : equivalent to processing the input with the option disabled, and then copying
246+ : the result using the XQuery "validate strict|lax" expression. This option can not
247+ : be used together with either the &lt;DTD-validate/&gt; or the &lt;parse-external-parsed-entity/&gt;
248+ : option. Doing so will raise a zerr:ZXQD0003 error.
249+ : </li>
250+ :
251+ : <li>
252+ : &lt;DTD-validate/&gt; - the option will enable the DTD-based validation. If this
253+ : option is enabled and the input references a DTD, then the input must be a
254+ : well-formed and DTD-valid XML document. The &lt;DTD-load/&gt; option must be used for
255+ : external DTD files to be loaded. If the option is enabled and the input does
256+ : not reference a DTD then the option is ignored. If the option is disabled, the
257+ : input is not required to reference a DTD and if it does reference a DTD then
258+ : the DTD is ignored for validation purposes. This option can not
259+ : be used together with either the &lt;schema-validate/&gt; or the &lt;parse-external-parsed-entity&gt;
260+ : option. Doing so will raise a zerr:ZXQD0003 error.
261+ : </li>
262+ :
263+ : <li>
264+ : &lt;DTD-load/&gt; - if present, it will enable loading of external DTD files.
265+ : </li>
266+ :
267+ : <li>
268+ : &lt;default-DTD-attributes/&gt; - if present, it will enable the default DTD attributes.
269+ : </li>
270+ :
271+ : <li>
272+ : &lt;parse-external-parsed-entity/&gt; - if present, it will enable the processing of XML
273+ : external entities. If the option
274+ : is enabled, the input must conform to the syntax extParsedEnt (production
275+ : [78] in XML 1.0, see <a href="http://www.w3.org/TR/xml/#wf-entities">
276+ : Well-Formed Parsed Entities</a>). The result of the function call is a list
277+ : of nodes corresponding to the top-level components of the content of the
278+ : external entity: that is, elements, processing instructions, comments, and
279+ : text nodes. CDATA sections and character references are expanded, and
280+ : adjacent characters are merged so the result contains no adjacent text
281+ : nodes. If the option is disabled, the input must be a well-formed XML
282+ : document conforming to the Document production
283+ : (<a href="http://www.w3.org/TR/xml/#sec-well-formed">production [1] in XML 1.0</a>).
284+ : This option can not be used together with either the &lt;schema-validate/&gt; or the &lt;DTD-validate/&gt;
285+ : option. Doing so will raise a zerr:ZXQD0003 error.
286+ : The &lt;parse-external-parsed-entity/&gt; option has two parameters, given by attributes. The first
287+ : attribute is "skip-root-nodes" and it can have a non-negative value. Specifying the paramter
288+ : tells the parser to skip the given number of root nodes and return only their children. E.g.
289+ : skip-root-nodes="1" is equivalent to parse-xml($xml-string)/node()/node() . skip-root-nodes="2" is equivalent
290+ : to parse-xml($xml-string)/node()/node()/node() , etc. The second attribute is "skip-top-level-text-nodes" with a
291+ : boolean value. Specifying "true" will tell the parser to skip top level text nodes, returning
292+ : only the top level elements, comments, PIs, etc. This parameter works in combination with
293+ : the "skip-root-nodes" paramter, thus top level text nodes are skipped after "skip-root-nodes" has
294+ : been applied.
295+ : </li>
296+ :
297+ : <li>
298+ : &lt;substitute-entities/&gt; - if present, it will enable the XML entities substitutions.
299+ : </li>
300+ :
301+ : <li>
302+ : &lt;remove-redundant-ns/&gt; - if present, the parser will remove redundant namespaces declarations.
303+ : </li>
304+ :
305+ : <li>
306+ : &lt;no-CDATA/&gt; - if present, the parser will merge CDATA nodes as text nodes.
307+ : </li>
308+ :
309+ : <li>
310+ : &lt;xinclude-substitutions/&gt; - if present, it will enable the XInclude substitutions.
311+ : </li>
312+ :
313+ : <li>
314+ : &lt;no-xinclude-nodes/&gt; - if present, the parser will not generate XInclude START/END nodes.
315+ : </li>
316+ :
317+ : </ul>
318+ :
319+ : <p>
320+ : An example that sets the base-uri of the parsed external entities:
321+ : </p>
322+ : <pre class="brush: xquery;">
323+ : import module namespace parse-xml = "http://www.zorba-xquery.com/modules/xml";
324+ : import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
325+ : parse-xml:parse("&lt;from1>Jani&lt;/from1>&lt;from2>Jani&lt;/from2>&lt;from3>Jani&lt;/from3>",
326+ : &lt;opt:options>
327+ : &lt;opt:base-uri opt:value="urn:test"/>
328+ : &lt;opt:parse-external-parsed-entity/>
329+ : &lt;/opt:options>
330+ : )
331+ : </pre>
332+ :
333+ : @param $xml-string The string that holds the XML to be parsed. If empty,
334+ : the function will return an empty sequence
335+ : @param $options The options for the parsing
336+ : @return The parsed XML as a document node or a list of nodes, or an empty
337+ : sequence.
338+ :
339+ : @error zerr:ZXQD0003 The error will be raised if the options to the function
340+ : are inconsistent.
341+ :
342+ : @error err:FODC0006 The error will be raised if the input string is not a
343+ : valid XML document or fragment (external general parsed
344+ : entity) or if DTD validation was enabled and the
345+ : document has not passed it.
346+ :
347+ : @error err:XQDY0027 The error will be raised if schema validation was enabled
348+ : and the input document has not passed it or if the parsing options are not
349+ : conformant to the xml-options.xsd schema.
350+ :
351+ :
352+ :
353+ : @example test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-03.xq
354+ : @example test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-01.xq
355+ : @example test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-07.xq
356+ :
357+ :)
358+declare function parse-xml:parse(
359+ $xml-string as xs:string?,
360+ $options as element()?) as node()* external;
361+
362+
363+(:~
364+ : <br/><p>
365+ : Note: this function is included for backwards compatibility purposes. It
366+ : is recommended that you use the parse-xml:parse() function instead.
367+ : </p><br/>
368+ :
369+ : A function to parse XML files and fragments (i.e.
370+ : <a href="http://www.w3.org/TR/xml/#wf-entities">external general parsed
371+ : entities</a>). The functions takes two arguments: the first one is the
372 : string to be parsed and the second argument is a flags string
373 : (eEdDsSlLwWfF]*(;[\p{L}]*)?) selecting the options described below.
374 : <br/>
375@@ -136,10 +324,35 @@
376 :)
377 declare function parse-xml:parse-xml-fragment(
378 $xml-string as xs:string?,
379- $options as xs:string) as node()* external;
380+ $options as xs:string) as node()*
381+{
382+ let $new_options := <parse-xml-options:options>{
383+ if (contains($options, "e"))
384+ then <parse-xml-options:parse-external-parsed-entity/> else (),
385+ if (contains($options, "d"))
386+ then <parse-xml-options:DTD-validate/> else (),
387+ if (contains($options, "s"))
388+ then <parse-xml-options:schema-validate parse-xml-options:mode="strict"/>
389+ else (),
390+ if (contains($options, "l"))
391+ then <parse-xml-options:schema-validate parse-xml-options:mode="lax"/>
392+ else (),
393+ if (contains($options, "w"))
394+ then <parse-xml-options:strip-boundary-space/> else (),
395+ if (contains($options, "f"))
396+ then <parse-xml-options:no-error/> else ()
397+ }</parse-xml-options:options>
398+ return
399+ parse-xml:parse($xml-string, $new_options)
400+};
401
402
403 (:~
404+ : <br/><p>
405+ : Note: this function is included for backwards compatibility purposes. It
406+ : is recommended that you use the parse-xml:parse() function instead.
407+ : </p><br/>
408+ :
409 : A function to parse XML files and fragments. The behavior is the
410 : same as the parse-xml-fragment with two arguments.
411 :
412@@ -169,4 +382,27 @@
413 declare function parse-xml:parse-xml-fragment(
414 $xml-string as xs:string?,
415 $base-uri as xs:string,
416- $options as xs:string) as node()* external;
417+ $options as xs:string) as node()*
418+{
419+ let $new_options := <parse-xml-options:options>{
420+ if (contains($options, "e"))
421+ then <parse-xml-options:parse-external-parsed-entity/> else (),
422+ if (contains($options, "d"))
423+ then <parse-xml-options:DTD-validate/> else (),
424+ if (contains($options, "s"))
425+ then <parse-xml-options:schema-validate parse-xml-options:mode="strict"/>
426+ else (),
427+ if (contains($options, "l"))
428+ then <parse-xml-options:schema-validate parse-xml-options:mode="lax"/>
429+ else (),
430+ if (contains($options, "w"))
431+ then <parse-xml-options:strip-boundary-space/> else (),
432+ if (contains($options, "f"))
433+ then <parse-xml-options:no-error/> else (),
434+ <parse-xml-options:base-uri>{
435+ attribute{xs:QName("parse-xml-options:value")}{$base-uri}}
436+ </parse-xml-options:base-uri>
437+ }</parse-xml-options:options>
438+ return
439+ parse-xml:parse($xml-string, $new_options)
440+};
441
442=== modified file 'src/api/annotationimpl.cpp' (properties changed: +x to -x)
443=== modified file 'src/api/xmldatamanagerimpl.cpp'
444--- src/api/xmldatamanagerimpl.cpp 2012-01-23 10:06:24 +0000
445+++ src/api/xmldatamanagerimpl.cpp 2012-03-15 17:04:36 +0000
446@@ -75,7 +75,7 @@
447
448 ********************************************************************************/
449 XmlDataManagerImpl::XmlDataManagerImpl()
450- :
451+ :
452 theDocManager(0),
453 theColManager(0),
454 theW3CColManager(0)
455@@ -126,7 +126,9 @@
456 std::ostringstream lProlog;
457 lProlog
458 << "import module namespace d = '" << static_context::ZORBA_FETCH_FN_NS << "';"
459- << "import module namespace x = '" << static_context::ZORBA_XML_FN_NS << "';";
460+ << "import module namespace x = '" << static_context::ZORBA_XML_FN_NS << "';"
461+ << "import schema namespace opt = '" << static_context::ZORBA_XML_FN_OPTIONS_NS << "';";
462+
463 theContext->loadProlog(lProlog.str(), lHints);
464 }
465
466@@ -151,7 +153,7 @@
467 DocumentManager*
468 XmlDataManagerImpl::getDocumentManager() const
469 {
470- if (!theDocManager)
471+ if (!theDocManager)
472 {
473 theDocManager = new DocumentManagerImpl(theContext, theFactory);
474 theDocManager->registerDiagnosticHandler(theDiagnosticHandler);
475@@ -166,7 +168,7 @@
476 CollectionManager*
477 XmlDataManagerImpl::getCollectionManager() const
478 {
479- if (!theColManager)
480+ if (!theColManager)
481 {
482 theColManager = new CollectionManagerImpl(
483 theContext,
484@@ -185,7 +187,7 @@
485 CollectionManager*
486 XmlDataManagerImpl::getW3CCollectionManager() const
487 {
488- if (!theW3CColManager)
489+ if (!theW3CColManager)
490 {
491 theW3CColManager = new CollectionManagerImpl(
492 theContext,
493@@ -280,21 +282,34 @@
494 ZORBA_DM_TRY
495 {
496 Item lQName = theFactory->createQName(static_context::ZORBA_XML_FN_NS,
497- "parse-xml-fragment");
498+ "parse");
499
500 // create a streamable string item
501 std::vector<ItemSequence_t> lArgs;
502- lArgs.push_back(
503- new SingletonItemSequence(theFactory->createStreamableString(aStream,
504- &streamReleaser)));
505-
506- std::ostringstream lOptions;
507- lOptions << (aOptions.isDtdValidationEnabled()?"d":"D");
508-
509- lOptions << (aOptions.isExternalEntityProcessingEnabled()?"e":"E");
510-
511- lArgs.push_back(
512- new SingletonItemSequence(theFactory->createString(lOptions.str())));
513+ lArgs.push_back(new SingletonItemSequence(
514+ theFactory->createStreamableString(aStream, &streamReleaser)));
515+
516+ Item empty_item;
517+ Item validated_options;
518+ NsBindings nsPairs;
519+ Item untyped_type = theFactory->createQName("http://www.w3.org/2001/XMLSchema", "xs", "untyped");
520+ Item options_node = theFactory->createElementNode(empty_item,
521+ theFactory->createQName(static_context::ZORBA_XML_FN_OPTIONS_NS, "options"),
522+ untyped_type, false, false, nsPairs);
523+
524+ if (aOptions.isDtdValidationEnabled())
525+ theFactory->createElementNode(options_node,
526+ theFactory->createQName(static_context::ZORBA_XML_FN_OPTIONS_NS, "DTD-validate"),
527+ untyped_type, false, false, nsPairs);
528+
529+ if (aOptions.isExternalEntityProcessingEnabled())
530+ theFactory->createElementNode(options_node,
531+ theFactory->createQName(static_context::ZORBA_XML_FN_OPTIONS_NS, "parse-external-parsed-entity"),
532+ untyped_type, false, false, nsPairs);
533+
534+ theContext->validate(options_node, validated_options, validate_strict);
535+
536+ lArgs.push_back(new SingletonItemSequence(validated_options));
537
538 return theContext->invoke(lQName, lArgs);
539 }
540@@ -315,23 +330,42 @@
541 ZORBA_DM_TRY
542 {
543 Item lQName = theFactory->createQName(static_context::ZORBA_XML_FN_NS,
544- "parse-xml-fragment");
545+ "parse");
546
547 // create a streamable string item
548 std::vector<ItemSequence_t> lArgs;
549- lArgs.push_back(
550- new SingletonItemSequence(theFactory->createStreamableString(aStream,
551- &streamReleaser)));
552- lArgs.push_back(
553- new SingletonItemSequence(theFactory->createString(aBaseURI)));
554-
555- std::ostringstream lOptions;
556- lOptions << (aOptions.isDtdValidationEnabled()?"d":"D");
557-
558- lOptions << (aOptions.isExternalEntityProcessingEnabled()?"e":"E");
559-
560- lArgs.push_back(
561- new SingletonItemSequence(theFactory->createString(lOptions.str())));
562+ lArgs.push_back(new SingletonItemSequence(
563+ theFactory->createStreamableString(aStream, &streamReleaser)));
564+
565+ Item empty_item;
566+ Item validated_options;
567+ NsBindings nsPairs;
568+ Item untyped_type = theFactory->createQName("http://www.w3.org/2001/XMLSchema", "xs", "untyped");
569+ Item options_node = theFactory->createElementNode(empty_item,
570+ theFactory->createQName(static_context::ZORBA_XML_FN_OPTIONS_NS, "options"),
571+ untyped_type, false, false, nsPairs);
572+
573+ if (aOptions.isDtdValidationEnabled())
574+ theFactory->createElementNode(options_node,
575+ theFactory->createQName(static_context::ZORBA_XML_FN_OPTIONS_NS, "DTD-validate"),
576+ untyped_type, false, false, nsPairs);
577+
578+ if (aOptions.isExternalEntityProcessingEnabled())
579+ theFactory->createElementNode(options_node,
580+ theFactory->createQName(static_context::ZORBA_XML_FN_OPTIONS_NS, "parse-external-parsed-entity"),
581+ untyped_type, false, false, nsPairs);
582+
583+ Item base_uri_node = theFactory->createElementNode(options_node,
584+ theFactory->createQName(static_context::ZORBA_XML_FN_OPTIONS_NS, "base-uri"),
585+ untyped_type, false, false, nsPairs);
586+ theFactory->createAttributeNode(base_uri_node,
587+ theFactory->createQName(static_context::ZORBA_XML_FN_OPTIONS_NS, "value"),
588+ Item(),
589+ theFactory->createString(aBaseURI));
590+
591+ theContext->validate(options_node, validated_options, validate_strict);
592+
593+ lArgs.push_back(new SingletonItemSequence(validated_options));
594
595 return theContext->invoke(lQName, lArgs);
596 }
597@@ -382,15 +416,15 @@
598 theDiagnosticHandler = aDiagnosticHandler;
599 theUserDiagnosticHandler = true;
600
601- if (theColManager)
602+ if (theColManager)
603 {
604 theColManager->registerDiagnosticHandler(theDiagnosticHandler);
605 }
606- if (theDocManager)
607+ if (theDocManager)
608 {
609 theDocManager->registerDiagnosticHandler(theDiagnosticHandler);
610 }
611- if (theW3CColManager)
612+ if (theW3CColManager)
613 {
614 theW3CColManager->registerDiagnosticHandler(theDiagnosticHandler);
615 }
616@@ -400,17 +434,17 @@
617 /*******************************************************************************
618
619 ********************************************************************************/
620-void XmlDataManagerImpl::registerStemmerProvider(StemmerProvider const *p)
621+void XmlDataManagerImpl::registerStemmerProvider(StemmerProvider const *p)
622 {
623 SYNC_CODE(AutoLatch lock(theLatch, Latch::WRITE);)
624- if ( theStemmerProviderWrapper )
625+ if ( theStemmerProviderWrapper )
626 {
627 if ( theStemmerProviderWrapper->get_provider() == p )
628 return;
629 delete theStemmerProviderWrapper;
630 theStemmerProviderWrapper = nullptr;
631 }
632- if ( p )
633+ if ( p )
634 {
635 theStemmerProviderWrapper = new internal::StemmerProviderWrapper( p );
636 theStore->setStemmerProvider( theStemmerProviderWrapper );
637@@ -421,7 +455,7 @@
638 /*******************************************************************************
639
640 ********************************************************************************/
641-void XmlDataManagerImpl::registerTokenizerProvider(TokenizerProvider const *p)
642+void XmlDataManagerImpl::registerTokenizerProvider(TokenizerProvider const *p)
643 {
644 SYNC_CODE(AutoLatch lock(theLatch, Latch::WRITE);)
645 theStore->setTokenizerProvider( p );
646
647=== modified file 'src/context/static_context.cpp'
648--- src/context/static_context.cpp 2012-03-07 15:49:25 +0000
649+++ src/context/static_context.cpp 2012-03-15 17:04:36 +0000
650@@ -273,11 +273,11 @@
651 static_context::W3C_XML_NS = "http://www.w3.org/XML/1998/namespace";
652
653 const char*
654-static_context::ZORBA_MATH_FN_NS =
655+static_context::ZORBA_MATH_FN_NS =
656 "http://www.zorba-xquery.com/modules/math";
657
658 const char*
659-static_context::ZORBA_BASE64_FN_NS =
660+static_context::ZORBA_BASE64_FN_NS =
661 "http://www.zorba-xquery.com/modules/converters/base64";
662
663
664@@ -286,11 +286,11 @@
665 "http://www.zorba-xquery.com/modules/converters/json";
666
667 const char*
668-static_context::ZORBA_NODEREF_FN_NS =
669+static_context::ZORBA_NODEREF_FN_NS =
670 "http://www.zorba-xquery.com/modules/node-reference";
671
672 const char*
673-static_context::ZORBA_NODEPOS_FN_NS =
674+static_context::ZORBA_NODEPOS_FN_NS =
675 "http://www.zorba-xquery.com/modules/node-position";
676
677 const char*
678@@ -298,121 +298,126 @@
679 "http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl";
680
681 const char*
682-static_context::ZORBA_STORE_DYNAMIC_COLLECTIONS_DML_FN_NS =
683+static_context::ZORBA_STORE_DYNAMIC_COLLECTIONS_DML_FN_NS =
684 "http://www.zorba-xquery.com/modules/store/dynamic/collections/dml";
685
686 const char*
687-static_context::ZORBA_STORE_STATIC_COLLECTIONS_DDL_FN_NS =
688+static_context::ZORBA_STORE_STATIC_COLLECTIONS_DDL_FN_NS =
689 "http://www.zorba-xquery.com/modules/store/static/collections/ddl";
690
691 const char*
692-static_context::ZORBA_STORE_STATIC_COLLECTIONS_DML_FN_NS =
693+static_context::ZORBA_STORE_STATIC_COLLECTIONS_DML_FN_NS =
694 "http://www.zorba-xquery.com/modules/store/static/collections/dml";
695
696 const char*
697-static_context::ZORBA_STORE_STATIC_INDEXES_DDL_FN_NS =
698+static_context::ZORBA_STORE_STATIC_INDEXES_DDL_FN_NS =
699 "http://www.zorba-xquery.com/modules/store/static/indexes/ddl";
700
701 const char*
702-static_context::ZORBA_STORE_STATIC_INDEXES_DML_FN_NS =
703+static_context::ZORBA_STORE_STATIC_INDEXES_DML_FN_NS =
704 "http://www.zorba-xquery.com/modules/store/static/indexes/dml";
705
706 const char*
707-static_context::ZORBA_STORE_STATIC_INTEGRITY_CONSTRAINTS_DDL_FN_NS =
708+static_context::ZORBA_STORE_STATIC_INTEGRITY_CONSTRAINTS_DDL_FN_NS =
709 "http://www.zorba-xquery.com/modules/store/static/integrity_constraints/ddl";
710
711 const char*
712-static_context::ZORBA_STORE_STATIC_INTEGRITY_CONSTRAINTS_DML_FN_NS =
713+static_context::ZORBA_STORE_STATIC_INTEGRITY_CONSTRAINTS_DML_FN_NS =
714 "http://www.zorba-xquery.com/modules/store/static/integrity_constraints/dml";
715
716 const char*
717-static_context::ZORBA_STORE_DYNAMIC_DOCUMENTS_FN_NS =
718+static_context::ZORBA_STORE_DYNAMIC_DOCUMENTS_FN_NS =
719 "http://www.zorba-xquery.com/modules/store/dynamic/documents";
720
721 const char*
722-static_context::ZORBA_STORE_DYNAMIC_UNORDERED_MAP_FN_NS =
723+static_context::ZORBA_STORE_DYNAMIC_UNORDERED_MAP_FN_NS =
724 "http://www.zorba-xquery.com/modules/store/data-structures/unordered-map";
725
726 const char*
727-static_context::ZORBA_SCHEMA_FN_NS =
728+static_context::ZORBA_SCHEMA_FN_NS =
729 "http://www.zorba-xquery.com/modules/schema";
730
731 const char*
732-static_context::ZORBA_XQDOC_FN_NS =
733+static_context::ZORBA_XQDOC_FN_NS =
734 "http://www.zorba-xquery.com/modules/xqdoc";
735
736 const char*
737-static_context::ZORBA_RANDOM_FN_NS =
738+static_context::ZORBA_RANDOM_FN_NS =
739 "http://www.zorba-xquery.com/modules/random";
740
741 const char*
742-static_context::ZORBA_INTROSP_SCTX_FN_NS =
743+static_context::ZORBA_INTROSP_SCTX_FN_NS =
744 "http://www.zorba-xquery.com/modules/introspection/sctx";
745
746 const char*
747-static_context::ZORBA_REFLECTION_FN_NS =
748+static_context::ZORBA_REFLECTION_FN_NS =
749 "http://www.zorba-xquery.com/modules/reflection";
750
751 const char*
752-static_context::ZORBA_UTIL_FN_NS =
753+static_context::ZORBA_UTIL_FN_NS =
754 "http://www.zorba-xquery.com/zorba/util-functions";
755
756 const char*
757-static_context::ZORBA_SCRIPTING_FN_NS =
758+static_context::ZORBA_SCRIPTING_FN_NS =
759 "http://www.zorba-xquery.com/zorba/scripting";
760
761 const char*
762-static_context::ZORBA_STRING_FN_NS =
763+static_context::ZORBA_STRING_FN_NS =
764 "http://www.zorba-xquery.com/modules/string";
765
766 const char*
767-static_context::ZORBA_URI_FN_NS =
768+static_context::ZORBA_URI_FN_NS =
769 "http://www.zorba-xquery.com/modules/uri";
770
771 const char*
772-static_context::ZORBA_FETCH_FN_NS =
773+static_context::ZORBA_FETCH_FN_NS =
774 "http://www.zorba-xquery.com/modules/fetch";
775
776 const char*
777-static_context::ZORBA_NODE_FN_NS =
778+static_context::ZORBA_NODE_FN_NS =
779 "http://www.zorba-xquery.com/modules/node";
780
781 const char*
782-static_context::ZORBA_XML_FN_NS =
783+static_context::ZORBA_XML_FN_NS =
784 "http://www.zorba-xquery.com/modules/xml";
785
786+const char*
787+static_context::ZORBA_XML_FN_OPTIONS_NS =
788+"http://www.zorba-xquery.com/modules/xml-options";
789+
790+
791 /***************************************************************************//**
792 Target namespaces of zorba reserved modules
793 ********************************************************************************/
794 const char*
795-static_context::XQUERY_OP_NS =
796+static_context::XQUERY_OP_NS =
797 "http://www.zorba-xquery.com/internal/xquery-ops";
798
799 const char*
800-static_context::ZORBA_OP_NS =
801+static_context::ZORBA_OP_NS =
802 "http://www.zorba-xquery.com/internal/zorba-ops";
803
804 /***************************************************************************//**
805 Options-related namespaces
806 ********************************************************************************/
807-const char*
808-static_context::ZORBA_OPTIONS_NS =
809+const char*
810+static_context::ZORBA_OPTIONS_NS =
811 "http://www.zorba-xquery.com/options";
812
813-const char*
814-static_context::ZORBA_OPTION_WARN_NS =
815+const char*
816+static_context::ZORBA_OPTION_WARN_NS =
817 "http://www.zorba-xquery.com/options/warnings";
818
819-const char*
820-static_context::ZORBA_OPTION_FEATURE_NS =
821+const char*
822+static_context::ZORBA_OPTION_FEATURE_NS =
823 "http://www.zorba-xquery.com/options/features";
824
825-const char*
826-static_context::ZORBA_OPTION_OPTIM_NS =
827+const char*
828+static_context::ZORBA_OPTION_OPTIM_NS =
829 "http://www.zorba-xquery.com/options/optimizer";
830
831-const char*
832-static_context::ZORBA_VERSIONING_NS =
833+const char*
834+static_context::ZORBA_VERSIONING_NS =
835 "http://www.zorba-xquery.com/options/versioning";
836
837
838@@ -450,7 +455,7 @@
839 ns == ZORBA_FETCH_FN_NS ||
840 ns == ZORBA_NODE_FN_NS ||
841 ns == ZORBA_XML_FN_NS);
842- }
843+ }
844 else if (ns == W3C_FN_NS || ns == XQUERY_MATH_FN_NS)
845 {
846 return true;
847@@ -496,7 +501,8 @@
848 ns == ZORBA_STRING_FN_NS ||
849 ns == ZORBA_JSON_FN_NS ||
850 ns == ZORBA_URI_FN_NS ||
851- ns == ZORBA_RANDOM_FN_NS);
852+ ns == ZORBA_RANDOM_FN_NS ||
853+ ns == ZORBA_XML_FN_NS);
854 }
855
856 return false;
857@@ -527,7 +533,7 @@
858 if (lVarName == static_context::DOT_POS_VAR_NAME)
859 {
860 lVarName = "context position";
861- }
862+ }
863 else if (lVarName == static_context::DOT_SIZE_VAR_NAME)
864 {
865 lVarName = "context size";
866@@ -715,7 +721,7 @@
867
868 if (theVariablesMap)
869 delete theVariablesMap;
870-
871+
872 if (theImportedPrivateVariablesMap)
873 delete theImportedPrivateVariablesMap;
874
875@@ -963,7 +969,7 @@
876 ar & theContextItemType;
877
878 ar & theVariablesMap;
879- ar & theImportedPrivateVariablesMap;
880+ ar & theImportedPrivateVariablesMap;
881
882 ar.set_serialize_only_for_eval(true);
883 ar & theFunctionMap;
884@@ -1464,7 +1470,7 @@
885
886 ********************************************************************************/
887 std::auto_ptr<internal::Resource> static_context::resolve_uri(
888- zstring const& aUri,
889+ zstring const& aUri,
890 internal::EntityData::Kind aEntityKind,
891 zstring& oErrorMessage) const
892 {
893@@ -1496,7 +1502,7 @@
894 internal::EntityData const lData(aEntityKind);
895
896 apply_uri_mappers(aUri, &lData, internal::URIMapper::COMPONENT, oComponents);
897- if (oComponents.size() == 0)
898+ if (oComponents.size() == 0)
899 {
900 oComponents.push_back(aUri);
901 }
902@@ -1507,9 +1513,9 @@
903
904 ********************************************************************************/
905 void static_context::apply_uri_mappers(
906- zstring const& aUri,
907+ zstring const& aUri,
908 internal::EntityData const* aEntityData,
909- internal::URIMapper::Kind aMapperKind,
910+ internal::URIMapper::Kind aMapperKind,
911 std::vector<zstring>& oUris) const
912 {
913 // Initialize list with the one input URI.
914@@ -1525,7 +1531,7 @@
915 mapper != sctx->theURIMappers.end(); mapper++)
916 {
917 // Only call mappers of the appropriate kind
918- if ((*mapper)->mapperKind() != aMapperKind)
919+ if ((*mapper)->mapperKind() != aMapperKind)
920 {
921 continue;
922 }
923@@ -1541,16 +1547,16 @@
924 size_t const lPreNumResultUris = lResultUris.size();
925 (*mapper)->mapURI(*uri, aEntityData, *this, lResultUris);
926 size_t const lPostNumResultUris = lResultUris.size();
927- if (lPreNumResultUris == lPostNumResultUris)
928+ if (lPreNumResultUris == lPostNumResultUris)
929 {
930 // Mapper didn't map this URI to anything new, therefore add
931 // the original URI to the result list
932 lResultUris.push_back(*uri);
933 }
934- else
935+ else
936 {
937 // Check the new entries for DENY_ACCESS.
938- for (size_t i = lPreNumResultUris; i < lPostNumResultUris; i++)
939+ for (size_t i = lPreNumResultUris; i < lPostNumResultUris; i++)
940 {
941 if (lResultUris.at(i) == internal::URIMapper::DENY_ACCESS) {
942 throw XQUERY_EXCEPTION(zerr::ZXQP0029_URI_ACCESS_DENIED,
943@@ -1574,14 +1580,14 @@
944 void static_context::apply_url_resolvers(
945 std::vector<zstring>& aUrls,
946 internal::EntityData const* aEntityData,
947- std::auto_ptr<internal::Resource>& oResource,
948+ std::auto_ptr<internal::Resource>& oResource,
949 zstring& oErrorMessage) const
950 {
951 oErrorMessage = "";
952
953 // Iterate through all candidate URLs...
954 for (std::vector<zstring>::iterator url = aUrls.begin();
955- url != aUrls.end(); url++)
956+ url != aUrls.end(); url++)
957 {
958 // We should never try to load the http-client module using its original URI,
959 // because that URI starts with http:, so we'll try to load the http-client
960@@ -1600,7 +1606,7 @@
961 sctx->theURLResolvers.begin();
962 resolver != sctx->theURLResolvers.end(); resolver++)
963 {
964- try
965+ try
966 {
967 // Take ownership of returned Resource (if any)
968 oResource.reset((*resolver)->resolveURL(*url, aEntityData));
969@@ -1611,15 +1617,15 @@
970 return;
971 }
972 }
973- catch (const std::exception& e)
974+ catch (const std::exception& e)
975 {
976- if (oErrorMessage == "")
977+ if (oErrorMessage == "")
978 {
979 // Really no point in saving anything more than the first message
980 oErrorMessage = e.what();
981 }
982 }
983- catch (...)
984+ catch (...)
985 {
986 // Not much we can do here except try the rest of the
987 // candidate URIs
988@@ -2169,7 +2175,7 @@
989 {
990 if (externalVarsOnly)
991 {
992- if((*ite).second->is_external())
993+ if((*ite).second->is_external())
994 vars.push_back((*ite).second);
995 }
996 else
997@@ -2179,7 +2185,7 @@
998 }
999 }
1000 }
1001-
1002+
1003 if (returnPrivateVars && sctx->theImportedPrivateVariablesMap != NULL)
1004 {
1005 VariableMap::iterator ite = sctx->theImportedPrivateVariablesMap->begin();
1006@@ -2199,7 +2205,7 @@
1007 {
1008 if(externalVarsOnly)
1009 {
1010- if((*ite).second->is_external())
1011+ if((*ite).second->is_external())
1012 vars.push_back((*ite).second);
1013 }
1014 else
1015@@ -3220,11 +3226,11 @@
1016 PrologOption option(qname, value);
1017
1018 store::Item* qname2 = option.theName.getp();
1019-
1020+
1021 zstring lNamespace = qname2->getNamespace();
1022
1023 // If option namespace starts with zorba options namespace
1024- if ( lNamespace.find(ZORBA_OPTIONS_NS) == 0 )
1025+ if ( lNamespace.find(ZORBA_OPTIONS_NS) == 0 )
1026 {
1027 zstring lLocalName = qname2->getLocalName();
1028
1029@@ -3239,7 +3245,7 @@
1030 process_feature_option(lVal1, lLocalName == "enable", loc);
1031 lCommaFound = true;
1032 }
1033- process_feature_option(lCommaFound ? lVal2 : lVal1,
1034+ process_feature_option(lCommaFound ? lVal2 : lVal1,
1035 lLocalName == "enable",
1036 loc);
1037 }
1038@@ -3254,7 +3260,7 @@
1039 process_optim_option(lVal1, lLocalName == "enable", loc);
1040 lCommaFound = true;
1041 }
1042- process_optim_option(lCommaFound ? lVal2 : lVal1,
1043+ process_optim_option(lCommaFound ? lVal2 : lVal1,
1044 lLocalName == "enable",
1045 loc);
1046 }
1047@@ -3282,7 +3288,7 @@
1048 // Re-use "ModuleVersion" class since it does 98% of the work for us;
1049 // just use a fake URI
1050 ModuleVersion lOptVersion(zstring(ZORBA_VERSIONING_NS) + "/corezorba", value);
1051- if (! lOptVersion.is_valid_version())
1052+ if (! lOptVersion.is_valid_version())
1053 {
1054 RAISE_ERROR(zerr::ZXQP0039_INVALID_VERSION_SPECIFICATION, loc,
1055 ERROR_PARAMS(value));
1056@@ -3291,7 +3297,7 @@
1057 ModuleVersion lZorbaVersion(zstring(ZORBA_VERSIONING_NS) + "/corezorba",
1058 ZORBA_VERSION);
1059
1060- if ( ! lZorbaVersion.satisfies(lOptVersion))
1061+ if ( ! lZorbaVersion.satisfies(lOptVersion))
1062 {
1063 RAISE_ERROR(zerr::ZXQP0038_INAPPROPRIATE_ZORBA_VERSION, loc,
1064 ERROR_PARAMS(value, ZORBA_VERSION));
1065@@ -3301,7 +3307,7 @@
1066
1067 // If the option is in (starts-with) Zorba's own namespace but not known,
1068 // we raise an error
1069- else
1070+ else
1071 {
1072 RAISE_ERROR(zerr::ZXQP0060_OPTION_NOT_KNOWN, loc,
1073 ERROR_PARAMS(qname2->getNamespace() + ":" + qname2->getLocalName()));
1074@@ -3352,7 +3358,7 @@
1075 const zstring& name,
1076 const QueryLoc& loc)
1077 {
1078- store::Item_t lQName = parse_and_expand_qname( value, ZORBA_WARN_NS, loc );
1079+ store::Item_t lQName = parse_and_expand_qname( value, ZORBA_WARN_NS, loc );
1080
1081 std::vector<store::Item_t>::iterator lIter;
1082
1083@@ -3418,7 +3424,7 @@
1084 RAISE_ERROR(zerr::ZDST0060_FEATURE_NOT_SUPPORTED, loc,
1085 ERROR_PARAMS(featureName->getStringValue(),
1086 ZED(ZDST0060_unknown_namespace),
1087- featureName->getNamespace()));
1088+ featureName->getNamespace()));
1089 }
1090
1091 feature::kind k;
1092@@ -3434,7 +3440,7 @@
1093 RAISE_ERROR(zerr::ZDST0060_FEATURE_NOT_SUPPORTED, loc,
1094 ERROR_PARAMS(featureName->getStringValue(),
1095 ZED(ZDST0060_unknown_localname),
1096- featureName->getLocalName()));
1097+ featureName->getLocalName()));
1098 }
1099 }
1100
1101@@ -3450,7 +3456,7 @@
1102 if (value != "for-serialization-only")
1103 {
1104 RAISE_ERROR(zerr::ZDST0060_FEATURE_NOT_SUPPORTED, loc,
1105- ERROR_PARAMS(value, ZED(ZDST0060_unknown_localname), value));
1106+ ERROR_PARAMS(value, ZED(ZDST0060_unknown_localname), value));
1107 }
1108 }
1109
1110@@ -3974,11 +3980,11 @@
1111 {
1112 theImportedPrivateVariablesMap = new VariableMap(0, NULL, 8, false);
1113 }
1114-
1115+
1116 if (!theImportedPrivateVariablesMap->insert(ve->get_name(), ve))
1117 {
1118 throw XQUERY_EXCEPTION_VAR(err::XQST0049, ERROR_PARAMS( ve->get_name()->getStringValue() ), ERROR_LOC( loc ));
1119- }
1120+ }
1121 }
1122 }
1123 }
1124
1125=== modified file 'src/context/static_context.h'
1126--- src/context/static_context.h 2012-03-07 15:49:25 +0000
1127+++ src/context/static_context.h 2012-03-15 17:04:36 +0000
1128@@ -273,7 +273,7 @@
1129 theExternalModulesMap :
1130 -----------------------
1131
1132- theTypeMnager :
1133+ theTypeManager :
1134 ---------------
1135 If non NULL, then "this" is the root sctx of a module, and theTypeManager stores
1136 the schemas that are imported by the associated module (in-scope element
1137@@ -296,7 +296,7 @@
1138
1139 theVariablesMap :
1140 -----------------
1141-
1142+
1143 theImportedPrivateVariablesMap :
1144 --------------------------------
1145
1146@@ -469,6 +469,7 @@
1147 static const char* ZORBA_FETCH_FN_NS;
1148 static const char* ZORBA_NODE_FN_NS;
1149 static const char* ZORBA_XML_FN_NS;
1150+ static const char* ZORBA_XML_FN_OPTIONS_NS;
1151
1152 // Namespaces of virtual modules declaring zorba builtin functions
1153 static const char* ZORBA_UTIL_FN_NS;
1154@@ -522,7 +523,7 @@
1155 xqtref_t theContextItemType;
1156
1157 VariableMap * theVariablesMap;
1158-
1159+
1160 VariableMap * theImportedPrivateVariablesMap;
1161
1162 FunctionMap * theFunctionMap;
1163
1164=== modified file 'src/diagnostics/diagnostic_en.xml'
1165--- src/diagnostics/diagnostic_en.xml 2012-03-12 23:43:56 +0000
1166+++ src/diagnostics/diagnostic_en.xml 2012-03-15 17:04:36 +0000
1167@@ -1753,7 +1753,7 @@
1168 </diagnostic>
1169
1170 <diagnostic code="ZXQD0003" name="INCONSISTENT_PARSE_FRAGMENT_OPTIONS">
1171- <value>inconsistent options to the parse-xml-fragment() function: $1</value>
1172+ <value>inconsistent options to the parse-xml() function: $1</value>
1173 </diagnostic>
1174
1175 <diagnostic code="ZXQD0004" name="INVALID_PARAMETER">
1176@@ -2620,6 +2620,10 @@
1177 <entry key="BadXMLDocument_2o">
1178 <value>malformed XML document${ at "2"}</value>
1179 </entry>
1180+
1181+ <entry key="BadXMLNoOpeningTag">
1182+ <value>closing tag without matching opening tag</value>
1183+ </entry>
1184
1185 <entry key="BadXMLForXQDoc_3">
1186 <value>can not parse as XML for xqdoc: $3</value>
1187@@ -3517,12 +3521,12 @@
1188 <value>xqueryx content is empty</value>
1189 </entry>
1190
1191- <entry key="ParseFragmentOptionDSLNotAllowed">
1192- <value>if the e option is specified, none of the options d, s, or l may be enabled</value>
1193- </entry>
1194-
1195 <entry key="ParseFragmentOptionCombinationNotAllowed">
1196- <value>specifying both $2 and $3 is an error</value>
1197+ <value>only one of the &lt;schema-validate/&gt;, &lt;DTD-validate/&gt; or &lt;parse-external-parsed-entity/&gt; options can be specified</value>
1198+ </entry>
1199+
1200+ <entry key="ParseFragmentInvalidOptions">
1201+ <value>invalid options passed to the parse-xml:parse() function, the element must in the schema target namespace</value>
1202 </entry>
1203
1204 </subvalues>
1205
1206=== modified file 'src/diagnostics/pregenerated/dict_en.cpp'
1207--- src/diagnostics/pregenerated/dict_en.cpp 2012-03-12 23:43:56 +0000
1208+++ src/diagnostics/pregenerated/dict_en.cpp 2012-03-15 17:04:36 +0000
1209@@ -386,7 +386,7 @@
1210 { "ZWST0006", "\"$1\": function caching might not give the intended result because the function is declared as $2" },
1211 { "ZXQD0001", "\"$1\": prefix not declared when calling function \"$2\" from $3" },
1212 { "ZXQD0002", "\"$1\": $2" },
1213- { "ZXQD0003", "inconsistent options to the parse-xml-fragment() function: $1" },
1214+ { "ZXQD0003", "inconsistent options to the parse-xml() function: $1" },
1215 { "ZXQD0004", "invalid parameter: $1" },
1216 { "ZXQD0005", "key with type $1 not subtype or castable to target type $2 of map ($3)" },
1217 { "ZXQD0006", "\"$1\": invalid UTF-8 byte sequence" },
1218@@ -464,6 +464,7 @@
1219 { "~BadWordNetPtr_2", "\"$2\": invalid pointer type" },
1220 { "~BadXMLDocument_2o", "malformed XML document${ at \"2\"}" },
1221 { "~BadXMLForXQDoc_3", "can not parse as XML for xqdoc: $3" },
1222+ { "~BadXMLNoOpeningTag", "closing tag without matching opening tag" },
1223 { "~BadXQueryVersion", "unsupported XQuery version" },
1224 { "~Base64BadChar", "invalid Base64 character" },
1225 { "~Base64Equals", "in Base64, '=' must be at the end and followed by one of [AEIMQUYcgkosw048]" },
1226@@ -582,8 +583,8 @@
1227 { "~OpNodeBeforeMustHaveNodes", "op:node-before() must have nodes as parameters" },
1228 { "~OperationNotDef_23", "$2 not defined for type \"$3\"" },
1229 { "~OperationNotPossibleWithTypes_234", "\"$2\": operation not possible with parameters of type \"$3\" and \"$4\"" },
1230- { "~ParseFragmentOptionCombinationNotAllowed", "specifying both $2 and $3 is an error" },
1231- { "~ParseFragmentOptionDSLNotAllowed", "if the e option is specified, none of the options d, s, or l may be enabled" },
1232+ { "~ParseFragmentInvalidOptions", "invalid options passed to the parse-xml:parse() function, the element must in the schema target namespace" },
1233+ { "~ParseFragmentOptionCombinationNotAllowed", "only one of the <schema-validate/>, <DTD-validate/> or <parse-external-parsed-entity/> options can be specified" },
1234 { "~ParserInitFailed", "parser initialization failed" },
1235 { "~ParserNoCreateTree", "XML tree creation failed" },
1236 { "~PromotionImpossible", "promotion not possible" },
1237
1238=== modified file 'src/functions/pregenerated/func_parse_fragment.cpp'
1239--- src/functions/pregenerated/func_parse_fragment.cpp 2012-02-16 12:48:17 +0000
1240+++ src/functions/pregenerated/func_parse_fragment.cpp 2012-03-15 17:04:36 +0000
1241@@ -31,7 +31,7 @@
1242
1243
1244
1245-PlanIter_t fn_zorba_xml_parse_xml_fragment::codegen(
1246+PlanIter_t fn_zorba_xml_parse::codegen(
1247 CompilerCB*,
1248 static_context* sctx,
1249 const QueryLoc& loc,
1250@@ -46,26 +46,12 @@
1251 {
1252
1253
1254- DECL_WITH_KIND(sctx, fn_zorba_xml_parse_xml_fragment,
1255- (createQName("http://www.zorba-xquery.com/modules/xml","","parse-xml-fragment"),
1256- GENV_TYPESYSTEM.STRING_TYPE_QUESTION,
1257- GENV_TYPESYSTEM.STRING_TYPE_ONE,
1258- GENV_TYPESYSTEM.ANY_NODE_TYPE_STAR),
1259- FunctionConsts::FN_ZORBA_XML_PARSE_XML_FRAGMENT_2);
1260-
1261- }
1262-
1263-
1264- {
1265-
1266-
1267- DECL_WITH_KIND(sctx, fn_zorba_xml_parse_xml_fragment,
1268- (createQName("http://www.zorba-xquery.com/modules/xml","","parse-xml-fragment"),
1269- GENV_TYPESYSTEM.STRING_TYPE_QUESTION,
1270- GENV_TYPESYSTEM.STRING_TYPE_ONE,
1271- GENV_TYPESYSTEM.STRING_TYPE_ONE,
1272- GENV_TYPESYSTEM.ANY_NODE_TYPE_STAR),
1273- FunctionConsts::FN_ZORBA_XML_PARSE_XML_FRAGMENT_3);
1274+ DECL_WITH_KIND(sctx, fn_zorba_xml_parse,
1275+ (createQName("http://www.zorba-xquery.com/modules/xml","","parse"),
1276+ GENV_TYPESYSTEM.STRING_TYPE_QUESTION,
1277+ GENV_TYPESYSTEM.ELEMENT_TYPE_QUESTION,
1278+ GENV_TYPESYSTEM.ANY_NODE_TYPE_STAR),
1279+ FunctionConsts::FN_ZORBA_XML_PARSE_2);
1280
1281 }
1282
1283
1284=== modified file 'src/functions/pregenerated/func_parse_fragment.h'
1285--- src/functions/pregenerated/func_parse_fragment.h 2012-01-11 17:30:25 +0000
1286+++ src/functions/pregenerated/func_parse_fragment.h 2012-03-15 17:04:36 +0000
1287@@ -38,11 +38,11 @@
1288
1289
1290
1291-//fn-zorba-xml:parse-xml-fragment
1292-class fn_zorba_xml_parse_xml_fragment : public function
1293+//fn-zorba-xml:parse
1294+class fn_zorba_xml_parse : public function
1295 {
1296 public:
1297- fn_zorba_xml_parse_xml_fragment(const signature& sig, FunctionConsts::FunctionKind kind)
1298+ fn_zorba_xml_parse(const signature& sig, FunctionConsts::FunctionKind kind)
1299 :
1300 function(sig, kind)
1301 {
1302
1303=== modified file 'src/functions/pregenerated/function_enum.h'
1304--- src/functions/pregenerated/function_enum.h 2012-03-08 18:51:25 +0000
1305+++ src/functions/pregenerated/function_enum.h 2012-03-15 17:04:36 +0000
1306@@ -256,8 +256,7 @@
1307 FN_FORMAT_NUMBER_3,
1308 FN_FORMAT_INTEGER_2,
1309 FN_FORMAT_INTEGER_3,
1310- FN_ZORBA_XML_PARSE_XML_FRAGMENT_2,
1311- FN_ZORBA_XML_PARSE_XML_FRAGMENT_3,
1312+ FN_ZORBA_XML_PARSE_2,
1313 FN_PARSE_XML_1,
1314 FN_PARSE_XML_2,
1315 FN_SERIALIZE_1,
1316
1317=== modified file 'src/runtime/parsing_and_serializing/fragment_istream.h' (properties changed: +x to -x)
1318--- src/runtime/parsing_and_serializing/fragment_istream.h 2011-07-16 13:33:13 +0000
1319+++ src/runtime/parsing_and_serializing/fragment_istream.h 2012-03-15 17:04:36 +0000
1320@@ -18,55 +18,99 @@
1321 #define ZORBA_RUNTIME_PARSING_AND_SERIALIZING_FRAGMENT_ISTREAM_H
1322
1323 #include <iostream>
1324+#include <libxml/parser.h>
1325+#include <store/api/iterator.h>
1326
1327 namespace zorba {
1328
1329 /**
1330- * A class to hold an input stream for the parse-xml-fragment function
1331- * Author: Zorba Team
1332+ * A class to hold an input stream for the parse-xml:parse() function
1333+ * Author: Nicolae Brinza
1334 */
1335 class FragmentIStream : public std::istream
1336 {
1337 public:
1338+ static const unsigned int BUFFER_SIZE = 4096;
1339+ static const unsigned int LOOKAHEAD_BYTES = 3; // lookahead fetching is implemented, but currently not used
1340+ static const unsigned int PARSED_NODES_BATCH_SIZE = 1024;
1341+
1342+public:
1343 FragmentIStream()
1344 :
1345 std::istream(NULL),
1346 theIss(NULL),
1347 theStream(NULL),
1348 theBuffer(NULL),
1349- buffer_size(0),
1350- current_offset(0)
1351+ bytes_in_buffer(0),
1352+ current_offset(0),
1353+ current_element_depth(0),
1354+ root_elements_to_skip(0),
1355+ ctxt(NULL),
1356+ first_start_doc(true),
1357+ forced_parser_stop(false),
1358+ reached_eof(false),
1359+ parsed_nodes_count(0),
1360+ children(NULL)
1361 {
1362 };
1363
1364+ bool stream_is_consumed()
1365+ {
1366+ return reached_eof && current_offset >= bytes_in_buffer;
1367+ }
1368+
1369 void reset()
1370 {
1371 if (theBuffer)
1372+ {
1373 delete[] theBuffer;
1374+ }
1375+
1376 if (theIss)
1377+ {
1378 delete theIss;
1379+ }
1380+
1381+ if (ctxt)
1382+ {
1383+ xmlCtxtReset(ctxt);
1384+ xmlFreeParserCtxt(ctxt);
1385+ }
1386
1387 theIss = NULL;
1388 theStream = NULL;
1389 theBuffer = NULL;
1390- buffer_size = 0;
1391+ bytes_in_buffer = 0;
1392 current_offset = 0;
1393+ current_element_depth = 0;
1394+ root_elements_to_skip = 0;
1395+ ctxt = NULL;
1396+ first_start_doc = true;
1397+ forced_parser_stop = false;
1398+ reached_eof = false;
1399+ parsed_nodes_count = 0;
1400+ children = NULL;
1401 }
1402
1403 virtual ~FragmentIStream()
1404 {
1405- if (theBuffer)
1406- delete[] theBuffer;
1407- if (theIss)
1408- delete theIss;
1409+ reset();
1410 }
1411
1412 public:
1413 std::istringstream* theIss;
1414 std::istream* theStream;
1415 char* theBuffer;
1416- unsigned long buffer_size;
1417+ unsigned long bytes_in_buffer;
1418 unsigned long current_offset;
1419+ int current_element_depth;
1420+ int root_elements_to_skip;
1421+ xmlParserCtxtPtr ctxt;
1422+ bool first_start_doc;
1423+ bool forced_parser_stop;
1424+ bool reached_eof;
1425+ unsigned int parsed_nodes_count;
1426+ store::Iterator_t children;
1427 };
1428
1429 }
1430
1431=== modified file 'src/runtime/parsing_and_serializing/parse_fragment_impl.cpp' (properties changed: +x to -x)
1432--- src/runtime/parsing_and_serializing/parse_fragment_impl.cpp 2011-08-10 02:50:23 +0000
1433+++ src/runtime/parsing_and_serializing/parse_fragment_impl.cpp 2012-03-15 17:04:36 +0000
1434@@ -25,117 +25,150 @@
1435 #include "store/api/store.h"
1436 #include "store/api/item.h"
1437 #include "store/api/item_factory.h"
1438+#include "store/api/load_properties.h"
1439
1440 #include "system/globalenv.h"
1441
1442 #include "types/schema/schema.h"
1443 #include "types/schema/validate.h"
1444
1445+
1446 namespace zorba
1447 {
1448
1449 /*******************************************************************************
1450- 14.9.1 fn-zorba-xml:parse-xml-fragment
1451+ 14.9.1 fn-zorba-xml:parse
1452 ********************************************************************************/
1453
1454-class ParseXmlFragmentOptions
1455-{
1456-public:
1457- // all options are false by default, except for enableFatelErrorProcessing which is true
1458- bool enableExternalEntitiesProcessing;
1459- bool enableDTDValidation;
1460- bool enableStrictSchemaValidation;
1461- bool enableLaxSchemaValidation;
1462- bool enableWhitespaceStripping;
1463- bool enableFatelErrorProcessing;
1464-
1465-public:
1466- ParseXmlFragmentOptions() :
1467- enableExternalEntitiesProcessing(false),
1468- enableDTDValidation(false),
1469- enableStrictSchemaValidation(false),
1470- enableLaxSchemaValidation(false),
1471- enableWhitespaceStripping(false),
1472- enableFatelErrorProcessing(true) // only enableFatelErrorProcessing is set to true
1473- {
1474- }
1475-
1476- void reset()
1477- {
1478- enableExternalEntitiesProcessing = false;
1479- enableDTDValidation = false;
1480- enableStrictSchemaValidation = false;
1481- enableLaxSchemaValidation = false;
1482- enableWhitespaceStripping = false;
1483- enableFatelErrorProcessing = true; // only enableFatelErrorProcessing is set to true
1484- }
1485-
1486- static ParseXmlFragmentOptions parseOptions(const zstring& options, const QueryLoc& loc)
1487- {
1488- ParseXmlFragmentOptions opt;
1489-
1490- if (options.find("e") != zstring::npos && options.find("E") != zstring::npos)
1491- throw XQUERY_EXCEPTION(zerr::ZXQD0003_INCONSISTENT_PARSE_FRAGMENT_OPTIONS,
1492- ERROR_PARAMS(ZED(ParseFragmentOptionCombinationNotAllowed), "e", "E"), ERROR_LOC( loc ));
1493-
1494- if (options.find("d") != zstring::npos && options.find("D") != zstring::npos)
1495- throw XQUERY_EXCEPTION(zerr::ZXQD0003_INCONSISTENT_PARSE_FRAGMENT_OPTIONS,
1496- ERROR_PARAMS(ZED(ParseFragmentOptionCombinationNotAllowed), "d", "D"), ERROR_LOC( loc ));
1497-
1498- if (options.find("s") != zstring::npos && options.find("S") != zstring::npos)
1499- throw XQUERY_EXCEPTION(zerr::ZXQD0003_INCONSISTENT_PARSE_FRAGMENT_OPTIONS,
1500- ERROR_PARAMS(ZED(ParseFragmentOptionCombinationNotAllowed), "s", "S"), ERROR_LOC( loc ));
1501-
1502- if (options.find("l") != zstring::npos && options.find("L") != zstring::npos)
1503- throw XQUERY_EXCEPTION(zerr::ZXQD0003_INCONSISTENT_PARSE_FRAGMENT_OPTIONS,
1504- ERROR_PARAMS(ZED(ParseFragmentOptionCombinationNotAllowed), "l", "L"), ERROR_LOC( loc ));
1505-
1506- if (options.find("w") != zstring::npos && options.find("W") != zstring::npos)
1507- throw XQUERY_EXCEPTION(zerr::ZXQD0003_INCONSISTENT_PARSE_FRAGMENT_OPTIONS,
1508- ERROR_PARAMS(ZED(ParseFragmentOptionCombinationNotAllowed), "w", "W"), ERROR_LOC( loc ));
1509-
1510- if (options.find("f") != zstring::npos && options.find("F") != zstring::npos)
1511- throw XQUERY_EXCEPTION(zerr::ZXQD0003_INCONSISTENT_PARSE_FRAGMENT_OPTIONS,
1512- ERROR_PARAMS(ZED(ParseFragmentOptionCombinationNotAllowed), "f", "F"), ERROR_LOC( loc ));
1513-
1514- if (options.find("e") != zstring::npos)
1515- opt.enableExternalEntitiesProcessing = true;
1516- if (options.find("d") != zstring::npos)
1517- opt.enableDTDValidation = true;
1518- if (options.find("s") != zstring::npos)
1519- opt.enableStrictSchemaValidation = true;
1520- if (options.find("l") != zstring::npos)
1521- opt.enableLaxSchemaValidation = true;
1522- if (options.find("w") != zstring::npos)
1523- opt.enableWhitespaceStripping = true;
1524- if (options.find("f") != zstring::npos)
1525- opt.enableFatelErrorProcessing = true;
1526-
1527- if (options.find("E") != zstring::npos)
1528- opt.enableExternalEntitiesProcessing = false;
1529- if (options.find("D") != zstring::npos)
1530- opt.enableDTDValidation = false;
1531- if (options.find("S") != zstring::npos)
1532- opt.enableStrictSchemaValidation = false;
1533- if (options.find("L") != zstring::npos)
1534- opt.enableLaxSchemaValidation = false;
1535- if (options.find("W") != zstring::npos)
1536- opt.enableWhitespaceStripping = false;
1537- if (options.find("F") != zstring::npos)
1538- opt.enableFatelErrorProcessing = false;
1539-
1540- if (opt.enableExternalEntitiesProcessing
1541- &&
1542- (opt.enableDTDValidation || opt.enableStrictSchemaValidation || opt.enableLaxSchemaValidation))
1543- {
1544- throw XQUERY_EXCEPTION(zerr::ZXQD0003_INCONSISTENT_PARSE_FRAGMENT_OPTIONS,
1545- ERROR_PARAMS(ZED(ParseFragmentOptionDSLNotAllowed)), ERROR_LOC( loc ));
1546- }
1547-
1548- return opt;
1549- }
1550-};
1551-
1552+store::Item_t getFirstAttribute(store::Item_t node)
1553+{
1554+ store::Item_t attr;
1555+ store::Iterator_t attributes = node->getAttributes();
1556+ attributes->open();
1557+ attributes->next(attr);
1558+ attributes->close();
1559+ return attr;
1560+}
1561+
1562+void processOptions(store::Item_t item, store::LoadProperties& props, static_context* theSctx, const QueryLoc& loc)
1563+{
1564+ URI lValidatedBaseUri;
1565+ store::Item_t child, tempItem;
1566+
1567+ if (item.getp() == NULL)
1568+ return;
1569+
1570+#ifndef ZORBA_NO_XMLSCHEMA
1571+ if (item->isValidated())
1572+ {
1573+ if (item->getNodeName() == NULL
1574+ ||
1575+ item->getNodeName()->getNamespace() != static_context::ZORBA_XML_FN_OPTIONS_NS)
1576+ {
1577+ throw XQUERY_EXCEPTION(zerr::ZXQD0003_INCONSISTENT_PARSE_FRAGMENT_OPTIONS,
1578+ ERROR_PARAMS(ZED(ParseFragmentInvalidOptions)), ERROR_LOC( loc ));
1579+ }
1580+ }
1581+ else
1582+ {
1583+ tempItem = NULL; // used as the effectiveValidationValue()'s typeName
1584+ Validator::effectiveValidationValue(
1585+ item,
1586+ item,
1587+ tempItem,
1588+ theSctx->get_typemanager(),
1589+ ParseConstants::val_strict,
1590+ theSctx,
1591+ loc);
1592+ }
1593+#endif
1594+
1595+ store::Iterator_t children = item->getChildren();
1596+ children->open();
1597+
1598+ while (children->next(child))
1599+ {
1600+ if (child->getNodeKind() != store::StoreConsts::elementNode)
1601+ continue;
1602+
1603+ if (child->getNodeName()->getLocalName() == "base-uri")
1604+ {
1605+ store::Item_t attr = getFirstAttribute(child);
1606+
1607+ try {
1608+ lValidatedBaseUri = URI(attr->getStringValue());
1609+ } catch (ZorbaException const& /* e */) {
1610+ throw XQUERY_EXCEPTION(
1611+ err::FODC0007,
1612+ ERROR_PARAMS( attr->getStringValue() ),
1613+ ERROR_LOC( loc )
1614+ );
1615+ }
1616+
1617+ if (!lValidatedBaseUri.is_absolute()) {
1618+ throw XQUERY_EXCEPTION(
1619+ err::FODC0007,
1620+ ERROR_PARAMS( lValidatedBaseUri.toString() ),
1621+ ERROR_LOC( loc )
1622+ );
1623+ }
1624+
1625+ props.setBaseUri(attr->getStringValue());
1626+ }
1627+ else if (child->getNodeName()->getLocalName() == "no-error")
1628+ props.setNoError(true);
1629+ else if (child->getNodeName()->getLocalName() == "strip-boundary-space")
1630+ props.setStripWhitespace(true);
1631+ else if (child->getNodeName()->getLocalName() == "schema-validate")
1632+ {
1633+ store::Item_t attr = getFirstAttribute(child);
1634+ if (attr->getStringValue() == "strict")
1635+ props.setSchemaStrictValidate(true);
1636+ else
1637+ props.setSchemaLaxValidate(true);
1638+ }
1639+ else if (child->getNodeName()->getLocalName() == "DTD-validate")
1640+ props.setDTDValidate(true);
1641+ else if (child->getNodeName()->getLocalName() == "DTD-load")
1642+ props.setDTDLoad(true);
1643+ else if (child->getNodeName()->getLocalName() == "default-DTD-attributes")
1644+ props.setDefaultDTDAttributes(true);
1645+ else if (child->getNodeName()->getLocalName() == "parse-external-parsed-entity")
1646+ {
1647+ props.setParseExternalParsedEntity(true);
1648+ store::Item_t attr;
1649+ store::Iterator_t attribs = child->getAttributes();
1650+ attribs->open();
1651+ while (attribs->next(attr))
1652+ {
1653+ if (attr->getNodeName()->getLocalName() == "skip-root-nodes")
1654+ props.setSkipRootNodes(ztd::aton<xs_int>(attr->getStringValue().c_str()));
1655+ else if (attr->getNodeName()->getLocalName() == "skip-top-level-text-nodes")
1656+ props.setSkipTopLevelTextNodes(true);
1657+ }
1658+ attribs->close();
1659+ }
1660+ else if (child->getNodeName()->getLocalName() == "substitute-entities")
1661+ props.setSubstituteEntities(true);
1662+ else if (child->getNodeName()->getLocalName() == "xinclude-substitutions")
1663+ props.setXincludeSubstitutions(true);
1664+ else if (child->getNodeName()->getLocalName() == "remove-redundant-ns")
1665+ props.setRemoveRedundantNS(true);
1666+ else if (child->getNodeName()->getLocalName() == "no-CDATA")
1667+ props.setNoCDATA(true);
1668+ else if (child->getNodeName()->getLocalName() == "no-xinclude-nodes")
1669+ props.setNoXIncludeNodes(true);
1670+ }
1671+
1672+ children->close();
1673+
1674+ if (props.getSchemaLaxValidate() + props.getSchemaStrictValidate() +
1675+ props.getDTDValidate() + props.getParseExternalParsedEntity() > 1)
1676+ {
1677+ throw XQUERY_EXCEPTION(zerr::ZXQD0003_INCONSISTENT_PARSE_FRAGMENT_OPTIONS,
1678+ ERROR_PARAMS(ZED(ParseFragmentOptionCombinationNotAllowed)), ERROR_LOC( loc ));
1679+ }
1680+}
1681
1682 /*******************************************************************************
1683
1684@@ -145,8 +178,7 @@
1685 {
1686 PlanIteratorState::reset(planState);
1687 theFragmentStream.reset();
1688- theProperties.setEnableDtd(false);
1689- theProperties.setEnableExtParsedEntity(false);
1690+ theProperties.reset();
1691 theProperties.setStoreDocument(false);
1692 baseUri = "";
1693 docUri = "";
1694@@ -161,9 +193,7 @@
1695 {
1696 store::Store& lStore = GENV.getStore();
1697 zstring docString;
1698- URI lValidatedBaseUri;
1699 store::Item_t tempItem;
1700- ParseXmlFragmentOptions parseOptions;
1701 bool validated = true;
1702
1703 FnParseXmlFragmentIteratorState* state;
1704@@ -182,87 +212,61 @@
1705 state->theFragmentStream.theStream = state->theFragmentStream.theIss;
1706 }
1707
1708- // optional base URI argument
1709- if (theChildren.size() == 3)
1710- {
1711- consumeNext(result, theChildren[1].getp(), planState);
1712- ZORBA_ASSERT(result);
1713-
1714- try {
1715- lValidatedBaseUri = URI(result->getStringValue());
1716- } catch (ZorbaException const& /* e */) {
1717- throw XQUERY_EXCEPTION(
1718- err::FODC0007,
1719- ERROR_PARAMS( result->getStringValue() ),
1720- ERROR_LOC( loc )
1721- );
1722- }
1723-
1724- if (!lValidatedBaseUri.is_absolute()) {
1725- throw XQUERY_EXCEPTION(
1726- err::FODC0007,
1727- ERROR_PARAMS( lValidatedBaseUri.toString() ),
1728- ERROR_LOC( loc )
1729- );
1730- }
1731-
1732- result->getStringValue2(state->baseUri);
1733-
1734- // read options
1735- consumeNext(tempItem, theChildren[2].getp(), planState);
1736- parseOptions = ParseXmlFragmentOptions::parseOptions(tempItem->getStringValue(), loc);
1737-
1738- } else {
1739- // read options
1740- consumeNext(tempItem, theChildren[1].getp(), planState);
1741- parseOptions = ParseXmlFragmentOptions::parseOptions(tempItem->getStringValue(), loc);
1742-
1743- state->baseUri = theSctx->get_base_uri();
1744- }
1745+ // read options
1746+ consumeNext(tempItem, theChildren[1].getp(), planState);
1747+ state->theProperties.setBaseUri(theSctx->get_base_uri());
1748+ state->theProperties.setStoreDocument(false);
1749+ processOptions(tempItem, state->theProperties, theSctx, loc);
1750
1751 // baseURI serves both as the base URI used by the XML parser
1752 // to resolve relative entity references within the document,
1753 // and as the base URI of the document node that is returned.
1754- state->docUri = state->baseUri;
1755-
1756- // The DTD and ExternalEntitiesProcessing options/props cannot both be true at the same time
1757- if (parseOptions.enableDTDValidation)
1758- state->theProperties.setEnableDtd(true);
1759- if (parseOptions.enableExternalEntitiesProcessing)
1760- state->theProperties.setEnableExtParsedEntity(true);
1761- state->theProperties.setStoreDocument(false);
1762-
1763- if (state->theProperties.getEnableExtParsedEntity())
1764+ state->baseUri = state->theProperties.getBaseUri();
1765+ state->docUri = state->theProperties.getBaseUri();
1766+
1767+
1768+ ////////////////////////////////////////////////////////////////////////
1769+ // External parsed entity processing
1770+ ////////////////////////////////////////////////////////////////////////
1771+ if (state->theProperties.getParseExternalParsedEntity())
1772 {
1773- // state->theFragmentStream.root_elements_to_skip = 0;
1774+ state->theFragmentStream.root_elements_to_skip = state->theProperties.getSkipRootNodes();
1775
1776- while (state->theFragmentStream.theBuffer == NULL
1777- ||
1778- state->theFragmentStream.current_offset < state->theFragmentStream.buffer_size)
1779+ while ( ! state->theFragmentStream.stream_is_consumed())
1780 {
1781 try {
1782 result = lStore.loadDocument(state->baseUri, state->docUri, state->theFragmentStream, state->theProperties);
1783 } catch (ZorbaException const& e) {
1784- if (parseOptions.enableFatelErrorProcessing)
1785- throw XQUERY_EXCEPTION( err::FODC0006, ERROR_PARAMS("parse-xml:parse-xml-fragment()", e.what()), ERROR_LOC( loc ));
1786+ if ( ! state->theProperties.getNoError())
1787+ throw XQUERY_EXCEPTION( err::FODC0006, ERROR_PARAMS("parse-xml:parse()", e.what()), ERROR_LOC( loc ));
1788 else
1789 result = NULL;
1790 }
1791
1792- if (result != NULL)
1793+ if (result == NULL)
1794+ continue;
1795+
1796+ // Return the children of document node
1797+ state->theFragmentStream.children = result->getChildren();
1798+ while (state->theFragmentStream.children->next(result) && result != NULL)
1799 {
1800- result->getChildren()->next(result);
1801+ if (state->theProperties.getSkipTopLevelTextNodes() && result->getNodeKind() == store::StoreConsts::textNode)
1802+ continue;
1803+
1804 STACK_PUSH(true, state);
1805 }
1806 }
1807 }
1808+ ////////////////////////////////////////////////////////////////////////
1809+ // XML document processing
1810+ ////////////////////////////////////////////////////////////////////////
1811 else // if (!state->theProperties.getEnableExtParsedEntity())
1812 {
1813 try {
1814 result = lStore.loadDocument(state->baseUri, state->docUri, *state->theFragmentStream.theStream, state->theProperties);
1815 } catch (ZorbaException const& e) {
1816- if (parseOptions.enableFatelErrorProcessing)
1817- throw XQUERY_EXCEPTION( err::FODC0006, ERROR_PARAMS("parse-xml:parse-xml-fragment()", e.what()), ERROR_LOC( loc ));
1818+ if ( ! state->theProperties.getNoError())
1819+ throw XQUERY_EXCEPTION( err::FODC0006, ERROR_PARAMS("parse-xml:parse()", e.what()), ERROR_LOC( loc ));
1820 else
1821 result = NULL;
1822 }
1823@@ -270,7 +274,7 @@
1824 if (result != NULL)
1825 {
1826 #ifndef ZORBA_NO_XMLSCHEMA
1827- if (parseOptions.enableStrictSchemaValidation || parseOptions.enableLaxSchemaValidation)
1828+ if (state->theProperties.getSchemaLaxValidate() || state->theProperties.getSchemaStrictValidate())
1829 {
1830 try
1831 {
1832@@ -280,13 +284,13 @@
1833 result,
1834 tempItem,
1835 theSctx->get_typemanager(),
1836- parseOptions.enableLaxSchemaValidation ? ParseConstants::val_lax : ParseConstants::val_strict,
1837+ state->theProperties.getSchemaLaxValidate() ? ParseConstants::val_lax : ParseConstants::val_strict,
1838 theSctx,
1839 this->loc);
1840 }
1841 catch (ZorbaException& /*e*/)
1842 {
1843- if (parseOptions.enableFatelErrorProcessing)
1844+ if ( ! state->theProperties.getNoError())
1845 throw;
1846 else
1847 {
1848@@ -298,11 +302,6 @@
1849 #endif
1850 // Ignore the schema validation options if Zorba is built without schema support
1851
1852- if (result != NULL && validated && parseOptions.enableWhitespaceStripping)
1853- {
1854- // TODO: whitespace stripping
1855- }
1856-
1857 STACK_PUSH(validated, state);
1858 } // if (result != NULL)
1859 } // if (state->theProperties.getEnableExtParsedEntity())
1860
1861=== modified file 'src/runtime/parsing_and_serializing/pregenerated/parse_fragment.cpp' (properties changed: +x to -x)
1862=== modified file 'src/runtime/parsing_and_serializing/pregenerated/parse_fragment.h' (properties changed: +x to -x)
1863--- src/runtime/parsing_and_serializing/pregenerated/parse_fragment.h 2011-10-19 15:28:51 +0000
1864+++ src/runtime/parsing_and_serializing/pregenerated/parse_fragment.h 2012-03-15 17:04:36 +0000
1865@@ -36,7 +36,7 @@
1866 namespace zorba {
1867
1868 /**
1869- * fn-zorba-xml:parse-xml-fragment
1870+ * fn-zorba-xml:parse
1871 * Author: Zorba Team
1872 */
1873 class FnParseXmlFragmentIteratorState : public PlanIteratorState
1874
1875=== modified file 'src/runtime/sequences/sequences_impl.cpp'
1876--- src/runtime/sequences/sequences_impl.cpp 2012-02-15 10:25:02 +0000
1877+++ src/runtime/sequences/sequences_impl.cpp 2012-03-15 17:04:36 +0000
1878@@ -464,13 +464,13 @@
1879 state->theIsChildReset = false;
1880
1881 CONSUME(startPosItem, 1);
1882- startPos =
1883+ startPos =
1884 static_cast<xs_long>(startPosItem->getDoubleValue().round().getNumber()) - 1;
1885
1886 if (theChildren.size() == 3)
1887 {
1888 CONSUME(lengthItem, 2);
1889- state->theRemaining =
1890+ state->theRemaining =
1891 static_cast<xs_long>(lengthItem->getDoubleValue().round().getNumber());
1892 }
1893
1894@@ -1033,7 +1033,7 @@
1895 }
1896
1897 bool FnDeepEqualIterator::nextImpl(
1898- store::Item_t& result,
1899+ store::Item_t& result,
1900 PlanState& planState) const
1901 {
1902 PlanIteratorState* state;
1903@@ -1061,7 +1061,7 @@
1904 break;
1905 }
1906
1907- if (arg1->isFunction() || arg2->isFunction())
1908+ if (arg1->isFunction() || arg2->isFunction())
1909 {
1910 throw XQUERY_EXCEPTION(
1911 err::FOTY0015,
1912@@ -1161,12 +1161,12 @@
1913 DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
1914
1915
1916- for (;;)
1917+ for (;;)
1918 {
1919 // load items
1920- for (i = 0; i < 2; i++)
1921+ for (i = 0; i < 2; i++)
1922 {
1923- if (item [i] == NULL)
1924+ if (item [i] == NULL)
1925 {
1926 if (!CONSUME (item[i], i))
1927 {
1928@@ -1178,7 +1178,7 @@
1929
1930 // advance, output
1931 order = GENV_STORE.compareNodes(item[0].getp(), item[1].getp());
1932- if ( order == 0 )
1933+ if ( order == 0 )
1934 {
1935 result = item[0];
1936 STACK_PUSH (true, state);
1937@@ -1739,7 +1739,7 @@
1938 planState.theGlobalDynCtx->theDocLoadingUserTime +=
1939 zorbatm::get_cputime_elapsed(t0user, t1user);
1940
1941- planState.theGlobalDynCtx->theDocLoadingTime +=
1942+ planState.theGlobalDynCtx->theDocLoadingTime +=
1943 zorbatm::get_walltime_elapsed(t0, t1);
1944 }
1945
1946@@ -1833,7 +1833,7 @@
1947 // Prepare a LoadProperties for loading the stream into the store
1948 store::LoadProperties lLoadProperties;
1949 lLoadProperties.setStoreDocument(true);
1950- lLoadProperties.setEnableDtd( aSctx->is_feature_set( feature::dtd ) );
1951+ lLoadProperties.setDTDValidate( aSctx->is_feature_set( feature::dtd ) );
1952
1953 // Resolve URI to a stream
1954 zstring lErrorMessage;
1955
1956=== modified file 'src/runtime/spec/parsing_and_serializing/parse_fragment.xml'
1957--- src/runtime/spec/parsing_and_serializing/parse_fragment.xml 2011-07-15 16:39:51 +0000
1958+++ src/runtime/spec/parsing_and_serializing/parse_fragment.xml 2012-03-15 17:04:36 +0000
1959@@ -19,27 +19,20 @@
1960
1961 <!--
1962 /*******************************************************************************
1963- * 14.9.1 fn:parse-xml-fragment
1964+ * 14.9.1 parse-xml:parse
1965 ********************************************************************************/
1966 -->
1967 <zorba:iterator name="FnParseXmlFragmentIterator">
1968
1969- <zorba:description author="Zorba Team">fn-zorba-xml:parse-xml-fragment</zorba:description>
1970+ <zorba:description author="Zorba Team">fn-zorba-xml:parse</zorba:description>
1971
1972 <zorba:function>
1973- <zorba:signature localname="parse-xml-fragment" prefix="fn-zorba-xml">
1974- <zorba:param>xs:string?</zorba:param> <!-- string to parse -->
1975- <zorba:param>xs:string</zorba:param> <!-- parse-xml options -->
1976+ <zorba:signature localname="parse" prefix="fn-zorba-xml">
1977+ <zorba:param>xs:string?</zorba:param> <!-- string to parse -->
1978+ <zorba:param>element()?</zorba:param> <!-- parse() options -->
1979 <zorba:output>node()*</zorba:output>
1980 </zorba:signature>
1981
1982- <zorba:signature localname="parse-xml-fragment" prefix="fn-zorba-xml">
1983- <zorba:param>xs:string?</zorba:param> <!-- string to parse -->
1984- <zorba:param>xs:string</zorba:param> <!-- baseURI -->
1985- <zorba:param>xs:string</zorba:param> <!-- parse-xml options -->
1986- <zorba:output>node()*</zorba:output>
1987- </zorba:signature>
1988-
1989 <zorba:methods>
1990 <zorba:accessesDynCtx returnValue="true"/>
1991 </zorba:methods>
1992
1993=== modified file 'src/store/api/load_properties.h'
1994--- src/store/api/load_properties.h 2011-06-29 15:03:41 +0000
1995+++ src/store/api/load_properties.h 2012-03-15 17:04:36 +0000
1996@@ -35,12 +35,70 @@
1997 {
1998 private:
1999 bool theStoreDocument;
2000- bool theEnableDtdLoader;
2001- bool theEnableExtParsedEntityLoader;
2002+ zstring theBaseUri;
2003+ bool theNoError;
2004+ bool theStripWhitespace;
2005+ bool theSchemaLaxValidate;
2006+ bool theSchemaStrictValidate;
2007+ bool theDTDValidate;
2008+ bool theDTDLoad;
2009+ bool theDefaultDTDAttributes;
2010+ bool theParseExternalParsedEntity;
2011+ unsigned int theSkipRootNodes;
2012+ bool theSkipTopLevelTextNodes;
2013+ bool theSubstituteEntities;
2014+ bool theXincludeSubstitutions;
2015+ bool theRemoveRedundantNS;
2016+ bool theNoCDATA;
2017+ bool theNoXIncludeNodes;
2018
2019 public:
2020- LoadProperties() : theStoreDocument(true), theEnableDtdLoader(false), theEnableExtParsedEntityLoader(false) {}
2021- virtual ~LoadProperties() {}
2022+ LoadProperties()
2023+ :
2024+ theStoreDocument(true),
2025+ theBaseUri(""),
2026+ theNoError(false),
2027+ theStripWhitespace(false),
2028+ theSchemaLaxValidate(false),
2029+ theSchemaStrictValidate(false),
2030+ theDTDValidate(false),
2031+ theDTDLoad(false),
2032+ theDefaultDTDAttributes(false),
2033+ theParseExternalParsedEntity(false),
2034+ theSkipRootNodes(0),
2035+ theSkipTopLevelTextNodes(false),
2036+ theSubstituteEntities(false),
2037+ theXincludeSubstitutions(false),
2038+ theRemoveRedundantNS(false),
2039+ theNoCDATA(false),
2040+ theNoXIncludeNodes(false)
2041+ {
2042+ }
2043+
2044+ virtual ~LoadProperties()
2045+ {
2046+ }
2047+
2048+ void reset()
2049+ {
2050+ theStoreDocument = true;
2051+ theBaseUri = "";
2052+ theNoError = false;
2053+ theStripWhitespace = false;
2054+ theSchemaLaxValidate = false;
2055+ theSchemaStrictValidate = false;
2056+ theDTDValidate = false;
2057+ theDTDLoad = false;
2058+ theDefaultDTDAttributes = false;
2059+ theParseExternalParsedEntity = false;
2060+ theSkipRootNodes = 0;
2061+ theSkipTopLevelTextNodes = false;
2062+ theSubstituteEntities = false;
2063+ theXincludeSubstitutions = false;
2064+ theRemoveRedundantNS = false;
2065+ theNoCDATA = false;
2066+ theNoXIncludeNodes = false;
2067+ }
2068
2069 /**
2070 * Set the property storeDocument, it specifies whether the document
2071@@ -60,40 +118,168 @@
2072 return theStoreDocument;
2073 }
2074
2075- /**
2076- * Set the property enableDtd, it specifies whether the document's
2077- * dtd should be enabled when loading
2078- */
2079- void setEnableDtd(bool aEnableDtdLoader)
2080- {
2081- theEnableDtdLoader = aEnableDtdLoader;
2082- }
2083-
2084- /**
2085- * Get the property enableDtd, it specifies whether the document's
2086- * dtd should be enabled when loading
2087- */
2088- bool getEnableDtd() const
2089- {
2090- return theEnableDtdLoader;
2091- }
2092-
2093- /**
2094- * Set the property enableExtParsedEntity, it specifies whether the document
2095- * should be parsed as an enxternal general parsed entity
2096- */
2097- void setEnableExtParsedEntity(bool aEnableExtParsedEntityLoader)
2098- {
2099- theEnableExtParsedEntityLoader = aEnableExtParsedEntityLoader;
2100- }
2101-
2102- /**
2103- * Get the property enableDtd, it specifies whether the document
2104- * should be parsed as an enxternal general parsed entity
2105- */
2106- bool getEnableExtParsedEntity() const
2107- {
2108- return theEnableExtParsedEntityLoader;
2109+ // theBaseUri
2110+ void setBaseUri(const zstring& aBaseUri)
2111+ {
2112+ theBaseUri = aBaseUri;
2113+ }
2114+ zstring getBaseUri() const
2115+ {
2116+ return theBaseUri;
2117+ }
2118+
2119+ // theNoError
2120+ void setNoError(bool aNoError)
2121+ {
2122+ theNoError = aNoError;
2123+ }
2124+ bool getNoError() const
2125+ {
2126+ return theNoError;
2127+ }
2128+
2129+ // theStripWhitespace
2130+ void setStripWhitespace(bool aStripWhitespace)
2131+ {
2132+ theStripWhitespace = aStripWhitespace;
2133+ }
2134+ bool getStripWhitespace() const
2135+ {
2136+ return theStripWhitespace;
2137+ }
2138+
2139+ // theSchemaLaxValidate
2140+ void setSchemaLaxValidate(bool aSchemaLaxValidate)
2141+ {
2142+ theSchemaLaxValidate = aSchemaLaxValidate;
2143+ if (theSchemaLaxValidate)
2144+ theSchemaStrictValidate = false;
2145+ }
2146+ bool getSchemaLaxValidate() const
2147+ {
2148+ return theSchemaLaxValidate;
2149+ }
2150+
2151+ // theSchemaStrictValidate
2152+ void setSchemaStrictValidate(bool aSchemaStrictValidate)
2153+ {
2154+ theSchemaStrictValidate = aSchemaStrictValidate;
2155+ if (theSchemaStrictValidate)
2156+ theSchemaLaxValidate = false;
2157+ }
2158+ bool getSchemaStrictValidate() const
2159+ {
2160+ return theSchemaStrictValidate;
2161+ }
2162+
2163+ // theDTDValidate
2164+ void setDTDValidate(bool aDTDValidate)
2165+ {
2166+ theDTDValidate = aDTDValidate;
2167+ }
2168+ bool getDTDValidate() const
2169+ {
2170+ return theDTDValidate;
2171+ }
2172+
2173+ // theDTDLoad
2174+ void setDTDLoad(bool aDTDLoad)
2175+ {
2176+ theDTDLoad = aDTDLoad;
2177+ }
2178+ bool getDTDLoad() const
2179+ {
2180+ return theDTDLoad;
2181+ }
2182+
2183+ // theDefaultDTDAttributes
2184+ void setDefaultDTDAttributes(bool aDefaultDTDAttributes)
2185+ {
2186+ theDefaultDTDAttributes = aDefaultDTDAttributes;
2187+ }
2188+ bool getDefaultDTDAttributes() const
2189+ {
2190+ return theDefaultDTDAttributes;
2191+ }
2192+
2193+ // theParseExternalParsedEntity
2194+ void setParseExternalParsedEntity(bool aParseExternalParsedEntity)
2195+ {
2196+ theParseExternalParsedEntity = aParseExternalParsedEntity;
2197+ }
2198+ bool getParseExternalParsedEntity() const
2199+ {
2200+ return theParseExternalParsedEntity;
2201+ }
2202+
2203+ // theSkipRootNodes
2204+ void setSkipRootNodes(unsigned int aSkipRootNodes)
2205+ {
2206+ theSkipRootNodes = aSkipRootNodes;
2207+ }
2208+ unsigned int getSkipRootNodes() const
2209+ {
2210+ return theSkipRootNodes;
2211+ }
2212+
2213+ // theSkipTopLevelTextNodes
2214+ void setSkipTopLevelTextNodes(bool aSkipTopLevelTextNodes)
2215+ {
2216+ theSkipTopLevelTextNodes = aSkipTopLevelTextNodes;
2217+ }
2218+ bool getSkipTopLevelTextNodes() const
2219+ {
2220+ return theSkipTopLevelTextNodes;
2221+ }
2222+
2223+ // theSubstituteEntities
2224+ void setSubstituteEntities(bool aSubstituteEntities)
2225+ {
2226+ theSubstituteEntities = aSubstituteEntities;
2227+ }
2228+ bool getSubstituteEntities() const
2229+ {
2230+ return theSubstituteEntities;
2231+ }
2232+
2233+ // theXincludeSubstitutions
2234+ void setXincludeSubstitutions(bool aXincludeSubstitutions)
2235+ {
2236+ theXincludeSubstitutions = aXincludeSubstitutions;
2237+ }
2238+ bool getXincludeSubstitutions() const
2239+ {
2240+ return theXincludeSubstitutions;
2241+ }
2242+
2243+ // theRemoveRedundantNS
2244+ void setRemoveRedundantNS(bool aRemoveRedundantNS)
2245+ {
2246+ theRemoveRedundantNS = aRemoveRedundantNS;
2247+ }
2248+ bool getRemoveRedundantNS() const
2249+ {
2250+ return theRemoveRedundantNS;
2251+ }
2252+
2253+ // theNoCDATA
2254+ void setNoCDATA(bool aNoCDATA)
2255+ {
2256+ theNoCDATA = aNoCDATA;
2257+ }
2258+ bool getNoCDATA() const
2259+ {
2260+ return theNoCDATA;
2261+ }
2262+
2263+ // theNoXIncludeNodes
2264+ void setNoXIncludeNodes(bool aNoXIncludeNodes)
2265+ {
2266+ theNoXIncludeNodes = aNoXIncludeNodes;
2267+ }
2268+ bool getNoXIncludeNodes() const
2269+ {
2270+ return theNoXIncludeNodes;
2271 }
2272 };
2273
2274
2275=== modified file 'src/store/naive/loader.h'
2276--- src/store/naive/loader.h 2012-02-28 20:45:43 +0000
2277+++ src/store/naive/loader.h 2012-03-15 17:04:36 +0000
2278@@ -21,6 +21,7 @@
2279 #include <libxml/xmlstring.h>
2280
2281 #include "store/api/item.h"
2282+#include "store/api/load_properties.h"
2283
2284 #include "ordpath.h"
2285
2286@@ -74,6 +75,8 @@
2287 static const ulong INPUT_CHUNK_SIZE = 8192;
2288
2289 protected:
2290+ const store::LoadProperties & theLoadProperties;
2291+
2292 xmlParserCtxtPtr ctxt;
2293
2294 xmlSAXHandler theSaxHandler;
2295@@ -89,12 +92,19 @@
2296
2297 bool theBuildDataGuide;
2298
2299+
2300+protected:
2301+ void applyLoadOptions(const store::LoadProperties& props, xmlParserCtxtPtr ctxt);
2302+
2303+
2304 public:
2305 XmlLoader(
2306 BasicItemFactory* factory,
2307 XQueryDiagnostics* xqueryDiagnostics,
2308+ const store::LoadProperties& loadProperties,
2309 bool dataguide)
2310 :
2311+ theLoadProperties(loadProperties),
2312 ctxt(NULL),
2313 theFactory(factory),
2314 theXQueryDiagnostics(xqueryDiagnostics),
2315@@ -156,6 +166,7 @@
2316 FastXmlLoader(
2317 BasicItemFactory* factory,
2318 XQueryDiagnostics* xqueryDiagnostics,
2319+ const store::LoadProperties& loadProperties,
2320 bool dataguide);
2321
2322 ~FastXmlLoader();
2323@@ -245,6 +256,7 @@
2324 FragmentXmlLoader(
2325 BasicItemFactory* factory,
2326 XQueryDiagnostics* xqueryDiagnostics,
2327+ const store::LoadProperties& loadProperties,
2328 bool dataguide);
2329
2330 ~FragmentXmlLoader();
2331@@ -255,7 +267,15 @@
2332 std::istream& xmlStream);
2333
2334 protected:
2335- static void checkStopParsing(void* ctx);
2336+ bool fillBuffer(FragmentIStream* theFragmentStream);
2337+
2338+ unsigned long getCurrentInputOffset() const;
2339+
2340+ static void checkStopParsing(void* ctx, bool force = false);
2341+
2342+ static void startDocument(void * ctx);
2343+
2344+ static void endDocument(void * ctx);
2345
2346 static void startElement(
2347 void * ctx,
2348@@ -295,7 +315,6 @@
2349
2350 protected:
2351 FragmentIStream* theFragmentStream;
2352- int element_depth;
2353 };
2354
2355 /*******************************************************************************
2356@@ -331,8 +350,6 @@
2357 zorba::Stack<PathStepInfo> thePathStack;
2358 std::stack<NsBindingsContext*> theBindingsStack;
2359
2360- bool theParseExtParsedEntity;
2361-
2362 #ifdef DATAGUIDE
2363 zorba::Stack<ElementGuideNode*> theGuideStack;
2364 #endif
2365@@ -341,8 +358,8 @@
2366 DtdXmlLoader(
2367 BasicItemFactory* factory,
2368 XQueryDiagnostics* xqueryDiagnostics,
2369- bool dataguide,
2370- bool parseExtParsedEntity);
2371+ const store::LoadProperties& loadProperties,
2372+ bool dataguide);
2373
2374 ~DtdXmlLoader();
2375
2376
2377=== modified file 'src/store/naive/loader_dtd.cpp'
2378--- src/store/naive/loader_dtd.cpp 2012-02-15 10:25:02 +0000
2379+++ src/store/naive/loader_dtd.cpp 2012-03-15 17:04:36 +0000
2380@@ -76,12 +76,51 @@
2381 /*******************************************************************************
2382
2383 ********************************************************************************/
2384+void XmlLoader::applyLoadOptions(const store::LoadProperties& props, xmlParserCtxtPtr ctxt)
2385+{
2386+ int options = 0;
2387+
2388+ if (props.getStripWhitespace())
2389+ options |= XML_PARSE_NOBLANKS;
2390+
2391+ if (props.getDTDValidate())
2392+ options |= XML_PARSE_DTDVALID;
2393+
2394+ if (props.getDTDLoad())
2395+ options |= XML_PARSE_DTDLOAD;
2396+
2397+ if (props.getDefaultDTDAttributes())
2398+ options |= XML_PARSE_DTDATTR;
2399+
2400+ if (props.getSubstituteEntities())
2401+ options |= XML_PARSE_NOENT;
2402+
2403+ if (props.getXincludeSubstitutions())
2404+ options |= XML_PARSE_XINCLUDE;
2405+
2406+ if (props.getRemoveRedundantNS())
2407+ options |= XML_PARSE_NSCLEAN;
2408+
2409+ if (props.getNoCDATA())
2410+ options |= XML_PARSE_NOCDATA;
2411+
2412+ if (props.getNoXIncludeNodes())
2413+ options |= XML_PARSE_NOXINCNODE;
2414+
2415+ xmlCtxtUseOptions(ctxt, options);
2416+}
2417+
2418+
2419+/*******************************************************************************
2420+
2421+********************************************************************************/
2422 FragmentXmlLoader::FragmentXmlLoader(
2423 BasicItemFactory* factory,
2424 XQueryDiagnostics* xqueryDiagnostics,
2425+ const store::LoadProperties& loadProperties,
2426 bool dataguide)
2427 :
2428- FastXmlLoader(factory, xqueryDiagnostics, dataguide)
2429+ FastXmlLoader(factory, xqueryDiagnostics, loadProperties, dataguide)
2430 {
2431 theOrdPath.init();
2432
2433@@ -109,6 +148,39 @@
2434 {
2435 }
2436
2437+bool FragmentXmlLoader::fillBuffer(FragmentIStream* theFragmentStream)
2438+{
2439+ if (theFragmentStream->ctxt->input->length > 0 && theFragmentStream->current_offset < theFragmentStream->bytes_in_buffer)
2440+ {
2441+ memmove(theFragmentStream->theBuffer, theFragmentStream->theBuffer + theFragmentStream->current_offset,
2442+ theFragmentStream->bytes_in_buffer - theFragmentStream->current_offset);
2443+ }
2444+ theFragmentStream->bytes_in_buffer -= theFragmentStream->current_offset;
2445+
2446+ std::streamsize numChars = readPacket(*theFragmentStream->theStream, theFragmentStream->theBuffer + theFragmentStream->bytes_in_buffer,
2447+ FragmentIStream::BUFFER_SIZE+FragmentIStream::LOOKAHEAD_BYTES - theFragmentStream->bytes_in_buffer);
2448+ if (numChars < 0)
2449+ {
2450+ theXQueryDiagnostics->add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0020_LOADER_IO_ERROR));
2451+ throw 0; // the argument to throw is not used by the catch clause
2452+ }
2453+
2454+ if (theFragmentStream->theStream->eof())
2455+ theFragmentStream->reached_eof = true;
2456+
2457+ theFragmentStream->bytes_in_buffer += numChars;
2458+ theFragmentStream->current_offset = 0;
2459+ theFragmentStream->ctxt->input->base = (xmlChar*)(theFragmentStream->theBuffer);
2460+ theFragmentStream->ctxt->input->length = (theFragmentStream->bytes_in_buffer < FragmentIStream::BUFFER_SIZE? theFragmentStream->bytes_in_buffer : FragmentIStream::BUFFER_SIZE);
2461+ theFragmentStream->ctxt->input->cur = theFragmentStream->ctxt->input->base;
2462+ theFragmentStream->ctxt->input->end = theFragmentStream->ctxt->input->base + theFragmentStream->ctxt->input->length;
2463+ theFragmentStream->ctxt->checkIndex = 0;
2464+
2465+ if (theFragmentStream->bytes_in_buffer < FragmentIStream::BUFFER_SIZE+FragmentIStream::LOOKAHEAD_BYTES)
2466+ theFragmentStream->theBuffer[theFragmentStream->bytes_in_buffer] = 0;
2467+
2468+ return !theFragmentStream->stream_is_consumed();
2469+}
2470
2471 store::Item_t FragmentXmlLoader::loadXml(
2472 const zstring& baseUri,
2473@@ -138,88 +210,105 @@
2474 {
2475 theFragmentStream = static_cast<FragmentIStream*>(&stream);
2476
2477- // Prepare the input buffer
2478+ // Prepare the input buffer and the parser context
2479 if (theFragmentStream->theBuffer == NULL)
2480 {
2481- theFragmentStream->theStream->seekg(0, std::ios::end);
2482- std::streamoff fileSize = theFragmentStream->theStream->tellg();
2483- theFragmentStream->theStream->seekg(0, std::ios::beg);
2484-
2485- theFragmentStream->theBuffer = new char[static_cast<unsigned int>(fileSize+1)];
2486- theFragmentStream->theBuffer[fileSize] = 0;
2487-
2488- std::streamsize numChars = readPacket(*theFragmentStream->theStream,
2489- theFragmentStream->theBuffer,
2490- fileSize);
2491- theFragmentStream->buffer_size = numChars;
2492- if (numChars < 0)
2493- {
2494- theXQueryDiagnostics->
2495- add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0020_LOADER_IO_ERROR));
2496-
2497- abortload();
2498- return NULL;
2499- }
2500- else if (numChars == 0)
2501- {
2502- theXQueryDiagnostics->
2503- add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0020_LOADER_IO_ERROR,
2504- ERROR_PARAMS(ZED(NoInputData))));
2505-
2506- abortload();
2507- return NULL;
2508- }
2509- }
2510-
2511- // Create the LibXml parser context
2512- ctxt = xmlCreatePushParserCtxt(&theSaxHandler, this, NULL, 0, 0);
2513- // ctxt = xmlCreate
2514- if (ctxt == NULL)
2515- {
2516- theXQueryDiagnostics->
2517- add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR,
2518- ERROR_PARAMS(ZED(ParserInitFailed))));
2519-
2520- abortload();
2521- return NULL;
2522- }
2523-
2524- // Delete the initial empty input stream
2525- xmlFreeInputStream(inputPop(ctxt));
2526-
2527- // Create the LibXml parser input
2528- xmlParserInputPtr input = xmlNewInputStream(ctxt);
2529- if (input == NULL)
2530- {
2531- theXQueryDiagnostics->
2532- add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR,
2533- ERROR_PARAMS(ZED(ParserInitFailed))));
2534-
2535- abortload();
2536- return NULL;
2537- }
2538-
2539- // Initialize the parser input
2540- input->filename = (const char*)(xmlCanonicPath((const xmlChar*)theDocUri.c_str()));
2541- input->base = (xmlChar*)(theFragmentStream->theBuffer + theFragmentStream->current_offset);
2542- input->cur = (xmlChar*)(theFragmentStream->theBuffer + theFragmentStream->current_offset);
2543- input->length = theFragmentStream->buffer_size - theFragmentStream->current_offset;
2544- input->end = input->base + input->length;
2545- xmlPushInput(ctxt, input);
2546-
2547- // Reset element_depth
2548- element_depth = 0;
2549-
2550- // Finally call the parser
2551- if (xmlParseExtParsedEnt(ctxt)==-1)
2552- {
2553- theXQueryDiagnostics->
2554- add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR,
2555- ERROR_PARAMS(ZED(ParserNoCreateTree))));
2556-
2557- abortload();
2558- return NULL;
2559- }
2560+ // Allocate input buffer
2561+ theFragmentStream->theBuffer = new char[FragmentIStream::BUFFER_SIZE + FragmentIStream::LOOKAHEAD_BYTES+1];
2562+ theFragmentStream->theBuffer[FragmentIStream::BUFFER_SIZE + FragmentIStream::LOOKAHEAD_BYTES] = 0;
2563+
2564+ // Create the LibXml parser context
2565+ theFragmentStream->ctxt = xmlCreatePushParserCtxt(&theSaxHandler, this, NULL, 0, 0);
2566+ if (theFragmentStream->ctxt == NULL)
2567+ {
2568+ theXQueryDiagnostics->add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR, ERROR_PARAMS( ZED( ParserInitFailed ) )));
2569+ throw 0; // the argument to throw is not used by the catch clause
2570+ }
2571+
2572+ // Apply parser options
2573+ applyLoadOptions(theLoadProperties, theFragmentStream->ctxt);
2574+
2575+ // Delete the initial empty input stream
2576+ xmlFreeInputStream(inputPop(theFragmentStream->ctxt));
2577+
2578+ // Create the LibXml parser input
2579+ xmlParserInputPtr input = xmlNewInputStream(theFragmentStream->ctxt);
2580+ if (input == NULL)
2581+ {
2582+ theXQueryDiagnostics->add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR, ERROR_PARAMS( ZED( ParserInitFailed ) )));
2583+ throw 0; // the argument to throw is not used by the catch clause
2584+ }
2585+
2586+ // Initialize the parser input (only filename and the pointer to the current char)
2587+ theFragmentStream->theBuffer[0] = ' '; // This assignment is needed for LibXml2-2.7.6, which tries to read the buffer when xmlPushInput() is called
2588+ input->cur = (xmlChar*)(theFragmentStream->theBuffer);
2589+ input->filename = (const char*)(xmlCanonicPath((const xmlChar*)theDocUri.c_str()));
2590+ xmlPushInput(theFragmentStream->ctxt, input);
2591+ }
2592+
2593+ theFragmentStream->ctxt->userData = this; // the loader has changed, update the address
2594+ theFragmentStream->ctxt->disableSAX = false; // xmlStopParser() sets disableSAX to true
2595+ theFragmentStream->parsed_nodes_count = 0;
2596+ theFragmentStream->forced_parser_stop = false;
2597+
2598+ if ( ! theFragmentStream->first_start_doc)
2599+ {
2600+ theFragmentStream->ctxt->instate = XML_PARSER_CONTENT;
2601+ FragmentXmlLoader::startDocument(theFragmentStream->ctxt->userData);
2602+ }
2603+
2604+ while ( ! theFragmentStream->forced_parser_stop && fillBuffer(theFragmentStream))
2605+ {
2606+ // std::cerr << "\n==================\n--> skip_root: " << theFragmentStream->root_elements_to_skip << " current_depth: " << theFragmentStream->current_element_depth << " about to parse: [" << theFragmentStream->ctxt->input->cur << "] " << std::endl;
2607+
2608+ // This case needs to be handled here, otherwise LibXml2 will segfault
2609+ if (theFragmentStream->ctxt->input->cur[0] == '<' &&
2610+ theFragmentStream->ctxt->input->cur[1] == '/' &&
2611+ theFragmentStream->current_element_depth == 0)
2612+ {
2613+ theXQueryDiagnostics->add_error(theDocUri.empty() ?
2614+ NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR, ERROR_PARAMS( ZED( BadXMLNoOpeningTag ))) :
2615+ NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR, ERROR_PARAMS( ZED( BadXMLNoOpeningTag ), theDocUri))
2616+ );
2617+ throw 0; // the argument to throw is not used by the catch clause
2618+ }
2619+
2620+ xmlParseChunk(theFragmentStream->ctxt, (const char*)theFragmentStream->ctxt->input->cur,
2621+ theFragmentStream->ctxt->input->length, 0);
2622+
2623+ if (theFragmentStream->ctxt->input->base == (xmlChar*)(theFragmentStream->theBuffer)
2624+ &&
2625+ theFragmentStream->current_offset < getCurrentInputOffset())
2626+ theFragmentStream->current_offset = getCurrentInputOffset();
2627+
2628+ // If we didn't get an error and we haven't moved, we might have some freestanding text. Parse it as element character data.
2629+ if (theXQueryDiagnostics->errors().empty()
2630+ &&
2631+ theFragmentStream->current_offset == 0)
2632+ {
2633+ // The input has been reset by xmlStopParser()
2634+ theFragmentStream->ctxt->input->base = (xmlChar*)(theFragmentStream->theBuffer);
2635+ theFragmentStream->ctxt->input->cur = theFragmentStream->ctxt->input->base;
2636+ xmlParseCharData(theFragmentStream->ctxt, 0);
2637+ }
2638+
2639+ if ( ! theXQueryDiagnostics->errors().empty())
2640+ throw 0; // the argument to throw is not used by the catch clause
2641+ }
2642+
2643+ // this happens when there are tags that have not been closed
2644+ if (theFragmentStream->stream_is_consumed()
2645+ &&
2646+ theFragmentStream->current_element_depth > 0)
2647+ {
2648+ theXQueryDiagnostics->add_error(theDocUri.empty() ?
2649+ NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR, ERROR_PARAMS( ZED( BadXMLDocument_2o ))) :
2650+ NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR, ERROR_PARAMS( ZED( BadXMLDocument_2o ), theDocUri))
2651+ );
2652+ throw 0;
2653+ }
2654+
2655+ FragmentXmlLoader::endDocument(theFragmentStream->ctxt->userData); // this would not be called otherwise
2656 }
2657 catch (...)
2658 {
2659@@ -228,49 +317,36 @@
2660 return NULL;
2661 }
2662
2663- bool ok = ctxt->wellFormed != 0;
2664-
2665 // The doc may be well formed, but it may have other kinds of errors, e.g., unresolved ns prefixes.
2666 if (!theXQueryDiagnostics->errors().empty())
2667 {
2668 abortload();
2669 return NULL;
2670 }
2671- else if (!ok )
2672+ else if ( ! theFragmentStream->ctxt->wellFormed)
2673 {
2674- if (!theDocUri.empty())
2675- {
2676- theXQueryDiagnostics->
2677- add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR,
2678- ERROR_PARAMS(ZED(BadXMLDocument_2o), theDocUri)));
2679- }
2680- else
2681- {
2682- theXQueryDiagnostics->
2683- add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR,
2684- ERROR_PARAMS(ZED(BadXMLDocument_2o))));
2685- }
2686+ theXQueryDiagnostics->add_error(theDocUri.empty() ?
2687+ NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR, ERROR_PARAMS( ZED( BadXMLDocument_2o ))) :
2688+ NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR, ERROR_PARAMS( ZED( BadXMLDocument_2o ), theDocUri))
2689+ );
2690 abortload();
2691 return NULL;
2692 }
2693- else if ( ctxt->lastError.code != XML_ERR_OK )
2694+ else if (theFragmentStream->ctxt->lastError.code != XML_ERR_OK)
2695 {
2696- if ( ctxt->lastError.code == XML_NS_ERR_UNDEFINED_NAMESPACE ||
2697- ctxt->lastError.code != XML_ERR_NO_DTD )
2698+ if (theFragmentStream->ctxt->lastError.code == XML_NS_ERR_UNDEFINED_NAMESPACE
2699+ ||
2700+ theFragmentStream->ctxt->lastError.code != XML_ERR_NO_DTD )
2701 {
2702- theXQueryDiagnostics->
2703- add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR,
2704- ERROR_PARAMS(ZED(BadXMLDocument_2o))));
2705-
2706+ theXQueryDiagnostics->add_error(theDocUri.empty() ?
2707+ NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR, ERROR_PARAMS( ZED( BadXMLDocument_2o ))) :
2708+ NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR, ERROR_PARAMS( ZED( BadXMLDocument_2o ), theDocUri))
2709+ );
2710 abortload();
2711 return NULL;
2712 }
2713 }
2714
2715- xmlCtxtReset(ctxt);
2716- xmlFreeParserCtxt(ctxt);
2717- ctxt = NULL;
2718-
2719 thePathStack.pop();
2720 assert(thePathStack.empty());
2721
2722@@ -280,23 +356,59 @@
2723 return resultNode;
2724 }
2725
2726-
2727-void FragmentXmlLoader::checkStopParsing(void* ctx)
2728-{
2729- FragmentXmlLoader& loader = *(static_cast<FragmentXmlLoader*>(ctx));
2730- ZORBA_LOADER_CHECK_ERROR(loader);
2731-
2732- if (loader.element_depth == 0)
2733- {
2734- /* if (loader.ctxt->inputNr <= 1)
2735- loader.theFragmentStream->current_offset = loader.theFragmentStream->buffer_size;
2736- else */
2737- loader.theFragmentStream->current_offset += (loader.ctxt->input->cur - loader.ctxt->input->base)
2738- + loader.ctxt->input->consumed;
2739- xmlStopParser(loader.ctxt);
2740- }
2741-}
2742-
2743+unsigned long FragmentXmlLoader::getCurrentInputOffset() const
2744+{
2745+ unsigned long offset = theFragmentStream->ctxt->input->cur
2746+ - theFragmentStream->ctxt->input->base
2747+ + theFragmentStream->ctxt->input->consumed;
2748+
2749+ return offset;
2750+}
2751+
2752+void FragmentXmlLoader::checkStopParsing(void* ctx, bool force)
2753+{
2754+ FragmentXmlLoader& loader = *(static_cast<FragmentXmlLoader*>(ctx));
2755+ ZORBA_LOADER_CHECK_ERROR(loader);
2756+
2757+ unsigned long offset = loader.getCurrentInputOffset();
2758+
2759+ if (force
2760+ ||
2761+ loader.theFragmentStream->current_element_depth == 0
2762+ ||
2763+ (offset >= loader.theFragmentStream->bytes_in_buffer
2764+ &&
2765+ loader.theFragmentStream->reached_eof)
2766+ ||
2767+ (loader.theFragmentStream->current_element_depth <= loader.theFragmentStream->root_elements_to_skip
2768+ &&
2769+ loader.theFragmentStream->parsed_nodes_count >= FragmentIStream::PARSED_NODES_BATCH_SIZE))
2770+ {
2771+ loader.theFragmentStream->current_offset = offset;
2772+ xmlStopParser(loader.theFragmentStream->ctxt);
2773+ loader.theFragmentStream->ctxt->errNo = XML_SCHEMAV_MISC; // fake error to force stopping
2774+ loader.theFragmentStream->forced_parser_stop = true;
2775+ }
2776+
2777+ loader.theFragmentStream->parsed_nodes_count++;
2778+}
2779+
2780+void FragmentXmlLoader::startDocument(void * ctx)
2781+{
2782+ FragmentXmlLoader& loader = *(static_cast<FragmentXmlLoader*>(ctx));
2783+ ZORBA_LOADER_CHECK_ERROR(loader);
2784+ FastXmlLoader::startDocument(ctx);
2785+ if (loader.theFragmentStream->first_start_doc)
2786+ {
2787+ loader.theFragmentStream->first_start_doc = false;
2788+ FragmentXmlLoader::checkStopParsing(ctx, true);
2789+ }
2790+}
2791+
2792+void FragmentXmlLoader::endDocument(void * ctx)
2793+{
2794+ FastXmlLoader::endDocument(ctx);
2795+}
2796
2797 void FragmentXmlLoader::startElement(
2798 void * ctx,
2799@@ -309,27 +421,34 @@
2800 int nb_defaulted,
2801 const xmlChar ** attributes)
2802 {
2803- FastXmlLoader::startElement(ctx, localname, prefix, URI, nb_namespaces, namespaces, nb_attributes, nb_defaulted, attributes);
2804-
2805 FragmentXmlLoader& loader = *(static_cast<FragmentXmlLoader*>(ctx));
2806 ZORBA_LOADER_CHECK_ERROR(loader);
2807- loader.element_depth++;
2808+ loader.theFragmentStream->current_element_depth++;
2809+ if (loader.theFragmentStream->current_element_depth > loader.theFragmentStream->root_elements_to_skip)
2810+ {
2811+ const xmlChar** nsTab = namespaces;
2812+
2813+ if (loader.theFragmentStream->current_element_depth == loader.theFragmentStream->root_elements_to_skip + 1)
2814+ {
2815+ nsTab = loader.theFragmentStream->ctxt->nsTab;
2816+ nb_namespaces = loader.theFragmentStream->ctxt->nsNr/2;
2817+ }
2818+
2819+ FastXmlLoader::startElement(ctx, localname, prefix, URI, nb_namespaces, nsTab, nb_attributes, nb_defaulted, attributes);
2820+ }
2821 }
2822
2823-
2824 void FragmentXmlLoader::endElement(
2825 void * ctx,
2826 const xmlChar * localname,
2827 const xmlChar * prefix,
2828 const xmlChar * URI)
2829 {
2830- FastXmlLoader::endElement(ctx, localname, prefix, URI);
2831-
2832 FragmentXmlLoader& loader = *(static_cast<FragmentXmlLoader*>(ctx));
2833 ZORBA_LOADER_CHECK_ERROR(loader);
2834-
2835- loader.element_depth--;
2836-
2837+ if (loader.theFragmentStream->current_element_depth > loader.theFragmentStream->root_elements_to_skip)
2838+ FastXmlLoader::endElement(ctx, localname, prefix, URI);
2839+ loader.theFragmentStream->current_element_depth--;
2840 checkStopParsing(ctx);
2841 }
2842
2843@@ -338,7 +457,10 @@
2844 const xmlChar * ch,
2845 int len)
2846 {
2847- FastXmlLoader::characters(ctx, ch, len);
2848+ FragmentXmlLoader& loader = *(static_cast<FragmentXmlLoader*>(ctx));
2849+ ZORBA_LOADER_CHECK_ERROR(loader);
2850+ if (loader.theFragmentStream->current_element_depth >= loader.theFragmentStream->root_elements_to_skip)
2851+ FastXmlLoader::characters(ctx, ch, len);
2852 checkStopParsing(ctx);
2853 }
2854
2855@@ -347,7 +469,10 @@
2856 void * ctx,
2857 const xmlChar * value)
2858 {
2859- FastXmlLoader::comment(ctx, value);
2860+ FragmentXmlLoader& loader = *(static_cast<FragmentXmlLoader*>(ctx));
2861+ ZORBA_LOADER_CHECK_ERROR(loader);
2862+ if (loader.theFragmentStream->current_element_depth >= loader.theFragmentStream->root_elements_to_skip)
2863+ FastXmlLoader::comment(ctx, value);
2864 checkStopParsing(ctx);
2865 }
2866
2867@@ -357,7 +482,10 @@
2868 const xmlChar * value,
2869 int len)
2870 {
2871- FastXmlLoader::cdataBlock(ctx, value, len);
2872+ FragmentXmlLoader& loader = *(static_cast<FragmentXmlLoader*>(ctx));
2873+ ZORBA_LOADER_CHECK_ERROR(loader);
2874+ if (loader.theFragmentStream->current_element_depth >= loader.theFragmentStream->root_elements_to_skip)
2875+ FastXmlLoader::cdataBlock(ctx, value, len);
2876 checkStopParsing(ctx);
2877 }
2878
2879@@ -367,7 +495,10 @@
2880 const xmlChar * target,
2881 const xmlChar * data)
2882 {
2883- FastXmlLoader::processingInstruction(ctx, target, data);
2884+ FragmentXmlLoader& loader = *(static_cast<FragmentXmlLoader*>(ctx));
2885+ ZORBA_LOADER_CHECK_ERROR(loader);
2886+ if (loader.theFragmentStream->current_element_depth >= loader.theFragmentStream->root_elements_to_skip)
2887+ FastXmlLoader::processingInstruction(ctx, target, data);
2888 checkStopParsing(ctx);
2889 }
2890
2891@@ -378,14 +509,13 @@
2892 DtdXmlLoader::DtdXmlLoader(
2893 BasicItemFactory* factory,
2894 XQueryDiagnostics* xqueryDiagnostics,
2895- bool dataguide,
2896- bool parseExtParsedEntity)
2897+ const store::LoadProperties& loadProperties,
2898+ bool dataguide)
2899 :
2900- XmlLoader(factory, xqueryDiagnostics, dataguide),
2901+ XmlLoader(factory, xqueryDiagnostics, loadProperties, dataguide),
2902 theTree(NULL),
2903 theRootNode(NULL),
2904- theNodeStack(2048),
2905- theParseExtParsedEntity(parseExtParsedEntity)
2906+ theNodeStack(2048)
2907 {
2908 theOrdPath.init();
2909
2910@@ -511,10 +641,7 @@
2911 Return the number of bytes actually read, throw an exception if any I/O
2912 error occured.
2913 ********************************************************************************/
2914-std::streamsize DtdXmlLoader::readPacket(
2915- std::istream& stream,
2916- char* buf,
2917- std::streamoff size)
2918+std::streamsize DtdXmlLoader::readPacket(std::istream& stream, char* buf, std::streamoff size)
2919 {
2920 try
2921 {
2922@@ -626,23 +753,26 @@
2923 }
2924
2925 // Set the LibXml DTD validation options
2926+ /*
2927 int options = XML_PARSE_COMPACT;
2928 options |= XML_PARSE_DTDVALID;
2929 options |= XML_PARSE_DTDLOAD;
2930+ */
2931 //options |= XML_PARSE_SAX1;
2932 //xmlSAXDefaultVersion(1);
2933
2934+ // xmlCtxtUseOptions(ctxt, options);
2935+
2936 xmlLoadExtDtdDefaultValue |= XML_DETECT_IDS;
2937 xmlLoadExtDtdDefaultValue |= XML_COMPLETE_ATTRS;
2938
2939- xmlCtxtUseOptions(ctxt, options);
2940+ // Apply loader options
2941+ applyLoadOptions(theLoadProperties, ctxt);
2942
2943 if ( xmlParseDocument(ctxt)==-1 )
2944 {
2945 // std::cout << " xmlParseDocument: Error: Unable to create tree: " << ctxt->lastError.message << std::endl;
2946- theXQueryDiagnostics->
2947- add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR,
2948- ERROR_PARAMS(ZED(ParserNoCreateTree))));
2949+ theXQueryDiagnostics->add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR,ERROR_PARAMS( ZED( ParserNoCreateTree ) )));
2950 abortload();
2951 return NULL;
2952 }
2953@@ -667,15 +797,21 @@
2954 {
2955 if (!theDocUri.empty())
2956 {
2957- theXQueryDiagnostics->
2958- add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR,
2959- ERROR_PARAMS(ZED(BadXMLDocument_2o), theDocUri)));
2960+ theXQueryDiagnostics->add_error(
2961+ NEW_ZORBA_EXCEPTION(
2962+ zerr::ZSTR0021_LOADER_PARSING_ERROR,
2963+ ERROR_PARAMS( ZED( BadXMLDocument_2o ), theDocUri )
2964+ )
2965+ );
2966 }
2967 else
2968 {
2969- theXQueryDiagnostics->
2970- add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR,
2971- ERROR_PARAMS(ZED(BadXMLDocument_2o))));
2972+ theXQueryDiagnostics->add_error(
2973+ NEW_ZORBA_EXCEPTION(
2974+ zerr::ZSTR0021_LOADER_PARSING_ERROR,
2975+ ERROR_PARAMS( ZED( BadXMLDocument_2o ) )
2976+ )
2977+ );
2978 }
2979
2980 abortload();
2981@@ -691,9 +827,12 @@
2982 if ( ctxt->lastError.code == XML_NS_ERR_UNDEFINED_NAMESPACE ||
2983 ctxt->lastError.code != XML_ERR_NO_DTD )
2984 {
2985- theXQueryDiagnostics->
2986- add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR,
2987- ERROR_PARAMS(ZED(BadXMLDocument_2o))));
2988+ theXQueryDiagnostics->add_error(
2989+ NEW_ZORBA_EXCEPTION(
2990+ zerr::ZSTR0021_LOADER_PARSING_ERROR,
2991+ ERROR_PARAMS( ZED( BadXMLDocument_2o ) )
2992+ )
2993+ );
2994 abortload();
2995 return NULL;
2996
2997@@ -704,10 +843,12 @@
2998 xmlDoc *doc = ctxt->myDoc;
2999 if (doc == NULL)
3000 {
3001- theXQueryDiagnostics->
3002- add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR,
3003- ERROR_PARAMS(ZED(ParserNoCreateTree))));
3004-
3005+ theXQueryDiagnostics->add_error(
3006+ NEW_ZORBA_EXCEPTION(
3007+ zerr::ZSTR0021_LOADER_PARSING_ERROR,
3008+ ERROR_PARAMS( ZED( ParserNoCreateTree ) )
3009+ )
3010+ );
3011 abortload();
3012 return NULL;
3013 }
3014@@ -859,8 +1000,9 @@
3015 }
3016 catch (...)
3017 {
3018- loader.theXQueryDiagnostics->
3019- add_error(NEW_ZORBA_EXCEPTION(zerr::ZXQP0003_INTERNAL_ERROR));
3020+ loader.theXQueryDiagnostics->add_error(
3021+ NEW_ZORBA_EXCEPTION( zerr::ZXQP0003_INTERNAL_ERROR )
3022+ );
3023 }
3024 }
3025
3026
3027=== modified file 'src/store/naive/loader_fast.cpp'
3028--- src/store/naive/loader_fast.cpp 2012-02-15 10:25:02 +0000
3029+++ src/store/naive/loader_fast.cpp 2012-03-15 17:04:36 +0000
3030@@ -76,9 +76,10 @@
3031 FastXmlLoader::FastXmlLoader(
3032 BasicItemFactory* factory,
3033 XQueryDiagnostics* xqueryDiagnostics,
3034+ const store::LoadProperties& loadProperties,
3035 bool dataguide)
3036 :
3037- XmlLoader(factory, xqueryDiagnostics, dataguide),
3038+ XmlLoader(factory, xqueryDiagnostics, loadProperties, dataguide),
3039 theTree(NULL),
3040 theRootNode(NULL),
3041 theNodeStack(2048)
3042@@ -298,6 +299,13 @@
3043 static_cast<int>(numChars),
3044 docUri.c_str());
3045
3046+ // Apply loader options
3047+ store::LoadProperties new_props = theLoadProperties;
3048+ new_props.setSubstituteEntities(true); // This is required for some Zorba tests,
3049+ // e.g. rbkt/Queries/zorba/entity/entity.xq
3050+ // It should probably be handled in a different way
3051+ applyLoadOptions(new_props, ctxt);
3052+
3053 if (ctxt == NULL)
3054 {
3055 theXQueryDiagnostics->
3056
3057=== modified file 'src/store/naive/simple_store.cpp'
3058--- src/store/naive/simple_store.cpp 2012-03-13 10:04:44 +0000
3059+++ src/store/naive/simple_store.cpp 2012-03-15 17:04:36 +0000
3060@@ -354,7 +354,7 @@
3061 std::cerr << "Reference: " << (*iter).second
3062 << "is still in the nodes to references map" << std::endl;
3063 }
3064- ZORBA_FATAL(0, theNodeToReferencesMap.size() +
3065+ ZORBA_FATAL(0, theNodeToReferencesMap.size() +
3066 " node references still in the nodes to references map");
3067 }
3068
3069@@ -364,7 +364,7 @@
3070 RefNodeMap::iterator end = theReferencesToNodeMap.end();
3071 for (; iter != end; ++iter)
3072 {
3073- std::cerr << "Reference: " << (*iter).first
3074+ std::cerr << "Reference: " << (*iter).first
3075 << "is still in the references to nodes map" << std::endl;
3076 }
3077 ZORBA_FATAL(0, theReferencesToNodeMap.size() +
3078@@ -490,18 +490,20 @@
3079 XmlLoader* SimpleStore::getXmlLoader(XQueryDiagnostics* aXQueryDiagnostics,
3080 const store::LoadProperties& loadProperties)
3081 {
3082- if (loadProperties.getEnableExtParsedEntity())
3083+ if (loadProperties.getParseExternalParsedEntity())
3084 return new FragmentXmlLoader(theItemFactory,
3085 aXQueryDiagnostics,
3086+ loadProperties,
3087 store::Properties::instance()->buildDataguide());
3088- else if (loadProperties.getEnableDtd())
3089+ else if (loadProperties.getDTDValidate())
3090 return new DtdXmlLoader(theItemFactory,
3091 aXQueryDiagnostics,
3092- store::Properties::instance()->buildDataguide(),
3093- loadProperties.getEnableExtParsedEntity());
3094+ loadProperties,
3095+ store::Properties::instance()->buildDataguide());
3096 else
3097 return new FastXmlLoader(theItemFactory,
3098 aXQueryDiagnostics,
3099+ loadProperties,
3100 store::Properties::instance()->buildDataguide());
3101 }
3102
3103@@ -987,7 +989,7 @@
3104 return NULL;
3105
3106 store::Collection_t collection;
3107- if (theCollections->get(aName, collection, aDynamicCollection))
3108+ if (theCollections->get(aName, collection, aDynamicCollection))
3109 {
3110 return collection;
3111 }
3112@@ -1315,7 +1317,7 @@
3113 Computes the Structural Reference for the given node.
3114 ********************************************************************************/
3115 bool SimpleStore::getStructuralInformation(
3116- store::Item_t& result,
3117+ store::Item_t& result,
3118 const store::Item* node)
3119 {
3120 #ifdef TEXT_ORDPATH
3121@@ -1355,7 +1357,7 @@
3122
3123 /*******************************************************************************
3124 Computes the reference of the given node.
3125-
3126+
3127 @param node XDM node
3128 @return the identifier as an item of type xs:anyURI
3129 ********************************************************************************/
3130@@ -1388,7 +1390,7 @@
3131
3132 /*******************************************************************************
3133 Returns the node which is identified by the given reference.
3134-
3135+
3136 @param reference an xs:anyURI item
3137 @result the node identified by the reference, or NULL if no node with the given
3138 reference exists
3139@@ -1417,7 +1419,7 @@
3140
3141 /*******************************************************************************
3142 Returns whether a reference has already been generated for the given node.
3143-
3144+
3145 @param item XDM node
3146 @return whether a reference has already been generated for the given node.
3147 ********************************************************************************/
3148@@ -1429,7 +1431,7 @@
3149
3150 /*******************************************************************************
3151 Removes a node from the reference-to-nodes and nodes-to-references maps.
3152-
3153+
3154 @param node XDM node
3155 @return whether the node was registered or not.
3156 ********************************************************************************/
3157
3158=== modified file 'src/types/typeimpl.cpp'
3159--- src/types/typeimpl.cpp 2012-01-10 10:52:15 +0000
3160+++ src/types/typeimpl.cpp 2012-03-15 17:04:36 +0000
3161@@ -361,7 +361,7 @@
3162
3163
3164 bool NodeXQType::is_subtype(
3165- const TypeManager* tm,
3166+ const TypeManager* tm,
3167 const NodeXQType& supertype,
3168 const QueryLoc& loc) const
3169 {
3170@@ -443,7 +443,7 @@
3171
3172
3173 bool NodeXQType::is_supertype(
3174- const TypeManager* tm,
3175+ const TypeManager* tm,
3176 const store::Item* subitem,
3177 const QueryLoc& loc) const
3178 {
3179@@ -488,14 +488,30 @@
3180 }
3181 }
3182
3183- if (m_node_kind != store::StoreConsts::elementNode &&
3184- m_node_kind != store::StoreConsts::attributeNode)
3185+ // document-node( E ) matches any document node that contains exactly one element
3186+ // node, optionally accompanied by one or more comment and processing instruction
3187+ // nodes, if E is an ElementTest or SchemaElementTest that matches the element node.
3188+ bool is_element_test = (
3189+ m_node_kind == store::StoreConsts::documentNode &&
3190+ m_content_type != NULL &&
3191+ m_content_type->type_kind() == XQType::NODE_TYPE_KIND &&
3192+ dynamic_cast<const NodeXQType*>(m_content_type.getp())->m_schema_test == false);
3193+
3194+ if (m_node_kind != store::StoreConsts::elementNode &&
3195+ m_node_kind != store::StoreConsts::attributeNode &&
3196+ !is_element_test)
3197 return true;
3198
3199 if (m_content_type == NULL ||
3200 m_content_type->type_kind() == XQType::ANY_TYPE_KIND)
3201 return true;
3202
3203+ if (is_element_test)
3204+ {
3205+ xqtref_t documentNodeType = tm->create_value_type(subitem, loc);
3206+ return TypeOps::is_subtype(tm, *documentNodeType, *this);
3207+ }
3208+
3209 xqtref_t subContentType = tm->create_named_type(subitem->getType(),
3210 TypeConstants::QUANT_ONE,
3211 loc,
3212
3213=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-01.xml.res'
3214--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-01.xml.res 1970-01-01 00:00:00 +0000
3215+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-01.xml.res 2012-03-15 17:04:36 +0000
3216@@ -0,0 +1,2 @@
3217+<?xml version="1.0" encoding="UTF-8"?>
3218+<from1>Jani</from1>
3219\ No newline at end of file
3220
3221=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-02.xml.res'
3222--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-02.xml.res 1970-01-01 00:00:00 +0000
3223+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-02.xml.res 2012-03-15 17:04:36 +0000
3224@@ -0,0 +1,6 @@
3225+<?xml version="1.0" encoding="UTF-8"?>
3226+
3227+ <from1>Jani1</from1>
3228+ <from2>Jani2</from2>
3229+ <from3>Jani3</from3>
3230+
3231
3232=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-03.xml.res'
3233--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-03.xml.res 1970-01-01 00:00:00 +0000
3234+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-03.xml.res 2012-03-15 17:04:36 +0000
3235@@ -0,0 +1,2 @@
3236+<?xml version="1.0" encoding="UTF-8"?>
3237+Jani1Jani2Jani3
3238
3239=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-04.xml.res'
3240--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-04.xml.res 1970-01-01 00:00:00 +0000
3241+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-04.xml.res 2012-03-15 17:04:36 +0000
3242@@ -0,0 +1,12 @@
3243+<?xml version="1.0" encoding="UTF-8"?>
3244+<root>
3245+ <root2>
3246+ <from1>Jani1</from1>
3247+ </root2>
3248+ <root2>
3249+ <from2>Jani2</from2>
3250+ </root2>
3251+ <root2>
3252+ <from3>Jani3</from3>
3253+ </root2>
3254+</root>
3255
3256=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-05.xml.res'
3257--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-05.xml.res 1970-01-01 00:00:00 +0000
3258+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-05.xml.res 2012-03-15 17:04:36 +0000
3259@@ -0,0 +1,12 @@
3260+<?xml version="1.0" encoding="UTF-8"?>
3261+
3262+ <root2>
3263+ <from1>Jani1</from1>
3264+ </root2>
3265+ <root2>
3266+ <from2>Jani2</from2>
3267+ </root2>
3268+ <root2>
3269+ <from3>Jani3</from3>
3270+ </root2>
3271+
3272
3273=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-06.xml.res'
3274--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-06.xml.res 1970-01-01 00:00:00 +0000
3275+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-06.xml.res 2012-03-15 17:04:36 +0000
3276@@ -0,0 +1,8 @@
3277+<?xml version="1.0" encoding="UTF-8"?>
3278+
3279+ <from1>Jani1</from1>
3280+
3281+ <from2>Jani2</from2>
3282+
3283+ <from3>Jani3</from3>
3284+
3285
3286=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-07.xml.res'
3287--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-07.xml.res 1970-01-01 00:00:00 +0000
3288+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-07.xml.res 2012-03-15 17:04:36 +0000
3289@@ -0,0 +1,2 @@
3290+<?xml version="1.0" encoding="UTF-8"?>
3291+Jani1Jani2Jani3
3292
3293=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-08.xml.res'
3294--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-08.xml.res 1970-01-01 00:00:00 +0000
3295+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-08.xml.res 2012-03-15 17:04:36 +0000
3296@@ -0,0 +1,2 @@
3297+<?xml version="1.0" encoding="UTF-8"?>
3298+<root><from1>Jani1</from1></root>
3299
3300=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-09.xml.res'
3301--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-09.xml.res 1970-01-01 00:00:00 +0000
3302+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-09.xml.res 2012-03-15 17:04:36 +0000
3303@@ -0,0 +1,2 @@
3304+<?xml version="1.0" encoding="UTF-8"?>
3305+<from1>Jani1</from1>
3306
3307=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-10.xml.res'
3308--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-10.xml.res 1970-01-01 00:00:00 +0000
3309+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-10.xml.res 2012-03-15 17:04:36 +0000
3310@@ -0,0 +1,2 @@
3311+<?xml version="1.0" encoding="UTF-8"?>
3312+Jani1
3313
3314=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-11.xml.res'
3315--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-11.xml.res 1970-01-01 00:00:00 +0000
3316+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-11.xml.res 2012-03-15 17:04:36 +0000
3317@@ -0,0 +1,2 @@
3318+<?xml version="1.0" encoding="UTF-8"?>
3319+
3320
3321=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-12.xml.res'
3322--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-12.xml.res 1970-01-01 00:00:00 +0000
3323+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-12.xml.res 2012-03-15 17:04:36 +0000
3324@@ -0,0 +1,2 @@
3325+<?xml version="1.0" encoding="UTF-8"?>
3326+Jani1
3327
3328=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-13.xml.res'
3329--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-13.xml.res 1970-01-01 00:00:00 +0000
3330+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-13.xml.res 2012-03-15 17:04:36 +0000
3331@@ -0,0 +1,2 @@
3332+<?xml version="1.0" encoding="UTF-8"?>
3333+<from1>Jani1</from1>
3334
3335=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-14.xml.res'
3336--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-14.xml.res 1970-01-01 00:00:00 +0000
3337+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-14.xml.res 2012-03-15 17:04:36 +0000
3338@@ -0,0 +1,2 @@
3339+<?xml version="1.0" encoding="UTF-8"?>
3340+Jani1
3341
3342=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-15.xml.res'
3343--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-15.xml.res 1970-01-01 00:00:00 +0000
3344+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-15.xml.res 2012-03-15 17:04:36 +0000
3345@@ -0,0 +1,2 @@
3346+<?xml version="1.0" encoding="UTF-8"?>
3347+Jani1
3348
3349=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-16.xml.res'
3350--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-16.xml.res 1970-01-01 00:00:00 +0000
3351+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-16.xml.res 2012-03-15 17:04:36 +0000
3352@@ -0,0 +1,2 @@
3353+<?xml version="1.0" encoding="UTF-8"?>
3354+Jani1
3355
3356=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-17.xml.res'
3357--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-17.xml.res 1970-01-01 00:00:00 +0000
3358+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-17.xml.res 2012-03-15 17:04:36 +0000
3359@@ -0,0 +1,2 @@
3360+<?xml version="1.0" encoding="UTF-8"?>
3361+root3 text<from1>Jani1</from1>
3362
3363=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-18.xml.res'
3364--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-18.xml.res 1970-01-01 00:00:00 +0000
3365+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-18.xml.res 2012-03-15 17:04:36 +0000
3366@@ -0,0 +1,2 @@
3367+<?xml version="1.0" encoding="UTF-8"?>
3368+Jani1
3369
3370=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-19.xml.res'
3371--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-19.xml.res 1970-01-01 00:00:00 +0000
3372+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-19.xml.res 2012-03-15 17:04:36 +0000
3373@@ -0,0 +1,8 @@
3374+<?xml version="1.0" encoding="UTF-8"?>
3375+<level1>
3376+ <level2>
3377+ <level3>
3378+ <level4>level4 text</level4>
3379+ </level3>
3380+ </level2>
3381+</level1>
3382
3383=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-20.xml.res'
3384--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-20.xml.res 1970-01-01 00:00:00 +0000
3385+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-20.xml.res 2012-03-15 17:04:36 +0000
3386@@ -0,0 +1,8 @@
3387+<?xml version="1.0" encoding="UTF-8"?>
3388+
3389+ <level2>
3390+ <level3>
3391+ <level4>level4 text</level4>
3392+ </level3>
3393+ </level2>
3394+
3395
3396=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-21.xml.res'
3397--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-21.xml.res 1970-01-01 00:00:00 +0000
3398+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-21.xml.res 2012-03-15 17:04:36 +0000
3399@@ -0,0 +1,6 @@
3400+<?xml version="1.0" encoding="UTF-8"?>
3401+
3402+ <level3>
3403+ <level4>level4 text</level4>
3404+ </level3>
3405+
3406
3407=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-22.xml.res'
3408--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-22.xml.res 1970-01-01 00:00:00 +0000
3409+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-22.xml.res 2012-03-15 17:04:36 +0000
3410@@ -0,0 +1,4 @@
3411+<?xml version="1.0" encoding="UTF-8"?>
3412+
3413+ <level4>level4 text</level4>
3414+
3415
3416=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-23.xml.res'
3417--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-23.xml.res 1970-01-01 00:00:00 +0000
3418+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-23.xml.res 2012-03-15 17:04:36 +0000
3419@@ -0,0 +1,2 @@
3420+<?xml version="1.0" encoding="UTF-8"?>
3421+level4 text
3422
3423=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-24.xml.res'
3424--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-24.xml.res 1970-01-01 00:00:00 +0000
3425+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-24.xml.res 2012-03-15 17:04:36 +0000
3426@@ -0,0 +1,5 @@
3427+<?xml version="1.0" encoding="UTF-8"?>
3428+
3429+ <level4>level4 text</level4>
3430+ level3 end
3431+
3432
3433=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-25.xml.res'
3434--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-25.xml.res 1970-01-01 00:00:00 +0000
3435+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-25.xml.res 2012-03-15 17:04:36 +0000
3436@@ -0,0 +1,14 @@
3437+<?xml version="1.0" encoding="UTF-8"?>
3438+<level1>
3439+ level1 text start
3440+ <level2>
3441+ level2 text start
3442+ <level3>
3443+ level3 text start
3444+ <level4>level4 text</level4>
3445+ level3 text end
3446+ </level3>
3447+ level2 text end
3448+ </level2>
3449+ level1 text end
3450+</level1>
3451
3452=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-26.xml.res'
3453--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-26.xml.res 1970-01-01 00:00:00 +0000
3454+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-26.xml.res 2012-03-15 17:04:36 +0000
3455@@ -0,0 +1,14 @@
3456+<?xml version="1.0" encoding="UTF-8"?>
3457+
3458+ level1 text start
3459+ <level2>
3460+ level2 text start
3461+ <level3>
3462+ level3 text start
3463+ <level4>level4 text</level4>
3464+ level3 text end
3465+ </level3>
3466+ level2 text end
3467+ </level2>
3468+ level1 text end
3469+
3470
3471=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-27.xml.res'
3472--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-27.xml.res 1970-01-01 00:00:00 +0000
3473+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-27.xml.res 2012-03-15 17:04:36 +0000
3474@@ -0,0 +1,10 @@
3475+<?xml version="1.0" encoding="UTF-8"?>
3476+
3477+ level2 text start
3478+ <level3>
3479+ level3 text start
3480+ <level4>level4 text</level4>
3481+ level3 text end
3482+ </level3>
3483+ level2 text end
3484+
3485
3486=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-28.xml.res'
3487--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-28.xml.res 1970-01-01 00:00:00 +0000
3488+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-28.xml.res 2012-03-15 17:04:36 +0000
3489@@ -0,0 +1,6 @@
3490+<?xml version="1.0" encoding="UTF-8"?>
3491+
3492+ level3 text start
3493+ <level4>level4 text</level4>
3494+ level3 text end
3495+
3496
3497=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-29.xml.res'
3498--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-29.xml.res 1970-01-01 00:00:00 +0000
3499+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-29.xml.res 2012-03-15 17:04:36 +0000
3500@@ -0,0 +1,2 @@
3501+<?xml version="1.0" encoding="UTF-8"?>
3502+level4 text
3503
3504=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-30.xml.res'
3505--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-30.xml.res 1970-01-01 00:00:00 +0000
3506+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-30.xml.res 2012-03-15 17:04:36 +0000
3507@@ -0,0 +1,2 @@
3508+<?xml version="1.0" encoding="UTF-8"?>
3509+
3510
3511=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-31.xml.res'
3512--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-31.xml.res 1970-01-01 00:00:00 +0000
3513+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-31.xml.res 2012-03-15 17:04:36 +0000
3514@@ -0,0 +1,59 @@
3515+<?xml version="1.0" encoding="UTF-8"?>
3516+
3517+level0 text
3518+<level1>
3519+ level1 text start
3520+ <level2>
3521+ level2 text start
3522+ <level3>
3523+ level3 text start
3524+ <level4>level4 text</level4>
3525+ level3 text end
3526+ </level3>
3527+ level2 text end
3528+ </level2>
3529+ level1 text end
3530+</level1>
3531+level0 text
3532+<level1>
3533+ level1 text start
3534+ <level2>
3535+ level2 text start
3536+ <level3>
3537+ level3 text start
3538+ <level4>level4 text</level4>
3539+ level3 text end
3540+ </level3>
3541+ level2 text end
3542+ </level2>
3543+ level1 text end
3544+</level1>
3545+level0 text
3546+<level1>
3547+ level1 text start
3548+ <level2>
3549+ level2 text start
3550+ <level3>
3551+ level3 text start
3552+ <level4>level4 text</level4>
3553+ level3 text end
3554+ </level3>
3555+ level2 text end
3556+ </level2>
3557+ level1 text end
3558+</level1>
3559+level0 text
3560+<level1>
3561+ level1 text start
3562+ <level2>
3563+ level2 text start
3564+ <level3>
3565+ level3 text start
3566+ <level4>level4 text</level4>
3567+ level3 text end
3568+ </level3>
3569+ level2 text end
3570+ </level2>
3571+ level1 text end
3572+</level1>
3573+level0 text
3574
3575=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-32.xml.res'
3576--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-32.xml.res 1970-01-01 00:00:00 +0000
3577+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-32.xml.res 2012-03-15 17:04:36 +0000
3578@@ -0,0 +1,50 @@
3579+<?xml version="1.0" encoding="UTF-8"?>
3580+
3581+ level1 text start
3582+ <level2>
3583+ level2 text start
3584+ <level3>
3585+ level3 text start
3586+ <level4>level4 text</level4>
3587+ level3 text end
3588+ </level3>
3589+ level2 text end
3590+ </level2>
3591+ level1 text end
3592+
3593+ level1 text start
3594+ <level2>
3595+ level2 text start
3596+ <level3>
3597+ level3 text start
3598+ <level4>level4 text</level4>
3599+ level3 text end
3600+ </level3>
3601+ level2 text end
3602+ </level2>
3603+ level1 text end
3604+
3605+ level1 text start
3606+ <level2>
3607+ level2 text start
3608+ <level3>
3609+ level3 text start
3610+ <level4>level4 text</level4>
3611+ level3 text end
3612+ </level3>
3613+ level2 text end
3614+ </level2>
3615+ level1 text end
3616+
3617+ level1 text start
3618+ <level2>
3619+ level2 text start
3620+ <level3>
3621+ level3 text start
3622+ <level4>level4 text</level4>
3623+ level3 text end
3624+ </level3>
3625+ level2 text end
3626+ </level2>
3627+ level1 text end
3628+
3629
3630=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-33.xml.res'
3631--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-33.xml.res 1970-01-01 00:00:00 +0000
3632+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-33.xml.res 2012-03-15 17:04:36 +0000
3633@@ -0,0 +1,34 @@
3634+<?xml version="1.0" encoding="UTF-8"?>
3635+
3636+ level2 text start
3637+ <level3>
3638+ level3 text start
3639+ <level4>level4 text</level4>
3640+ level3 text end
3641+ </level3>
3642+ level2 text end
3643+
3644+ level2 text start
3645+ <level3>
3646+ level3 text start
3647+ <level4>level4 text</level4>
3648+ level3 text end
3649+ </level3>
3650+ level2 text end
3651+
3652+ level2 text start
3653+ <level3>
3654+ level3 text start
3655+ <level4>level4 text</level4>
3656+ level3 text end
3657+ </level3>
3658+ level2 text end
3659+
3660+ level2 text start
3661+ <level3>
3662+ level3 text start
3663+ <level4>level4 text</level4>
3664+ level3 text end
3665+ </level3>
3666+ level2 text end
3667+
3668
3669=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-34.xml.res'
3670--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-34.xml.res 1970-01-01 00:00:00 +0000
3671+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-34.xml.res 2012-03-15 17:04:36 +0000
3672@@ -0,0 +1,18 @@
3673+<?xml version="1.0" encoding="UTF-8"?>
3674+
3675+ level3 text start
3676+ <level4>level4 text</level4>
3677+ level3 text end
3678+
3679+ level3 text start
3680+ <level4>level4 text</level4>
3681+ level3 text end
3682+
3683+ level3 text start
3684+ <level4>level4 text</level4>
3685+ level3 text end
3686+
3687+ level3 text start
3688+ <level4>level4 text</level4>
3689+ level3 text end
3690+
3691
3692=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-35.xml.res'
3693--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-35.xml.res 1970-01-01 00:00:00 +0000
3694+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-35.xml.res 2012-03-15 17:04:36 +0000
3695@@ -0,0 +1,2 @@
3696+<?xml version="1.0" encoding="UTF-8"?>
3697+level4 textlevel4 textlevel4 textlevel4 text
3698
3699=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-36.xml.res'
3700--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-36.xml.res 1970-01-01 00:00:00 +0000
3701+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-36.xml.res 2012-03-15 17:04:36 +0000
3702@@ -0,0 +1,2 @@
3703+<?xml version="1.0" encoding="UTF-8"?>
3704+
3705
3706=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-37.xml.res'
3707--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-37.xml.res 1970-01-01 00:00:00 +0000
3708+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-37.xml.res 2012-03-15 17:04:36 +0000
3709@@ -0,0 +1,14 @@
3710+<?xml version="1.0" encoding="UTF-8"?>
3711+<doc>
3712+ <foo>0</foo>
3713+ <foo>1</foo>
3714+ <foo>2</foo>
3715+ <foo>3</foo>
3716+ <foo>4</foo>
3717+ <foo>5</foo>
3718+ <foo>6</foo>
3719+ <foo>7</foo>
3720+ <foo>8</foo>
3721+ <foo>9</foo>
3722+ <foo>10</foo>
3723+</doc>
3724
3725=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-38.xml.res'
3726--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-38.xml.res 1970-01-01 00:00:00 +0000
3727+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-38.xml.res 2012-03-15 17:04:36 +0000
3728@@ -0,0 +1,14 @@
3729+<?xml version="1.0" encoding="UTF-8"?>
3730+
3731+ <foo>0</foo>
3732+ <foo>1</foo>
3733+ <foo>2</foo>
3734+ <foo>3</foo>
3735+ <foo>4</foo>
3736+ <foo>5</foo>
3737+ <foo>6</foo>
3738+ <foo>7</foo>
3739+ <foo>8</foo>
3740+ <foo>9</foo>
3741+ <foo>10</foo>
3742+
3743
3744=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-39.xml.res'
3745--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-39.xml.res 1970-01-01 00:00:00 +0000
3746+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-39.xml.res 2012-03-15 17:04:36 +0000
3747@@ -0,0 +1,2 @@
3748+<?xml version="1.0" encoding="UTF-8"?>
3749+012345678910
3750
3751=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-40.xml.res'
3752--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-40.xml.res 1970-01-01 00:00:00 +0000
3753+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-40.xml.res 2012-03-15 17:04:36 +0000
3754@@ -0,0 +1,3 @@
3755+<?xml version="1.0" encoding="UTF-8"?>
3756+
3757+<n1:root xmlns:n1="ns" xmlns:m1="ms"><n2:root2 xmlns:n2="ns2" xmlns:m2="ms2"><n1:from1 xmlns:n3="ns3"><from2>Text from2</from2></n1:from1></n2:root2></n1:root>
3758
3759=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-41.xml.res'
3760--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-41.xml.res 1970-01-01 00:00:00 +0000
3761+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-41.xml.res 2012-03-15 17:04:36 +0000
3762@@ -0,0 +1,2 @@
3763+<?xml version="1.0" encoding="UTF-8"?>
3764+<n2:root2 xmlns:n1="ns" xmlns:m1="ms" xmlns:n2="ns2" xmlns:m2="ms2"><n1:from1 xmlns:n3="ns3"><from2>Text from2</from2></n1:from1></n2:root2>
3765
3766=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-42.xml.res'
3767--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-42.xml.res 1970-01-01 00:00:00 +0000
3768+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-42.xml.res 2012-03-15 17:04:36 +0000
3769@@ -0,0 +1,2 @@
3770+<?xml version="1.0" encoding="UTF-8"?>
3771+<n1:from1 xmlns:n1="ns" xmlns:m1="ms" xmlns:n2="ns2" xmlns:m2="ms2" xmlns:n3="ns3"><from2>Text from2</from2></n1:from1>
3772\ No newline at end of file
3773
3774=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-43.xml.res'
3775--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-43.xml.res 1970-01-01 00:00:00 +0000
3776+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-43.xml.res 2012-03-15 17:04:36 +0000
3777@@ -0,0 +1,2 @@
3778+<?xml version="1.0" encoding="UTF-8"?>
3779+<from2 xmlns:n1="ns" xmlns:m1="ms" xmlns:n2="ns2" xmlns:m2="ms2" xmlns:n3="ns3">Text from2</from2>
3780\ No newline at end of file
3781
3782=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-44.xml.res'
3783--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-44.xml.res 1970-01-01 00:00:00 +0000
3784+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-44.xml.res 2012-03-15 17:04:36 +0000
3785@@ -0,0 +1,2 @@
3786+<?xml version="1.0" encoding="UTF-8"?>
3787+Text from2
3788\ No newline at end of file
3789
3790=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-45.xml.res'
3791--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-45.xml.res 1970-01-01 00:00:00 +0000
3792+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-45.xml.res 2012-03-15 17:04:36 +0000
3793@@ -0,0 +1,2 @@
3794+<?xml version="1.0" encoding="UTF-8"?>
3795+
3796
3797=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-46.xml.res'
3798--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-46.xml.res 1970-01-01 00:00:00 +0000
3799+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-46.xml.res 2012-03-15 17:04:36 +0000
3800@@ -0,0 +1,31 @@
3801+<?xml version="1.0" encoding="UTF-8"?>
3802+
3803+level0 text
3804+<level1/>
3805+level0 text
3806+<level1/>
3807+level0 text
3808+<level1/>
3809+level0 text
3810+<level1/>
3811+level0 text
3812+<level1/>
3813+level0 text
3814+<level1/>
3815+level0 text
3816+<level1/>
3817+level0 text
3818+<level1/>
3819+level0 text
3820+<level1/>
3821+level0 text
3822+<level1/>
3823+level0 text
3824+<level1/>
3825+level0 text
3826+<level1/>
3827+level0 text
3828+<level1/>
3829+level0 text
3830+<level1/>
3831+level0 text
3832\ No newline at end of file
3833
3834=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-53.xml.res'
3835--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-53.xml.res 1970-01-01 00:00:00 +0000
3836+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-53.xml.res 2012-03-15 17:04:36 +0000
3837@@ -0,0 +1,8 @@
3838+<?xml version="1.0" encoding="UTF-8"?>
3839+<mediawiki>
3840+ <page>
3841+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
3842+
3843+ </page>
3844+</mediawiki>
3845+
3846
3847=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-54.xml.res'
3848--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-54.xml.res 1970-01-01 00:00:00 +0000
3849+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-54.xml.res 2012-03-15 17:04:36 +0000
3850@@ -0,0 +1,7 @@
3851+<?xml version="1.0" encoding="UTF-8"?>
3852+
3853+ <page>
3854+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
3855+
3856+ </page>
3857+
3858
3859=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-55.xml.res'
3860--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-55.xml.res 1970-01-01 00:00:00 +0000
3861+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-55.xml.res 2012-03-15 17:04:36 +0000
3862@@ -0,0 +1,8 @@
3863+<?xml version="1.0" encoding="UTF-8"?>
3864+<mediawiki>
3865+ <page>
3866+abababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab
3867+
3868+ </page>
3869+</mediawiki>
3870+
3871
3872=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-56.xml.res'
3873--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-56.xml.res 1970-01-01 00:00:00 +0000
3874+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-56.xml.res 2012-03-15 17:04:36 +0000
3875@@ -0,0 +1,7 @@
3876+<?xml version="1.0" encoding="UTF-8"?>
3877+
3878+ <page>
3879+abababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababababab
3880+
3881+ </page>
3882+
3883
3884=== modified file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-xml-fragment-01.xml.res' (properties changed: +x to -x)
3885=== modified file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-xml-fragment-03.xml.res' (properties changed: +x to -x)
3886=== modified file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-xml-fragment-04.xml.res' (properties changed: +x to -x)
3887=== modified file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-xml-fragment-05.xml.res' (properties changed: +x to -x)
3888=== modified file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-xml-fragment-07.xml.res' (properties changed: +x to -x)
3889=== modified file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-xml-fragment-10.xml.res' (properties changed: +x to -x)
3890=== modified file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-xml-fragment-11.xml.res' (properties changed: +x to -x)
3891=== modified file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-xml-fragment-12.xml.res' (properties changed: +x to -x)
3892--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-xml-fragment-12.xml.res 2011-07-15 16:39:51 +0000
3893+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-xml-fragment-12.xml.res 2012-03-15 17:04:36 +0000
3894@@ -1,4 +1,4 @@
3895 <?xml version="1.0" encoding="UTF-8"?>
3896 <fragment><from1>Jani</from1>
3897 <from2>Jani</from2>
3898-<from3>Jani</from3><count>5</count></fragment>
3899\ No newline at end of file
3900+<from3>Jani</from3><count>6</count></fragment>
3901\ No newline at end of file
3902
3903=== modified file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-xml-fragment-14.xml.res' (properties changed: +x to -x)
3904=== modified file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-xml-fragment-15.xml.res' (properties changed: +x to -x)
3905=== renamed file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-xml-fragment-18.xml.res' => 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-xml-fragment-16.xml.res'
3906=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-01.xq'
3907--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-01.xq 1970-01-01 00:00:00 +0000
3908+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-01.xq 2012-03-15 17:04:36 +0000
3909@@ -0,0 +1,8 @@
3910+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
3911+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3912+
3913+z:parse("<?xml version='1.0'?><root><from1>Jani</from1></root>",
3914+ <opt:options>
3915+ <opt:parse-external-parsed-entity opt:skip-root-nodes="1"/>
3916+ </opt:options>
3917+)
3918
3919=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-02.xq'
3920--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-02.xq 1970-01-01 00:00:00 +0000
3921+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-02.xq 2012-03-15 17:04:36 +0000
3922@@ -0,0 +1,13 @@
3923+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
3924+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3925+
3926+z:parse("<?xml version='1.0'?>
3927+<root>
3928+ <from1>Jani1</from1>
3929+ <from2>Jani2</from2>
3930+ <from3>Jani3</from3>
3931+</root>",
3932+ <opt:options>
3933+ <opt:parse-external-parsed-entity opt:skip-root-nodes="1"/>
3934+ </opt:options>
3935+)
3936
3937=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-03.xq'
3938--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-03.xq 1970-01-01 00:00:00 +0000
3939+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-03.xq 2012-03-15 17:04:36 +0000
3940@@ -0,0 +1,13 @@
3941+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
3942+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3943+
3944+z:parse("<?xml version='1.0'?>
3945+<root>
3946+ <from1>Jani1</from1>
3947+ <from2>Jani2</from2>
3948+ <from3>Jani3</from3>
3949+</root>",
3950+ <opt:options>
3951+ <opt:parse-external-parsed-entity opt:skip-root-nodes="2"/>
3952+ </opt:options>
3953+)
3954
3955=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-04.xq'
3956--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-04.xq 1970-01-01 00:00:00 +0000
3957+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-04.xq 2012-03-15 17:04:36 +0000
3958@@ -0,0 +1,19 @@
3959+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
3960+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3961+
3962+z:parse("<?xml version='1.0'?>
3963+<root>
3964+ <root2>
3965+ <from1>Jani1</from1>
3966+ </root2>
3967+ <root2>
3968+ <from2>Jani2</from2>
3969+ </root2>
3970+ <root2>
3971+ <from3>Jani3</from3>
3972+ </root2>
3973+</root>",
3974+ <opt:options>
3975+ <opt:parse-external-parsed-entity opt:skip-root-nodes="0"/>
3976+ </opt:options>
3977+)
3978
3979=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-05.xq'
3980--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-05.xq 1970-01-01 00:00:00 +0000
3981+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-05.xq 2012-03-15 17:04:36 +0000
3982@@ -0,0 +1,19 @@
3983+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
3984+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3985+
3986+z:parse("<?xml version='1.0'?>
3987+<root>
3988+ <root2>
3989+ <from1>Jani1</from1>
3990+ </root2>
3991+ <root2>
3992+ <from2>Jani2</from2>
3993+ </root2>
3994+ <root2>
3995+ <from3>Jani3</from3>
3996+ </root2>
3997+</root>",
3998+ <opt:options>
3999+ <opt:parse-external-parsed-entity opt:skip-root-nodes="1"/>
4000+ </opt:options>
4001+)
4002
4003=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-06.xq'
4004--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-06.xq 1970-01-01 00:00:00 +0000
4005+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-06.xq 2012-03-15 17:04:36 +0000
4006@@ -0,0 +1,19 @@
4007+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4008+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4009+
4010+z:parse("<?xml version='1.0'?>
4011+<root>
4012+ <root2>
4013+ <from1>Jani1</from1>
4014+ </root2>
4015+ <root2>
4016+ <from2>Jani2</from2>
4017+ </root2>
4018+ <root2>
4019+ <from3>Jani3</from3>
4020+ </root2>
4021+</root>",
4022+ <opt:options>
4023+ <opt:parse-external-parsed-entity opt:skip-root-nodes="2"/>
4024+ </opt:options>
4025+)
4026
4027=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-07.xq'
4028--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-07.xq 1970-01-01 00:00:00 +0000
4029+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-07.xq 2012-03-15 17:04:36 +0000
4030@@ -0,0 +1,19 @@
4031+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4032+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4033+
4034+z:parse("<?xml version='1.0'?>
4035+<root>
4036+ <root2>
4037+ <from1>Jani1</from1>
4038+ </root2>
4039+ <root2>
4040+ <from2>Jani2</from2>
4041+ </root2>
4042+ <root2>
4043+ <from3>Jani3</from3>
4044+ </root2>
4045+</root>",
4046+ <opt:options>
4047+ <opt:parse-external-parsed-entity opt:skip-root-nodes="3"/>
4048+ </opt:options>
4049+)
4050
4051=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-08.xq'
4052--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-08.xq 1970-01-01 00:00:00 +0000
4053+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-08.xq 2012-03-15 17:04:36 +0000
4054@@ -0,0 +1,9 @@
4055+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4056+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4057+
4058+z:parse("<?xml version='1.0'?>
4059+<root><from1>Jani1</from1></root>",
4060+ <opt:options>
4061+ <opt:parse-external-parsed-entity opt:skip-root-nodes="0"/>
4062+ </opt:options>
4063+)
4064
4065=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-09.xq'
4066--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-09.xq 1970-01-01 00:00:00 +0000
4067+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-09.xq 2012-03-15 17:04:36 +0000
4068@@ -0,0 +1,9 @@
4069+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4070+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4071+
4072+z:parse("<?xml version='1.0'?>
4073+<root><from1>Jani1</from1></root>",
4074+ <opt:options>
4075+ <opt:parse-external-parsed-entity opt:skip-root-nodes="1"/>
4076+ </opt:options>
4077+)
4078
4079=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-10.xq'
4080--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-10.xq 1970-01-01 00:00:00 +0000
4081+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-10.xq 2012-03-15 17:04:36 +0000
4082@@ -0,0 +1,9 @@
4083+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4084+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4085+
4086+z:parse("<?xml version='1.0'?>
4087+<root><from1>Jani1</from1></root>",
4088+ <opt:options>
4089+ <opt:parse-external-parsed-entity opt:skip-root-nodes="2"/>
4090+ </opt:options>
4091+)
4092
4093=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-11.xq'
4094--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-11.xq 1970-01-01 00:00:00 +0000
4095+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-11.xq 2012-03-15 17:04:36 +0000
4096@@ -0,0 +1,9 @@
4097+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4098+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4099+
4100+z:parse("<?xml version='1.0'?>
4101+<root><from1>Jani1</from1></root>",
4102+ <opt:options>
4103+ <opt:parse-external-parsed-entity opt:skip-root-nodes="3"/>
4104+ </opt:options>
4105+)
4106
4107=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-12.xq'
4108--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-12.xq 1970-01-01 00:00:00 +0000
4109+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-12.xq 2012-03-15 17:04:36 +0000
4110@@ -0,0 +1,9 @@
4111+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4112+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4113+
4114+z:parse("<?xml version='1.0'?>
4115+<root><root2><from1>Jani1</from1></root2></root>",
4116+ <opt:options>
4117+ <opt:parse-external-parsed-entity opt:skip-root-nodes="3"/>
4118+ </opt:options>
4119+)
4120
4121=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-13.xq'
4122--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-13.xq 1970-01-01 00:00:00 +0000
4123+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-13.xq 2012-03-15 17:04:36 +0000
4124@@ -0,0 +1,9 @@
4125+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4126+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4127+
4128+z:parse("<?xml version='1.0'?>
4129+<root><root2><root3><from1>Jani1</from1></root3></root2></root>",
4130+ <opt:options>
4131+ <opt:parse-external-parsed-entity opt:skip-root-nodes="3"/>
4132+ </opt:options>
4133+)
4134
4135=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-14.xq'
4136--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-14.xq 1970-01-01 00:00:00 +0000
4137+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-14.xq 2012-03-15 17:04:36 +0000
4138@@ -0,0 +1,9 @@
4139+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4140+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4141+
4142+z:parse("<?xml version='1.0'?>
4143+<root><root2><root3><from1>Jani1</from1></root3></root2></root>",
4144+ <opt:options>
4145+ <opt:parse-external-parsed-entity opt:skip-root-nodes="4"/>
4146+ </opt:options>
4147+)
4148
4149=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-15.xq'
4150--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-15.xq 1970-01-01 00:00:00 +0000
4151+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-15.xq 2012-03-15 17:04:36 +0000
4152@@ -0,0 +1,8 @@
4153+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4154+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4155+
4156+z:parse("<?xml version='1.0'?><root>root1 text<root2>root2 text<root3>root3 text<from1>Jani1</from1></root3></root2></root>",
4157+ <opt:options>
4158+ <opt:parse-external-parsed-entity opt:skip-root-nodes="4"/>
4159+ </opt:options>
4160+)
4161
4162=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-16.xq'
4163--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-16.xq 1970-01-01 00:00:00 +0000
4164+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-16.xq 2012-03-15 17:04:36 +0000
4165@@ -0,0 +1,8 @@
4166+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4167+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4168+
4169+z:parse("<?xml version='1.0'?><root>root1 text<root15>root15 text</root15><root2>root2 text<root3>root3 text<from1>Jani1</from1></root3></root2></root>",
4170+ <opt:options>
4171+ <opt:parse-external-parsed-entity opt:skip-root-nodes="4"/>
4172+ </opt:options>
4173+)
4174
4175=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-17.xq'
4176--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-17.xq 1970-01-01 00:00:00 +0000
4177+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-17.xq 2012-03-15 17:04:36 +0000
4178@@ -0,0 +1,8 @@
4179+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4180+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4181+
4182+z:parse("<?xml version='1.0'?><root>root1 text<root15>root15 text</root15><root2>root2 text<root3>root3 text<from1>Jani1</from1></root3></root2></root>",
4183+ <opt:options>
4184+ <opt:parse-external-parsed-entity opt:skip-root-nodes="3"/>
4185+ </opt:options>
4186+)
4187
4188=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-18.xq'
4189--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-18.xq 1970-01-01 00:00:00 +0000
4190+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-18.xq 2012-03-15 17:04:36 +0000
4191@@ -0,0 +1,9 @@
4192+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4193+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4194+
4195+z:parse("<?xml version='1.0'?>
4196+<root>Jani0<from1>Jani1</from1></root>",
4197+ <opt:options>
4198+ <opt:parse-external-parsed-entity opt:skip-root-nodes="2"/>
4199+ </opt:options>
4200+)
4201
4202=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-19.xq'
4203--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-19.xq 1970-01-01 00:00:00 +0000
4204+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-19.xq 2012-03-15 17:04:36 +0000
4205@@ -0,0 +1,15 @@
4206+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4207+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4208+
4209+z:parse("<?xml version='1.0'?>
4210+<level1>
4211+ <level2>
4212+ <level3>
4213+ <level4>level4 text</level4>
4214+ </level3>
4215+ </level2>
4216+</level1>",
4217+ <opt:options>
4218+ <opt:parse-external-parsed-entity opt:skip-root-nodes="0"/>
4219+ </opt:options>
4220+)
4221
4222=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-20.xq'
4223--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-20.xq 1970-01-01 00:00:00 +0000
4224+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-20.xq 2012-03-15 17:04:36 +0000
4225@@ -0,0 +1,15 @@
4226+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4227+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4228+
4229+z:parse("<?xml version='1.0'?>
4230+<level1>
4231+ <level2>
4232+ <level3>
4233+ <level4>level4 text</level4>
4234+ </level3>
4235+ </level2>
4236+</level1>",
4237+ <opt:options>
4238+ <opt:parse-external-parsed-entity opt:skip-root-nodes="1"/>
4239+ </opt:options>
4240+)
4241
4242=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-21.xq'
4243--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-21.xq 1970-01-01 00:00:00 +0000
4244+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-21.xq 2012-03-15 17:04:36 +0000
4245@@ -0,0 +1,15 @@
4246+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4247+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4248+
4249+z:parse("<?xml version='1.0'?>
4250+<level1>
4251+ <level2>
4252+ <level3>
4253+ <level4>level4 text</level4>
4254+ </level3>
4255+ </level2>
4256+</level1>",
4257+ <opt:options>
4258+ <opt:parse-external-parsed-entity opt:skip-root-nodes="2"/>
4259+ </opt:options>
4260+)
4261
4262=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-22.xq'
4263--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-22.xq 1970-01-01 00:00:00 +0000
4264+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-22.xq 2012-03-15 17:04:36 +0000
4265@@ -0,0 +1,15 @@
4266+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4267+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4268+
4269+z:parse("<?xml version='1.0'?>
4270+<level1>
4271+ <level2>
4272+ <level3>
4273+ <level4>level4 text</level4>
4274+ </level3>
4275+ </level2>
4276+</level1>",
4277+ <opt:options>
4278+ <opt:parse-external-parsed-entity opt:skip-root-nodes="3"/>
4279+ </opt:options>
4280+)
4281
4282=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-23.xq'
4283--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-23.xq 1970-01-01 00:00:00 +0000
4284+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-23.xq 2012-03-15 17:04:36 +0000
4285@@ -0,0 +1,15 @@
4286+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4287+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4288+
4289+z:parse("<?xml version='1.0'?>
4290+<level1>
4291+ <level2>
4292+ <level3>
4293+ <level4>level4 text</level4>
4294+ </level3>
4295+ </level2>
4296+</level1>",
4297+ <opt:options>
4298+ <opt:parse-external-parsed-entity opt:skip-root-nodes="4"/>
4299+ </opt:options>
4300+)
4301
4302=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-24.xq'
4303--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-24.xq 1970-01-01 00:00:00 +0000
4304+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-24.xq 2012-03-15 17:04:36 +0000
4305@@ -0,0 +1,16 @@
4306+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4307+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4308+
4309+z:parse("<?xml version='1.0'?>
4310+<level1>
4311+ <level2>
4312+ <level3>
4313+ <level4>level4 text</level4>
4314+ level3 end
4315+ </level3>
4316+ </level2>
4317+</level1>",
4318+ <opt:options>
4319+ <opt:parse-external-parsed-entity opt:skip-root-nodes="3"/>
4320+ </opt:options>
4321+)
4322
4323=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-25.xq'
4324--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-25.xq 1970-01-01 00:00:00 +0000
4325+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-25.xq 2012-03-15 17:04:36 +0000
4326@@ -0,0 +1,21 @@
4327+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4328+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4329+
4330+z:parse("<?xml version='1.0'?>
4331+<level1>
4332+ level1 text start
4333+ <level2>
4334+ level2 text start
4335+ <level3>
4336+ level3 text start
4337+ <level4>level4 text</level4>
4338+ level3 text end
4339+ </level3>
4340+ level2 text end
4341+ </level2>
4342+ level1 text end
4343+</level1>",
4344+ <opt:options>
4345+ <opt:parse-external-parsed-entity opt:skip-root-nodes="0"/>
4346+ </opt:options>
4347+)
4348
4349=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-26.xq'
4350--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-26.xq 1970-01-01 00:00:00 +0000
4351+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-26.xq 2012-03-15 17:04:36 +0000
4352@@ -0,0 +1,21 @@
4353+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4354+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4355+
4356+z:parse("<?xml version='1.0'?>
4357+<level1>
4358+ level1 text start
4359+ <level2>
4360+ level2 text start
4361+ <level3>
4362+ level3 text start
4363+ <level4>level4 text</level4>
4364+ level3 text end
4365+ </level3>
4366+ level2 text end
4367+ </level2>
4368+ level1 text end
4369+</level1>",
4370+ <opt:options>
4371+ <opt:parse-external-parsed-entity opt:skip-root-nodes="1"/>
4372+ </opt:options>
4373+)
4374
4375=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-27.xq'
4376--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-27.xq 1970-01-01 00:00:00 +0000
4377+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-27.xq 2012-03-15 17:04:36 +0000
4378@@ -0,0 +1,21 @@
4379+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4380+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4381+
4382+z:parse("<?xml version='1.0'?>
4383+<level1>
4384+ level1 text start
4385+ <level2>
4386+ level2 text start
4387+ <level3>
4388+ level3 text start
4389+ <level4>level4 text</level4>
4390+ level3 text end
4391+ </level3>
4392+ level2 text end
4393+ </level2>
4394+ level1 text end
4395+</level1>",
4396+ <opt:options>
4397+ <opt:parse-external-parsed-entity opt:skip-root-nodes="2"/>
4398+ </opt:options>
4399+)
4400
4401=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-28.xq'
4402--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-28.xq 1970-01-01 00:00:00 +0000
4403+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-28.xq 2012-03-15 17:04:36 +0000
4404@@ -0,0 +1,21 @@
4405+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4406+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4407+
4408+z:parse("<?xml version='1.0'?>
4409+<level1>
4410+ level1 text start
4411+ <level2>
4412+ level2 text start
4413+ <level3>
4414+ level3 text start
4415+ <level4>level4 text</level4>
4416+ level3 text end
4417+ </level3>
4418+ level2 text end
4419+ </level2>
4420+ level1 text end
4421+</level1>",
4422+ <opt:options>
4423+ <opt:parse-external-parsed-entity opt:skip-root-nodes="3"/>
4424+ </opt:options>
4425+)
4426
4427=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-29.xq'
4428--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-29.xq 1970-01-01 00:00:00 +0000
4429+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-29.xq 2012-03-15 17:04:36 +0000
4430@@ -0,0 +1,21 @@
4431+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4432+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4433+
4434+z:parse("<?xml version='1.0'?>
4435+<level1>
4436+ level1 text start
4437+ <level2>
4438+ level2 text start
4439+ <level3>
4440+ level3 text start
4441+ <level4>level4 text</level4>
4442+ level3 text end
4443+ </level3>
4444+ level2 text end
4445+ </level2>
4446+ level1 text end
4447+</level1>",
4448+ <opt:options>
4449+ <opt:parse-external-parsed-entity opt:skip-root-nodes="4"/>
4450+ </opt:options>
4451+)
4452
4453=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-30.xq'
4454--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-30.xq 1970-01-01 00:00:00 +0000
4455+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-30.xq 2012-03-15 17:04:36 +0000
4456@@ -0,0 +1,21 @@
4457+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4458+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4459+
4460+z:parse("<?xml version='1.0'?>
4461+<level1>
4462+ level1 text start
4463+ <level2>
4464+ level2 text start
4465+ <level3>
4466+ level3 text start
4467+ <level4>level4 text</level4>
4468+ level3 text end
4469+ </level3>
4470+ level2 text end
4471+ </level2>
4472+ level1 text end
4473+</level1>",
4474+ <opt:options>
4475+ <opt:parse-external-parsed-entity opt:skip-root-nodes="5"/>
4476+ </opt:options>
4477+)
4478
4479=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-31.xq'
4480--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-31.xq 1970-01-01 00:00:00 +0000
4481+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-31.xq 2012-03-15 17:04:36 +0000
4482@@ -0,0 +1,65 @@
4483+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4484+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4485+
4486+z:parse("<?xml version='1.0'?>
4487+level0 text
4488+<level1>
4489+ level1 text start
4490+ <level2>
4491+ level2 text start
4492+ <level3>
4493+ level3 text start
4494+ <level4>level4 text</level4>
4495+ level3 text end
4496+ </level3>
4497+ level2 text end
4498+ </level2>
4499+ level1 text end
4500+</level1>
4501+level0 text
4502+<level1>
4503+ level1 text start
4504+ <level2>
4505+ level2 text start
4506+ <level3>
4507+ level3 text start
4508+ <level4>level4 text</level4>
4509+ level3 text end
4510+ </level3>
4511+ level2 text end
4512+ </level2>
4513+ level1 text end
4514+</level1>
4515+level0 text
4516+<level1>
4517+ level1 text start
4518+ <level2>
4519+ level2 text start
4520+ <level3>
4521+ level3 text start
4522+ <level4>level4 text</level4>
4523+ level3 text end
4524+ </level3>
4525+ level2 text end
4526+ </level2>
4527+ level1 text end
4528+</level1>
4529+level0 text
4530+<level1>
4531+ level1 text start
4532+ <level2>
4533+ level2 text start
4534+ <level3>
4535+ level3 text start
4536+ <level4>level4 text</level4>
4537+ level3 text end
4538+ </level3>
4539+ level2 text end
4540+ </level2>
4541+ level1 text end
4542+</level1>
4543+level0 text",
4544+ <opt:options>
4545+ <opt:parse-external-parsed-entity opt:skip-root-nodes="0"/>
4546+ </opt:options>
4547+)
4548
4549=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-32.xq'
4550--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-32.xq 1970-01-01 00:00:00 +0000
4551+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-32.xq 2012-03-15 17:04:36 +0000
4552@@ -0,0 +1,65 @@
4553+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4554+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4555+
4556+z:parse("<?xml version='1.0'?>
4557+level0 text
4558+<level1>
4559+ level1 text start
4560+ <level2>
4561+ level2 text start
4562+ <level3>
4563+ level3 text start
4564+ <level4>level4 text</level4>
4565+ level3 text end
4566+ </level3>
4567+ level2 text end
4568+ </level2>
4569+ level1 text end
4570+</level1>
4571+level0 text
4572+<level1>
4573+ level1 text start
4574+ <level2>
4575+ level2 text start
4576+ <level3>
4577+ level3 text start
4578+ <level4>level4 text</level4>
4579+ level3 text end
4580+ </level3>
4581+ level2 text end
4582+ </level2>
4583+ level1 text end
4584+</level1>
4585+level0 text
4586+<level1>
4587+ level1 text start
4588+ <level2>
4589+ level2 text start
4590+ <level3>
4591+ level3 text start
4592+ <level4>level4 text</level4>
4593+ level3 text end
4594+ </level3>
4595+ level2 text end
4596+ </level2>
4597+ level1 text end
4598+</level1>
4599+level0 text
4600+<level1>
4601+ level1 text start
4602+ <level2>
4603+ level2 text start
4604+ <level3>
4605+ level3 text start
4606+ <level4>level4 text</level4>
4607+ level3 text end
4608+ </level3>
4609+ level2 text end
4610+ </level2>
4611+ level1 text end
4612+</level1>
4613+level0 text",
4614+ <opt:options>
4615+ <opt:parse-external-parsed-entity opt:skip-root-nodes="1"/>
4616+ </opt:options>
4617+)
4618
4619=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-33.xq'
4620--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-33.xq 1970-01-01 00:00:00 +0000
4621+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-33.xq 2012-03-15 17:04:36 +0000
4622@@ -0,0 +1,65 @@
4623+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4624+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4625+
4626+z:parse("<?xml version='1.0'?>
4627+level0 text
4628+<level1>
4629+ level1 text start
4630+ <level2>
4631+ level2 text start
4632+ <level3>
4633+ level3 text start
4634+ <level4>level4 text</level4>
4635+ level3 text end
4636+ </level3>
4637+ level2 text end
4638+ </level2>
4639+ level1 text end
4640+</level1>
4641+level0 text
4642+<level1>
4643+ level1 text start
4644+ <level2>
4645+ level2 text start
4646+ <level3>
4647+ level3 text start
4648+ <level4>level4 text</level4>
4649+ level3 text end
4650+ </level3>
4651+ level2 text end
4652+ </level2>
4653+ level1 text end
4654+</level1>
4655+level0 text
4656+<level1>
4657+ level1 text start
4658+ <level2>
4659+ level2 text start
4660+ <level3>
4661+ level3 text start
4662+ <level4>level4 text</level4>
4663+ level3 text end
4664+ </level3>
4665+ level2 text end
4666+ </level2>
4667+ level1 text end
4668+</level1>
4669+level0 text
4670+<level1>
4671+ level1 text start
4672+ <level2>
4673+ level2 text start
4674+ <level3>
4675+ level3 text start
4676+ <level4>level4 text</level4>
4677+ level3 text end
4678+ </level3>
4679+ level2 text end
4680+ </level2>
4681+ level1 text end
4682+</level1>
4683+level0 text",
4684+ <opt:options>
4685+ <opt:parse-external-parsed-entity opt:skip-root-nodes="2"/>
4686+ </opt:options>
4687+)
4688
4689=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-34.xq'
4690--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-34.xq 1970-01-01 00:00:00 +0000
4691+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-34.xq 2012-03-15 17:04:36 +0000
4692@@ -0,0 +1,65 @@
4693+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4694+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4695+
4696+z:parse("<?xml version='1.0'?>
4697+level0 text
4698+<level1>
4699+ level1 text start
4700+ <level2>
4701+ level2 text start
4702+ <level3>
4703+ level3 text start
4704+ <level4>level4 text</level4>
4705+ level3 text end
4706+ </level3>
4707+ level2 text end
4708+ </level2>
4709+ level1 text end
4710+</level1>
4711+level0 text
4712+<level1>
4713+ level1 text start
4714+ <level2>
4715+ level2 text start
4716+ <level3>
4717+ level3 text start
4718+ <level4>level4 text</level4>
4719+ level3 text end
4720+ </level3>
4721+ level2 text end
4722+ </level2>
4723+ level1 text end
4724+</level1>
4725+level0 text
4726+<level1>
4727+ level1 text start
4728+ <level2>
4729+ level2 text start
4730+ <level3>
4731+ level3 text start
4732+ <level4>level4 text</level4>
4733+ level3 text end
4734+ </level3>
4735+ level2 text end
4736+ </level2>
4737+ level1 text end
4738+</level1>
4739+level0 text
4740+<level1>
4741+ level1 text start
4742+ <level2>
4743+ level2 text start
4744+ <level3>
4745+ level3 text start
4746+ <level4>level4 text</level4>
4747+ level3 text end
4748+ </level3>
4749+ level2 text end
4750+ </level2>
4751+ level1 text end
4752+</level1>
4753+level0 text",
4754+ <opt:options>
4755+ <opt:parse-external-parsed-entity opt:skip-root-nodes="3"/>
4756+ </opt:options>
4757+)
4758
4759=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-35.xq'
4760--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-35.xq 1970-01-01 00:00:00 +0000
4761+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-35.xq 2012-03-15 17:04:36 +0000
4762@@ -0,0 +1,65 @@
4763+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4764+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4765+
4766+z:parse("<?xml version='1.0'?>
4767+level0 text
4768+<level1>
4769+ level1 text start
4770+ <level2>
4771+ level2 text start
4772+ <level3>
4773+ level3 text start
4774+ <level4>level4 text</level4>
4775+ level3 text end
4776+ </level3>
4777+ level2 text end
4778+ </level2>
4779+ level1 text end
4780+</level1>
4781+level0 text
4782+<level1>
4783+ level1 text start
4784+ <level2>
4785+ level2 text start
4786+ <level3>
4787+ level3 text start
4788+ <level4>level4 text</level4>
4789+ level3 text end
4790+ </level3>
4791+ level2 text end
4792+ </level2>
4793+ level1 text end
4794+</level1>
4795+level0 text
4796+<level1>
4797+ level1 text start
4798+ <level2>
4799+ level2 text start
4800+ <level3>
4801+ level3 text start
4802+ <level4>level4 text</level4>
4803+ level3 text end
4804+ </level3>
4805+ level2 text end
4806+ </level2>
4807+ level1 text end
4808+</level1>
4809+level0 text
4810+<level1>
4811+ level1 text start
4812+ <level2>
4813+ level2 text start
4814+ <level3>
4815+ level3 text start
4816+ <level4>level4 text</level4>
4817+ level3 text end
4818+ </level3>
4819+ level2 text end
4820+ </level2>
4821+ level1 text end
4822+</level1>
4823+level0 text",
4824+ <opt:options>
4825+ <opt:parse-external-parsed-entity opt:skip-root-nodes="4"/>
4826+ </opt:options>
4827+)
4828
4829=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-36.xq'
4830--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-36.xq 1970-01-01 00:00:00 +0000
4831+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-36.xq 2012-03-15 17:04:36 +0000
4832@@ -0,0 +1,65 @@
4833+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4834+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4835+
4836+z:parse("<?xml version='1.0'?>
4837+level0 text
4838+<level1>
4839+ level1 text start
4840+ <level2>
4841+ level2 text start
4842+ <level3>
4843+ level3 text start
4844+ <level4>level4 text</level4>
4845+ level3 text end
4846+ </level3>
4847+ level2 text end
4848+ </level2>
4849+ level1 text end
4850+</level1>
4851+level0 text
4852+<level1>
4853+ level1 text start
4854+ <level2>
4855+ level2 text start
4856+ <level3>
4857+ level3 text start
4858+ <level4>level4 text</level4>
4859+ level3 text end
4860+ </level3>
4861+ level2 text end
4862+ </level2>
4863+ level1 text end
4864+</level1>
4865+level0 text
4866+<level1>
4867+ level1 text start
4868+ <level2>
4869+ level2 text start
4870+ <level3>
4871+ level3 text start
4872+ <level4>level4 text</level4>
4873+ level3 text end
4874+ </level3>
4875+ level2 text end
4876+ </level2>
4877+ level1 text end
4878+</level1>
4879+level0 text
4880+<level1>
4881+ level1 text start
4882+ <level2>
4883+ level2 text start
4884+ <level3>
4885+ level3 text start
4886+ <level4>level4 text</level4>
4887+ level3 text end
4888+ </level3>
4889+ level2 text end
4890+ </level2>
4891+ level1 text end
4892+</level1>
4893+level0 text",
4894+ <opt:options>
4895+ <opt:parse-external-parsed-entity opt:skip-root-nodes="5"/>
4896+ </opt:options>
4897+)
4898
4899=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-37.xq'
4900--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-37.xq 1970-01-01 00:00:00 +0000
4901+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-37.xq 2012-03-15 17:04:36 +0000
4902@@ -0,0 +1,20 @@
4903+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4904+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4905+
4906+z:parse("<doc>
4907+ <foo>0</foo>
4908+ <foo>1</foo>
4909+ <foo>2</foo>
4910+ <foo>3</foo>
4911+ <foo>4</foo>
4912+ <foo>5</foo>
4913+ <foo>6</foo>
4914+ <foo>7</foo>
4915+ <foo>8</foo>
4916+ <foo>9</foo>
4917+ <foo>10</foo>
4918+</doc>",
4919+ <opt:options>
4920+ <opt:parse-external-parsed-entity opt:skip-root-nodes="0"/>
4921+ </opt:options>
4922+)
4923
4924=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-38.xq'
4925--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-38.xq 1970-01-01 00:00:00 +0000
4926+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-38.xq 2012-03-15 17:04:36 +0000
4927@@ -0,0 +1,20 @@
4928+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4929+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4930+
4931+z:parse("<doc>
4932+ <foo>0</foo>
4933+ <foo>1</foo>
4934+ <foo>2</foo>
4935+ <foo>3</foo>
4936+ <foo>4</foo>
4937+ <foo>5</foo>
4938+ <foo>6</foo>
4939+ <foo>7</foo>
4940+ <foo>8</foo>
4941+ <foo>9</foo>
4942+ <foo>10</foo>
4943+</doc>",
4944+ <opt:options>
4945+ <opt:parse-external-parsed-entity opt:skip-root-nodes="1"/>
4946+ </opt:options>
4947+)
4948
4949=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-39.xq'
4950--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-39.xq 1970-01-01 00:00:00 +0000
4951+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-39.xq 2012-03-15 17:04:36 +0000
4952@@ -0,0 +1,20 @@
4953+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4954+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4955+
4956+z:parse("<doc>
4957+ <foo>0</foo>
4958+ <foo>1</foo>
4959+ <foo>2</foo>
4960+ <foo>3</foo>
4961+ <foo>4</foo>
4962+ <foo>5</foo>
4963+ <foo>6</foo>
4964+ <foo>7</foo>
4965+ <foo>8</foo>
4966+ <foo>9</foo>
4967+ <foo>10</foo>
4968+</doc>",
4969+ <opt:options>
4970+ <opt:parse-external-parsed-entity opt:skip-root-nodes="2"/>
4971+ </opt:options>
4972+)
4973
4974=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-40.xq'
4975--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-40.xq 1970-01-01 00:00:00 +0000
4976+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-40.xq 2012-03-15 17:04:36 +0000
4977@@ -0,0 +1,9 @@
4978+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4979+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4980+
4981+z:parse("<?xml version='1.0'?>
4982+<n1:root xmlns:n1='ns' xmlns:m1='ms'><n2:root2 xmlns:n2='ns2' xmlns:m2='ms2'><n1:from1 xmlns:n3='ns3'><from2>Text from2</from2></n1:from1></n2:root2></n1:root>",
4983+ <opt:options>
4984+ <opt:parse-external-parsed-entity opt:skip-root-nodes="0"/>
4985+ </opt:options>
4986+)
4987
4988=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-41.xq'
4989--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-41.xq 1970-01-01 00:00:00 +0000
4990+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-41.xq 2012-03-15 17:04:36 +0000
4991@@ -0,0 +1,9 @@
4992+import module namespace z = "http://www.zorba-xquery.com/modules/xml";
4993+import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
4994+
4995+z:parse("<?xml version='1.0'?>
4996+<n1:root xmlns:n1='ns' xmlns:m1='ms'><n2:root2 xmlns:n2='ns2' xmlns:m2='ms2'><n1:from1 xmlns:n3='ns3'><from2>Text from2</from2></n1:from1></n2:root2></n1:root>",
4997+ <opt:options>
4998+ <opt:parse-external-parsed-entity opt:skip-root-nodes="1"/>
4999+ </opt:options>
5000+)
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches