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

Proposed by Nicolae Brinza
Status: Superseded
Proposed branch: lp:~nbrinza/zorba/parse-fragment
Merge into: lp:zorba
Diff against target: 4936 lines (+2591/-634)
148 files modified
CMakeLists.txt (+15/-5)
ChangeLog (+2/-0)
modules/com/zorba-xquery/www/modules/CMakeLists.txt (+1/-0)
modules/com/zorba-xquery/www/modules/xml-options.xsd (+89/-0)
modules/com/zorba-xquery/www/modules/xml.xq (+110/-96)
src/api/xmldatamanagerimpl.cpp (+13/-13)
src/diagnostics/diagnostic_en.xml (+6/-6)
src/diagnostics/pregenerated/dict_en.cpp (+3/-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 (+154/-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 (+306/-165)
src/store/naive/loader_fast.cpp (+5/-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-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-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
William Candillon Approve
Matthias Brantner Needs Fixing
Review via email: mp+89038@code.launchpad.net

This proposal supersedes a proposal from 2012-01-11.

This proposal has been superseded by a proposal from 2012-02-06.

Description of the change

Fully streaming parse-xml module.

To post a comment you must log in.
Revision history for this message
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?

Revision history for this message
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
Revision history for this message
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.

Revision history for this message
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
Revision history for this message
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
Revision history for this message
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
Revision history for this message
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.

Revision history for this message
William Candillon (wcandillon) wrote :

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
Revision history for this message
William Candillon (wcandillon) wrote :

Would xmldoc be a good prefix?

Revision history for this message
Nicolae Brinza (nbrinza) wrote :

It certainly is the closest allowed alternative...

Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

- 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
lp:~nbrinza/zorba/parse-fragment updated
10500. By Nicolae Brinza

Fixed the build for ZORBA_NO_XMLSCHEMA

Revision history for this message
William Candillon (wcandillon) :
review: Approve
lp:~nbrinza/zorba/parse-fragment updated
10501. By Nicolae Brinza

Fixed the parse fragment function so that it works with LibXml2 down to version 2.7.0

10502. By Nicolae Brinza

Merged with Zorba trunk

10503. By Nicolae Brinza

Fixed the build and a small compatibility issue with LibXml2-2.7.6

10504. By Nicolae Brinza

LibXml2 version 2.7.0 or higher is now required in order to build Zorba.

10505. By Nicolae Brinza

Merged with Zorba trunk.

Revision history for this message
Nicolae Brinza (nbrinza) wrote :

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

lp:~nbrinza/zorba/parse-fragment updated
10506. By Nicolae Brinza

Fix for the reported bug in parse-fragment function

10507. By Nicolae Brinza

Merged with Zorba trunk

10508. By Nicolae Brinza

Fixed the regressions in the parse-fragment branch

10509. By Nicolae Brinza

Merged with Zorba trunk

10510. By Nicolae Brinza

Added a parse-xml:parse-xml-fragment() function for backwards compatibility. Also made a small fix to a related error message.

10511. By Nicolae Brinza

Merged with Zorba trunk

10512. By Nicolae Brinza

Updated and merged Matthias' documentation code example for the parse-fragment() function

10513. By Nicolae Brinza

Added another example in the documentation of the parse-fragment function

10514. By Nicolae Brinza

Removed the strip-boundary-whitespace option from the parse-fragment function

10515. By Nicolae Brinza

Fixed the formatting of the code examples in the documenation of the parse-fragment module

10516. By Nicolae Brinza

Merged with Zorba trunk

10517. By Nicolae Brinza

Fixed the failing link crawler test in the release build

10518. By Nicolae Brinza

Merged with Zorba trunk

10519. By Nicolae Brinza

Merged with Zorba trunk

10520. By Nicolae Brinza

Added a test for the backwards-compatible zorba:parse-xml-fragment() function

10521. By Nicolae Brinza

Small optimization in the serializer to avoid a repeated string comparison

10522. By Nicolae Brinza

Merged with Zorba trunk

10523. By Nicolae Brinza

Documentation fixes.

10524. By Nicolae Brinza

Reverted a change in the parse fragment module to fix the regressions

10525. By Nicolae Brinza

Improved documentation of the parse-fragment module

10526. By Nicolae Brinza

Merged with Zorba trunk

10527. By Nicolae Brinza

Fixed the type of options parameter to the parse-fragment() function.

10528. By Nicolae Brinza

Fixed the quantity of the options parameter from ONE to QUESTION.

10529. By Nicolae Brinza

Merged with Zorba trunk

10530. By Nicolae Brinza

The parse-fragment function now allows a DOCTYPE declaration in the input.

10531. By Nicolae Brinza

Merged with Zorba trunk

10532. By Nicolae Brinza

Updated the Changelog with the parse-fragment info

10533. By Nicolae Brinza

Updated Changelog with the resolution of bug #1016606

10534. By Nicolae Brinza

Merged with Zorba trunk

10535. By Nicolae Brinza

Fixed parse-fragment not handling correctly the streammable streams lifetime.

10536. By Nicolae Brinza

The input buffer of parse-fragment can grow if libxml is not able to parse the current chunk. Fixes bug #1027270

10537. By Nicolae Brinza

Merged with Zorba trunk

10538. By Nicolae Brinza

Merged with Zorba trunk

10539. By Nicolae Brinza

Updated the Changelog with fixes for bugs #1016606 and #1024033

10540. By Nicolae Brinza

Updated the Changelog with the fix for the bug #1023170

10541. By Nicolae Brinza

Merged with Zorba trunk

10542. By Nicolae Brinza

Fix for bug #1099535 endless loop in xml:parse()

10543. By Nicolae Brinza

Merged with Zorba trunk

10544. By Nicolae Brinza

Updated Changelog to mention fix for bug #1099535

10545. By Nicolae Brinza

Merged with Zorba trunk

10546. By Nicolae Brinza

Fixed bug #1099648 -- XML parsing failures on Red Hat

10547. By Nicolae Brinza

Updated Changelog to mention the fix for bug #1099648

10548. By Nicolae Brinza

Merged with Zorba trunk

Unmerged revisions

10548. By Nicolae Brinza

Merged with Zorba trunk

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

Subscribers

People subscribed via source and target branches