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
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2012-01-20 13:37:12 +0000
+++ CMakeLists.txt 2012-02-03 22:18:21 +0000
@@ -237,11 +237,21 @@
237MESSAGE(STATUS "Looking for LibXml2")237MESSAGE(STATUS "Looking for LibXml2")
238FIND_PACKAGE(LibXml2)238FIND_PACKAGE(LibXml2)
239IF(LIBXML2_FOUND)239IF(LIBXML2_FOUND)
240 MESSAGE(STATUS "Found LIBXML2 library -- " ${LIBXML2_LIBRARIES})240 # Now check LibXml2's version
241 241 FILE(STRINGS ${LIBXML2_INCLUDE_DIR}/libxml/xmlversion.h LIBXML2_VERSION_TMP REGEX
242 INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})242 "^#define[ \t]+LIBXML_DOTTED_VERSION[ \t]+\".*\"")
243 SET(requiredlibs-store ${requiredlibs-store} ${LIBXML2_LIBRARIES})243 STRING(REGEX REPLACE "^#define[ \t]+LIBXML_DOTTED_VERSION[ \t]+\"(.*)\"" "\\1"
244 SET(CXXFLAGS ${CXXFLAGS} ${LIBXML2_DEFINITONS})244 LIBXML2_VERSION ${LIBXML2_VERSION_TMP})
245
246 IF(LIBXML2_VERSION VERSION_EQUAL "2.7.0" OR LIBXML2_VERSION VERSION_GREATER "2.7.0")
247 MESSAGE(STATUS "Found LIBXML2 library -- " ${LIBXML2_LIBRARIES})
248 INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR})
249 SET(requiredlibs-store ${requiredlibs-store} ${LIBXML2_LIBRARIES})
250 SET(CXXFLAGS ${CXXFLAGS} ${LIBXML2_DEFINITONS})
251 ELSE(LIBXML2_VERSION VERSION_EQUAL "2.7.0" OR LIBXML2_VERSION VERSION_GREATER "2.7.0")
252 MESSAGE(FATAL_ERROR "The libxml2 library version 2.7.0 or higher is required in order to build Zorba.")
253 ENDIF(LIBXML2_VERSION VERSION_EQUAL "2.7.0" OR LIBXML2_VERSION VERSION_GREATER "2.7.0")
254
245ELSE(LIBXML2_FOUND)255ELSE(LIBXML2_FOUND)
246 MESSAGE(FATAL_ERROR "The libxml2 library and headers are required in order to build simple store.")256 MESSAGE(FATAL_ERROR "The libxml2 library and headers are required in order to build simple store.")
247ENDIF(LIBXML2_FOUND)257ENDIF(LIBXML2_FOUND)
248258
=== modified file 'ChangeLog'
--- ChangeLog 2012-02-02 09:56:52 +0000
+++ ChangeLog 2012-02-03 22:18:21 +0000
@@ -2,6 +2,8 @@
22
3version 2.23version 2.2
44
5 * 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.
6 * LibXml2 version 2.7.0 or higher is now required in order to build Zorba.
5 * No-copy optimization: avoids copying nodes during node-constructor expressions.7 * No-copy optimization: avoids copying nodes during node-constructor expressions.
6 * Added external function annotations %ann:propagates-input-nodes and 8 * Added external function annotations %ann:propagates-input-nodes and
7 %ann:must-copy-input-nodes to be used by the no-copy optimization.9 %ann:must-copy-input-nodes to be used by the no-copy optimization.
810
=== modified file 'modules/com/zorba-xquery/www/modules/CMakeLists.txt'
--- modules/com/zorba-xquery/www/modules/CMakeLists.txt 2012-01-11 17:30:25 +0000
+++ modules/com/zorba-xquery/www/modules/CMakeLists.txt 2012-02-03 22:18:21 +0000
@@ -60,6 +60,7 @@
60 URI "http://www.zorba-xquery.com/modules/schema")60 URI "http://www.zorba-xquery.com/modules/schema")
61DECLARE_ZORBA_MODULE(FILE string.xq VERSION 2.161DECLARE_ZORBA_MODULE(FILE string.xq VERSION 2.1
62 URI "http://www.zorba-xquery.com/modules/string")62 URI "http://www.zorba-xquery.com/modules/string")
63DECLARE_ZORBA_SCHEMA(FILE xml-options.xsd URI "http://www.zorba-xquery.com/modules/xml-options")
63DECLARE_ZORBA_MODULE(FILE xml.xq VERSION 2.064DECLARE_ZORBA_MODULE(FILE xml.xq VERSION 2.0
64 URI "http://www.zorba-xquery.com/modules/xml")65 URI "http://www.zorba-xquery.com/modules/xml")
65DECLARE_ZORBA_MODULE(FILE xqdoc.xq VERSION 2.066DECLARE_ZORBA_MODULE(FILE xqdoc.xq VERSION 2.0
6667
=== added file 'modules/com/zorba-xquery/www/modules/xml-options.xsd'
--- modules/com/zorba-xquery/www/modules/xml-options.xsd 1970-01-01 00:00:00 +0000
+++ modules/com/zorba-xquery/www/modules/xml-options.xsd 2012-02-03 22:18:21 +0000
@@ -0,0 +1,89 @@
1<?xml version="1.0"?>
2<!--
3 - Copyright 2006-2012 The FLWOR Foundation.
4 -
5 - Licensed under the Apache License, Version 2.0 (the "License");
6 - you may not use this file except in compliance with the License.
7 - You may obtain a copy of the License at
8 -
9 - http://www.apache.org/licenses/LICENSE-2.0
10 -
11 - Unless required by applicable law or agreed to in writing, software
12 - distributed under the License is distributed on an "AS IS" BASIS,
13 - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 - See the License for the specific language governing permissions and
15 - limitations under the License.
16-->
17<schema xmlns="http://www.w3.org/2001/XMLSchema"
18 targetNamespace="http://www.zorba-xquery.com/modules/xml-options"
19 elementFormDefault="qualified" attributeFormDefault="qualified">
20
21 <element name="options">
22 <complexType>
23 <all>
24
25 <element name="base-uri" minOccurs="0" maxOccurs="1">
26 <complexType>
27 <attribute name="value" type="anyURI" use="required"/>
28 </complexType>
29 </element>
30 <element name="no-error" minOccurs="0" maxOccurs="1">
31 <complexType/>
32 </element>
33 <element name="strip-boundary-space" minOccurs="0" maxOccurs="1">
34 <complexType/>
35 </element>
36 <element name="schema-validate" minOccurs="0" maxOccurs="1">
37 <complexType>
38 <attribute name="mode" default="strict">
39 <simpleType>
40 <restriction base="string">
41 <enumeration value="strict"/>
42 <enumeration value="lax"/>
43 </restriction>
44 </simpleType>
45 </attribute>
46 </complexType>
47 </element>
48 <element name="DTD-validate" minOccurs="0" maxOccurs="1">
49 <complexType/>
50 </element>
51 <element name="DTD-load" minOccurs="0" maxOccurs="1">
52 <complexType/>
53 </element>
54 <element name="default-DTD-attributes" minOccurs="0" maxOccurs="1">
55 <complexType/>
56 </element>
57 <element name="parse-external-parsed-entity" minOccurs="0" maxOccurs="1">
58 <complexType>
59 <attribute name="skip-root-nodes" use="optional">
60 <simpleType>
61 <restriction base="int">
62 <minInclusive value="0"/>
63 </restriction>
64 </simpleType>
65 </attribute>
66 <attribute name="skip-top-level-text-nodes" type="boolean" use="optional"/>
67 </complexType>
68 </element>
69 <element name="substitute-entities" minOccurs="0" maxOccurs="1">
70 <complexType/>
71 </element>
72 <element name="xinclude-substitutions" minOccurs="0" maxOccurs="1">
73 <complexType/>
74 </element>
75 <element name="remove-redundant-ns" minOccurs="0" maxOccurs="1">
76 <complexType/>
77 </element>
78 <element name="no-CDATA" minOccurs="0" maxOccurs="1">
79 <complexType/>
80 </element>
81 <element name="no-xinclude-nodes" minOccurs="0" maxOccurs="1">
82 <complexType/>
83 </element>
84
85 </all>
86 </complexType>
87 </element>
88
89</schema>
090
=== modified file 'modules/com/zorba-xquery/www/modules/xml.xq' (properties changed: +x to -x)
--- modules/com/zorba-xquery/www/modules/xml.xq 2011-08-10 02:50:23 +0000
+++ modules/com/zorba-xquery/www/modules/xml.xq 2012-02-03 22:18:21 +0000
@@ -1,4 +1,4 @@
1xquery version "1.0";1xquery version "3.0";
22
3(:3(:
4 : Copyright 2006-2010 The FLWOR Foundation.4 : Copyright 2006-2010 The FLWOR Foundation.
@@ -23,13 +23,14 @@
23 : external parsed entities, described by 23 : external parsed entities, described by
24 : <a href="http://www.w3.org/TR/xml/#wf-entities">XML 1.0 Well-Formed 24 : <a href="http://www.w3.org/TR/xml/#wf-entities">XML 1.0 Well-Formed
25 : Parsed Entities</a>. The functions can also perform Schema and DTD 25 : Parsed Entities</a>. The functions can also perform Schema and DTD
26 : validation of the input documents.26 : validation of the input documents.
27 : </p>27 : </p>
28 :28 :
29 : @see <a href="http://www.w3.org/TR/xml/#wf-entities">XML 1.0 Well-Formed 29 : @see <a href="http://www.w3.org/TR/xml/#wf-entities">XML 1.0 Well-Formed
30 : Parsed Entities</a>30 : Parsed Entities</a>
31 : @see <a href="http://www.w3.org/TR/xpath-functions-30/#func-parse-xml">31 : @see <a href="http://www.w3.org/TR/xpath-functions-30/#func-parse-xml">
32 : fn:parse-xml() function in XPath and XQuery Functions and Operators 3.0</a>32 : fn:parse-xml() function in XPath and XQuery Functions and Operators 3.0</a>
33 : @see <a href="http://xmlsoft.org/html/libxml-parser.html">LibXml2 parser</a>
33 :34 :
34 : @author Nicolae Brinza35 : @author Nicolae Brinza
35 : @project data processing/data converters36 : @project data processing/data converters
@@ -37,6 +38,8 @@
37 :)38 :)
38module namespace parse-xml = "http://www.zorba-xquery.com/modules/xml";39module namespace parse-xml = "http://www.zorba-xquery.com/modules/xml";
3940
41import schema namespace parse-xml-options = "http://www.zorba-xquery.com/modules/xml-options";
42
40declare namespace zerr = "http://www.zorba-xquery.com/errors";43declare namespace zerr = "http://www.zorba-xquery.com/errors";
41declare namespace err = "http://www.w3.org/xqt-errors";44declare namespace err = "http://www.w3.org/xqt-errors";
4245
@@ -48,21 +51,65 @@
48 : A function to parse XML files and fragments (i.e. 51 : A function to parse XML files and fragments (i.e.
49 : <a href="http://www.w3.org/TR/xml/#wf-entities">external general parsed 52 : <a href="http://www.w3.org/TR/xml/#wf-entities">external general parsed
50 : entities</a>). The functions takes two arguments: the first one is the 53 : entities</a>). The functions takes two arguments: the first one is the
51 : string to be parsed and the second argument is a flags string 54 : string to be parsed and the second argument is an &lt;options/&gt; element that
52 : (eEdDsSlLwWfF]*(;[\p{L}]*)?) selecting the options described below.55 : passes a list of options to the parsing function. They are described below.
53 : <br/>56 : The options element must conform to the xml-options.xsd schema. Some of these
54 : <br/>57 : will be passed to the underlying library (LibXml2) and further documentation
55 : 58 : for them can be found at <a href="http://xmlsoft.org/html/libxml-parser.html">
56 : The convention for the flags is that a lower-case letter enables 59 : LibXml2 parser</a>.
57 : an option and the corresponding upper-case letter disables it; specifying 60 :
58 : both is an error; specifying neither leaves it implementation-defined 61 : The list of available options:
59 : whether the option is enabled or disabled. Specifying the same option twice 62 :
60 : is not an error, but specifying inconsistent options (for example "eE") is
61 : a dynamic error. The options are:
62 :
63 : <ul>63 : <ul>
64 : <li>64 : <li>
65 : eE - enables or disables processing of XML external entities. If the option 65 : &lt;base-uri/&gt; - the element must have a "value" attribute, which will provide
66 : the baseURI that will be used as the baseURI for every node returned by this
67 : function.
68 : </li>
69 :
70 : <li>
71 : &lt;no-error/&gt; - if present, the option will disable fatal error processing. Any
72 : failure to parse or validate the input in the requested manner will result
73 : in the function returning an empty sequence and no error will raised.
74 : </li>
75 :
76 : <li>
77 : &lt;strip-boundary-space/&gt; - if present, it will enable the removal of blank nodes from the input.
78 : </li>
79 :
80 : <li>
81 : &lt;schema-validate/&gt; - if present, it will request that the input string be Schema
82 : validated. The element accepts an attribute named "mode" which can have two
83 : values: "strict and "lax". Enabling the option will produce a result that is
84 : equivalent to processing the input with the option disabled, and then copying
85 : the result using the XQuery "validate strict|lax" expression. This option can not
86 : be used together with either the &lt;DTD-validate/&gt; or the &lt;parse-external-parsed-entity/&gt;
87 : option. Doing so will raise a zerr:ZXQD0003 error.
88 : </li>
89 :
90 : <li>
91 : &lt;DTD-validate/&gt; - the option will enable the DTD-based validation. If this
92 : option is enabled and the input references a DTD, then the input must be a
93 : well-formed and DTD-valid XML document. The &lt;DTD-load/&gt; option must be used for
94 : external DTD files to be loaded. If the option is enabled and the input does
95 : not reference a DTD then the option is ignored. If the option is disabled, the
96 : input is not required to reference a DTD and if it does reference a DTD then
97 : the DTD is ignored for validation purposes. This option can not
98 : be used together with either the &lt;schema-validate/&gt; or the &lt;parse-external-parsed-entity&gt;
99 : option. Doing so will raise a zerr:ZXQD0003 error.
100 : </li>
101 :
102 : <li>
103 : &lt;DTD-load/&gt; - if present, it will enable loading of external DTD files.
104 : </li>
105 :
106 : <li>
107 : &lt;default-DTD-attributes/&gt; - if present, it will enable the default DTD attributes.
108 : </li>
109 :
110 : <li>
111 : &lt;parse-external-parsed-entity/&gt; - if present, it will enable the processing of XML
112 : external entities. If the option
66 : is enabled, the input must conform to the syntax extParsedEnt (production 113 : is enabled, the input must conform to the syntax extParsedEnt (production
67 : [78] in XML 1.0, see <a href="http://www.w3.org/TR/xml/#wf-entities">114 : [78] in XML 1.0, see <a href="http://www.w3.org/TR/xml/#wf-entities">
68 : Well-Formed Parsed Entities</a>). The result of the function call is a list 115 : Well-Formed Parsed Entities</a>). The result of the function call is a list
@@ -70,52 +117,45 @@
70 : external entity: that is, elements, processing instructions, comments, and 117 : external entity: that is, elements, processing instructions, comments, and
71 : text nodes. CDATA sections and character references are expanded, and 118 : text nodes. CDATA sections and character references are expanded, and
72 : adjacent characters are merged so the result contains no adjacent text 119 : adjacent characters are merged so the result contains no adjacent text
73 : nodes. If this option is enabled, none of the options d, s, or l may be 120 : nodes. If the option is disabled, the input must be a well-formed XML
74 : enabled. If the option is disabled, the input must be a well-formed XML
75 : document conforming to the Document production 121 : document conforming to the Document production
76 : (<a href="http://www.w3.org/TR/xml/#sec-well-formed">production [1] in XML 1.0</a>).122 : (<a href="http://www.w3.org/TR/xml/#sec-well-formed">production [1] in XML 1.0</a>).
77 : </li>123 : This option can not be used together with either the &lt;schema-validate/&gt; or the &lt;DTD-validate/&gt;
78 :124 : option. Doing so will raise a zerr:ZXQD0003 error.
79 : <li>125 : The &lt;parse-external-parsed-entity/&gt; option has two parameters, given by attributes. The first
80 : dD - enables or disables DTD-based validation. If this option is enabled and126 : attribute is "skip-root-nodes" and it can have a non-negative value. Specifying the paramter
81 : the input references a DTD, then the input must be a well-formed and 127 : tells the parser to skip the given number of root nodes and return only their children. E.g.
82 : DTD-valid XML document. If the option is enabled and the input does not 128 : skip-root-nodes="1" is equivalent to parse-xml($xml-string)/node()/node() . skip-root-nodes="2" is equivalent
83 : reference a DTD then the option is ignored. If the option is disabled, the 129 : to parse-xml($xml-string)/node()/node()/node() , etc. The second attribute is "skip-top-level-text-nodes" with a
84 : input is not required to reference a DTD and if it does reference a DTD then 130 : boolean value. Specifying "true" will tell the parser to skip top level text nodes, returning
85 : the DTD is ignored for validation purposes (though it will still be read for 131 : only the top level elements, comments, PIs, etc. This parameter works in combination with
86 : purposes such as expanding entity references and identifying ID attributes).132 : the "skip-root-nodes" paramter, thus top level text nodes are skipped after "skip-root-nodes" has
87 : </li>133 : been applied.
88 :134 : </li>
89 : <li>135 :
90 : sS - enables or disables strict XSD-based validation. If this option is 136 : <li>
91 : enabled, the result is equivalent to processing the input with the option 137 : &lt;substitute-entities/&gt; - if present, it will enable the XML entities substitutions.
92 : disabled, and then copying the result using the XQuery "validate strict" 138 : </li>
93 : expression.139 :
94 : </li>140 : <li>
95 :141 : &lt;remove-redundant-ns/&gt; - if present, the parser will remove redundant namespaces declarations.
96 : <li>142 : </li>
97 : lL - enables or disables lax XSD-based validation. If this option is enabled, 143 :
98 : the result is equivalent to processing the input with the option disabled, 144 : <li>
99 : and then copying the result using the XQuery "validate lax " expression.145 : &lt;no-CDATA/&gt; - if present, the parser will merge CDATA nodes as text nodes.
100 : </li>146 : </li>
101 :147 :
102 : <li>148 : <li>
103 : wW - enables or disables whitespace stripping. If the option is enabled, 149 : &lt;xinclude-substitutions/&gt; - if present, it will enable the XInclude substitutions.
104 : any whitespace-only text nodes that remain after any DTD-based or XSD-based 150 : </li>
105 : processing are stripped from the input; if it is disabled, such 151 :
106 : whitespace-only text nodes are retained. 152 : <li>
107 : </li>153 : &lt;no-xinclude-nodes/&gt; - if present, the parser will not generate XInclude START/END nodes.
108 :154 : </li>
109 : <li>155 :
110 : fF - enables or disables fatal error processing. If fatal error processing
111 : is enabled, then any failure to parse the input in the manner requested
112 : results in a dynamic error. If fatal error processing is disabled, then any
113 : failure to parse the input (and also, in the case of fn:doc, a failure to
114 : obtain the input by dereferencing the supplied URI) results in the function
115 : returning an empty sequence and raising no error.
116 : </li>
117 : </ul>156 : </ul>
118 :157 :
158 :
119 : @param $xml-string The string that holds the XML to be parsed. If empty,159 : @param $xml-string The string that holds the XML to be parsed. If empty,
120 : the function will return an empty sequence160 : the function will return an empty sequence
121 : @param $options The options for the parsing161 : @param $options The options for the parsing
@@ -131,42 +171,16 @@
131 : document has not passed it.171 : document has not passed it.
132 :172 :
133 : @error err:XQDY0027 The error will be raised if schema validation was enabled173 : @error err:XQDY0027 The error will be raised if schema validation was enabled
134 : and the input document has not passed it.174 : and the input document has not passed it or if the parsing options are not
135 :175 : conformant to the xml-options.xsd schema.
136 :)176 :
137declare function parse-xml:parse-xml-fragment(177 : @example test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-03.xq
138 $xml-string as xs:string?,178 : @example test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-01.xq
139 $options as xs:string) as node()* external;179 : @example test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-07.xq
140180 :
141181 :)
142(:~182
143 : A function to parse XML files and fragments. The behavior is the183declare function parse-xml:parse(
144 : same as the parse-xml-fragment with two arguments.184 $xml-string as xs:string?,
145 :185 $options as element()?) as node()* external;
146 : @param $xml-string The string that holds the XML to be parsed. If empty,186
147 : the function will return an empty sequence
148 : @param $base-uri The baseURI that will be used as the baseURI for every
149 : node returned by this function.
150 : @param $options The options for the parsing (see parse-xml-fragment#2)
151 : @return The parsed XML as a document node or a list of nodes, or an empty
152 : sequence.
153 :
154 : @error zerr:ZXQD0003 The error will be raised if the options to the function
155 : are inconsistent.
156 :
157 : @error err:FODC0006 The error will be raised if the input string is not a
158 : valid XML document or fragment (external general parsed
159 : entity) or if DTD validation was enabled and the
160 : document has not passed it.
161 :
162 : @error err:XQDY0027 The error will be raised if schema validation was enabled
163 : and the input document has not passed it.
164 :
165 : @error err:FODC0007 This error will be raised if $base-uri parameter passed
166 : to the function is not a valid absolute URI.
167 :
168 :)
169declare function parse-xml:parse-xml-fragment(
170 $xml-string as xs:string?,
171 $base-uri as xs:string,
172 $options as xs:string) as node()* external;
173187
=== modified file 'src/api/annotationimpl.cpp' (properties changed: +x to -x)
=== modified file 'src/api/xmldatamanagerimpl.cpp'
--- src/api/xmldatamanagerimpl.cpp 2012-01-23 10:06:24 +0000
+++ src/api/xmldatamanagerimpl.cpp 2012-02-03 22:18:21 +0000
@@ -75,7 +75,7 @@
7575
76********************************************************************************/76********************************************************************************/
77XmlDataManagerImpl::XmlDataManagerImpl()77XmlDataManagerImpl::XmlDataManagerImpl()
78 : 78 :
79 theDocManager(0),79 theDocManager(0),
80 theColManager(0),80 theColManager(0),
81 theW3CColManager(0)81 theW3CColManager(0)
@@ -151,7 +151,7 @@
151DocumentManager*151DocumentManager*
152XmlDataManagerImpl::getDocumentManager() const152XmlDataManagerImpl::getDocumentManager() const
153{153{
154 if (!theDocManager) 154 if (!theDocManager)
155 {155 {
156 theDocManager = new DocumentManagerImpl(theContext, theFactory);156 theDocManager = new DocumentManagerImpl(theContext, theFactory);
157 theDocManager->registerDiagnosticHandler(theDiagnosticHandler);157 theDocManager->registerDiagnosticHandler(theDiagnosticHandler);
@@ -166,7 +166,7 @@
166CollectionManager*166CollectionManager*
167XmlDataManagerImpl::getCollectionManager() const167XmlDataManagerImpl::getCollectionManager() const
168{168{
169 if (!theColManager) 169 if (!theColManager)
170 {170 {
171 theColManager = new CollectionManagerImpl(171 theColManager = new CollectionManagerImpl(
172 theContext,172 theContext,
@@ -185,7 +185,7 @@
185CollectionManager*185CollectionManager*
186XmlDataManagerImpl::getW3CCollectionManager() const186XmlDataManagerImpl::getW3CCollectionManager() const
187{187{
188 if (!theW3CColManager) 188 if (!theW3CColManager)
189 {189 {
190 theW3CColManager = new CollectionManagerImpl(190 theW3CColManager = new CollectionManagerImpl(
191 theContext,191 theContext,
@@ -280,7 +280,7 @@
280 ZORBA_DM_TRY280 ZORBA_DM_TRY
281 {281 {
282 Item lQName = theFactory->createQName(static_context::ZORBA_XML_FN_NS,282 Item lQName = theFactory->createQName(static_context::ZORBA_XML_FN_NS,
283 "parse-xml-fragment");283 "parse");
284284
285 // create a streamable string item285 // create a streamable string item
286 std::vector<ItemSequence_t> lArgs;286 std::vector<ItemSequence_t> lArgs;
@@ -315,7 +315,7 @@
315 ZORBA_DM_TRY315 ZORBA_DM_TRY
316 {316 {
317 Item lQName = theFactory->createQName(static_context::ZORBA_XML_FN_NS,317 Item lQName = theFactory->createQName(static_context::ZORBA_XML_FN_NS,
318 "parse-xml-fragment");318 "parse");
319319
320 // create a streamable string item320 // create a streamable string item
321 std::vector<ItemSequence_t> lArgs;321 std::vector<ItemSequence_t> lArgs;
@@ -382,15 +382,15 @@
382 theDiagnosticHandler = aDiagnosticHandler;382 theDiagnosticHandler = aDiagnosticHandler;
383 theUserDiagnosticHandler = true;383 theUserDiagnosticHandler = true;
384384
385 if (theColManager) 385 if (theColManager)
386 {386 {
387 theColManager->registerDiagnosticHandler(theDiagnosticHandler);387 theColManager->registerDiagnosticHandler(theDiagnosticHandler);
388 }388 }
389 if (theDocManager) 389 if (theDocManager)
390 {390 {
391 theDocManager->registerDiagnosticHandler(theDiagnosticHandler);391 theDocManager->registerDiagnosticHandler(theDiagnosticHandler);
392 }392 }
393 if (theW3CColManager) 393 if (theW3CColManager)
394 {394 {
395 theW3CColManager->registerDiagnosticHandler(theDiagnosticHandler);395 theW3CColManager->registerDiagnosticHandler(theDiagnosticHandler);
396 }396 }
@@ -400,17 +400,17 @@
400/*******************************************************************************400/*******************************************************************************
401401
402********************************************************************************/402********************************************************************************/
403void XmlDataManagerImpl::registerStemmerProvider(StemmerProvider const *p) 403void XmlDataManagerImpl::registerStemmerProvider(StemmerProvider const *p)
404{404{
405 SYNC_CODE(AutoLatch lock(theLatch, Latch::WRITE);)405 SYNC_CODE(AutoLatch lock(theLatch, Latch::WRITE);)
406 if ( theStemmerProviderWrapper ) 406 if ( theStemmerProviderWrapper )
407 {407 {
408 if ( theStemmerProviderWrapper->get_provider() == p )408 if ( theStemmerProviderWrapper->get_provider() == p )
409 return;409 return;
410 delete theStemmerProviderWrapper;410 delete theStemmerProviderWrapper;
411 theStemmerProviderWrapper = nullptr;411 theStemmerProviderWrapper = nullptr;
412 }412 }
413 if ( p ) 413 if ( p )
414 {414 {
415 theStemmerProviderWrapper = new internal::StemmerProviderWrapper( p );415 theStemmerProviderWrapper = new internal::StemmerProviderWrapper( p );
416 theStore->setStemmerProvider( theStemmerProviderWrapper );416 theStore->setStemmerProvider( theStemmerProviderWrapper );
@@ -421,7 +421,7 @@
421/*******************************************************************************421/*******************************************************************************
422422
423********************************************************************************/423********************************************************************************/
424void XmlDataManagerImpl::registerTokenizerProvider(TokenizerProvider const *p) 424void XmlDataManagerImpl::registerTokenizerProvider(TokenizerProvider const *p)
425{425{
426 SYNC_CODE(AutoLatch lock(theLatch, Latch::WRITE);)426 SYNC_CODE(AutoLatch lock(theLatch, Latch::WRITE);)
427 theStore->setTokenizerProvider( p );427 theStore->setTokenizerProvider( p );
428428
=== modified file 'src/diagnostics/diagnostic_en.xml'
--- src/diagnostics/diagnostic_en.xml 2011-12-21 14:40:33 +0000
+++ src/diagnostics/diagnostic_en.xml 2012-02-03 22:18:21 +0000
@@ -1705,7 +1705,7 @@
1705 </diagnostic>1705 </diagnostic>
17061706
1707 <diagnostic code="ZXQD0003" name="INCONSISTENT_PARSE_FRAGMENT_OPTIONS">1707 <diagnostic code="ZXQD0003" name="INCONSISTENT_PARSE_FRAGMENT_OPTIONS">
1708 <value>inconsistent options to the parse-xml-fragment() function: $1</value>1708 <value>inconsistent options to the parse-xml() function: $1</value>
1709 </diagnostic>1709 </diagnostic>
17101710
1711 <diagnostic code="ZXQD0004" name="INVALID_PARAMETER">1711 <diagnostic code="ZXQD0004" name="INVALID_PARAMETER">
@@ -2499,6 +2499,10 @@
2499 <entry key="BadXMLDocument_2o">2499 <entry key="BadXMLDocument_2o">
2500 <value>malformed XML document${ at "2"}</value>2500 <value>malformed XML document${ at "2"}</value>
2501 </entry>2501 </entry>
2502
2503 <entry key="BadXMLNoOpeningTag">
2504 <value>closing tag without matching opening tag</value>
2505 </entry>
25022506
2503 <entry key="BadXMLForXQDoc_3">2507 <entry key="BadXMLForXQDoc_3">
2504 <value>can not parse as XML for xqdoc: $3</value>2508 <value>can not parse as XML for xqdoc: $3</value>
@@ -3408,12 +3412,8 @@
3408 <value>xqueryx content is empty</value>3412 <value>xqueryx content is empty</value>
3409 </entry>3413 </entry>
34103414
3411 <entry key="ParseFragmentOptionDSLNotAllowed">
3412 <value>if the e option is specified, none of the options d, s, or l may be enabled</value>
3413 </entry>
3414
3415 <entry key="ParseFragmentOptionCombinationNotAllowed">3415 <entry key="ParseFragmentOptionCombinationNotAllowed">
3416 <value>specifying both $2 and $3 is an error</value>3416 <value>only one of the &lt;schemaValidate/&gt;, &lt;DTDValidate/&gt; or &lt;parseExternalParsedEntity/&gt; options can be specified</value>
3417 </entry>3417 </entry>
34183418
3419 </subvalues>3419 </subvalues>
34203420
=== modified file 'src/diagnostics/pregenerated/dict_en.cpp'
--- src/diagnostics/pregenerated/dict_en.cpp 2011-12-21 14:40:33 +0000
+++ src/diagnostics/pregenerated/dict_en.cpp 2012-02-03 22:18:21 +0000
@@ -365,7 +365,7 @@
365 { "ZWST0006", "\"$1\": function caching might not give the intended result because the function is declared as $2" },365 { "ZWST0006", "\"$1\": function caching might not give the intended result because the function is declared as $2" },
366 { "ZXQD0001", "\"$1\": prefix not declared when calling function \"$2\" from $3" },366 { "ZXQD0001", "\"$1\": prefix not declared when calling function \"$2\" from $3" },
367 { "ZXQD0002", "\"$1\": $2" },367 { "ZXQD0002", "\"$1\": $2" },
368 { "ZXQD0003", "inconsistent options to the parse-xml-fragment() function: $1" },368 { "ZXQD0003", "inconsistent options to the parse-xml() function: $1" },
369 { "ZXQD0004", "invalid parameter: $1" },369 { "ZXQD0004", "invalid parameter: $1" },
370 { "ZXQD0005", "key with type $1 not subtype or castable to target type $2 of map ($3)" },370 { "ZXQD0005", "key with type $1 not subtype or castable to target type $2 of map ($3)" },
371 { "ZXQD0006", "\"$1\": invalid UTF-8 byte sequence" },371 { "ZXQD0006", "\"$1\": invalid UTF-8 byte sequence" },
@@ -442,6 +442,7 @@
442 { "~BadWordNetPtr_2", "\"$2\": invalid pointer type" },442 { "~BadWordNetPtr_2", "\"$2\": invalid pointer type" },
443 { "~BadXMLDocument_2o", "malformed XML document${ at \"2\"}" },443 { "~BadXMLDocument_2o", "malformed XML document${ at \"2\"}" },
444 { "~BadXMLForXQDoc_3", "can not parse as XML for xqdoc: $3" },444 { "~BadXMLForXQDoc_3", "can not parse as XML for xqdoc: $3" },
445 { "~BadXMLNoOpeningTag", "closing tag without matching opening tag" },
445 { "~BadXQueryVersion", "unsupported XQuery version" },446 { "~BadXQueryVersion", "unsupported XQuery version" },
446 { "~Base64BadChar", "invalid Base64 character" },447 { "~Base64BadChar", "invalid Base64 character" },
447 { "~Base64Equals", "in Base64, '=' must be at the end and followed by one of [AEIMQUYcgkosw048]" },448 { "~Base64Equals", "in Base64, '=' must be at the end and followed by one of [AEIMQUYcgkosw048]" },
@@ -559,8 +560,7 @@
559 { "~OperationNotDef_23", "$2 not defined for type \"$3\"" },560 { "~OperationNotDef_23", "$2 not defined for type \"$3\"" },
560 { "~OperationNotPossibleWithTypes_234", "\"$2\": operation not possible with parameters of type \"$3\" and \"$4\"" },561 { "~OperationNotPossibleWithTypes_234", "\"$2\": operation not possible with parameters of type \"$3\" and \"$4\"" },
561 { "~OuterForClause11", "\"outer-for\" clause only available in XQuery 1.1 or later" },562 { "~OuterForClause11", "\"outer-for\" clause only available in XQuery 1.1 or later" },
562 { "~ParseFragmentOptionCombinationNotAllowed", "specifying both $2 and $3 is an error" },563 { "~ParseFragmentOptionCombinationNotAllowed", "only one of the <schemaValidate/>, <DTDValidate/> or <parseExternalParsedEntity/> options can be specified" },
563 { "~ParseFragmentOptionDSLNotAllowed", "if the e option is specified, none of the options d, s, or l may be enabled" },
564 { "~ParserInitFailed", "parser initialization failed" },564 { "~ParserInitFailed", "parser initialization failed" },
565 { "~ParserNoCreateTree", "XML tree creation failed" },565 { "~ParserNoCreateTree", "XML tree creation failed" },
566 { "~PromotionImpossible", "promotion not possible" },566 { "~PromotionImpossible", "promotion not possible" },
567567
=== modified file 'src/functions/pregenerated/func_parse_fragment.cpp'
--- src/functions/pregenerated/func_parse_fragment.cpp 2011-11-09 05:42:08 +0000
+++ src/functions/pregenerated/func_parse_fragment.cpp 2012-02-03 22:18:21 +0000
@@ -31,7 +31,7 @@
3131
3232
3333
34PlanIter_t fn_zorba_xml_parse_xml_fragment::codegen(34PlanIter_t fn_zorba_xml_parse::codegen(
35 CompilerCB*,35 CompilerCB*,
36 static_context* sctx,36 static_context* sctx,
37 const QueryLoc& loc,37 const QueryLoc& loc,
@@ -46,26 +46,12 @@
46 {46 {
47 47
4848
49 DECL_WITH_KIND(sctx, fn_zorba_xml_parse_xml_fragment,49 DECL_WITH_KIND(sctx, fn_zorba_xml_parse,
50 (createQName("http://www.zorba-xquery.com/modules/xml","","parse-xml-fragment"), 50 (createQName("http://www.zorba-xquery.com/modules/xml","","parse"),
51 GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 51 GENV_TYPESYSTEM.STRING_TYPE_QUESTION,
52 GENV_TYPESYSTEM.STRING_TYPE_ONE, 52 GENV_TYPESYSTEM.ELEMENT_TYPE_QUESTION,
53 GENV_TYPESYSTEM.ANY_NODE_TYPE_STAR),53 GENV_TYPESYSTEM.ANY_NODE_TYPE_STAR),
54 FunctionConsts::FN_ZORBA_XML_PARSE_XML_FRAGMENT_2);54 FunctionConsts::FN_ZORBA_XML_PARSE_2);
55
56 }
57
58
59 {
60
61
62 DECL_WITH_KIND(sctx, fn_zorba_xml_parse_xml_fragment,
63 (createQName("http://www.zorba-xquery.com/modules/xml","","parse-xml-fragment"),
64 GENV_TYPESYSTEM.STRING_TYPE_QUESTION,
65 GENV_TYPESYSTEM.STRING_TYPE_ONE,
66 GENV_TYPESYSTEM.STRING_TYPE_ONE,
67 GENV_TYPESYSTEM.ANY_NODE_TYPE_STAR),
68 FunctionConsts::FN_ZORBA_XML_PARSE_XML_FRAGMENT_3);
6955
70 }56 }
7157
7258
=== modified file 'src/functions/pregenerated/func_parse_fragment.h'
--- src/functions/pregenerated/func_parse_fragment.h 2012-01-11 17:30:25 +0000
+++ src/functions/pregenerated/func_parse_fragment.h 2012-02-03 22:18:21 +0000
@@ -38,11 +38,11 @@
3838
3939
4040
41//fn-zorba-xml:parse-xml-fragment41//fn-zorba-xml:parse
42class fn_zorba_xml_parse_xml_fragment : public function42class fn_zorba_xml_parse : public function
43{43{
44public:44public:
45 fn_zorba_xml_parse_xml_fragment(const signature& sig, FunctionConsts::FunctionKind kind)45 fn_zorba_xml_parse(const signature& sig, FunctionConsts::FunctionKind kind)
46 : 46 :
47 function(sig, kind)47 function(sig, kind)
48 {48 {
4949
=== modified file 'src/functions/pregenerated/function_enum.h'
--- src/functions/pregenerated/function_enum.h 2012-01-11 17:30:25 +0000
+++ src/functions/pregenerated/function_enum.h 2012-02-03 22:18:21 +0000
@@ -252,8 +252,7 @@
252 FN_FORMAT_NUMBER_3,252 FN_FORMAT_NUMBER_3,
253 FN_FORMAT_INTEGER_2,253 FN_FORMAT_INTEGER_2,
254 FN_FORMAT_INTEGER_3,254 FN_FORMAT_INTEGER_3,
255 FN_ZORBA_XML_PARSE_XML_FRAGMENT_2,255 FN_ZORBA_XML_PARSE_2,
256 FN_ZORBA_XML_PARSE_XML_FRAGMENT_3,
257 FN_PARSE_XML_1,256 FN_PARSE_XML_1,
258 FN_PARSE_XML_2,257 FN_PARSE_XML_2,
259 FN_SERIALIZE_1,258 FN_SERIALIZE_1,
260259
=== modified file 'src/runtime/parsing_and_serializing/fragment_istream.h' (properties changed: +x to -x)
--- src/runtime/parsing_and_serializing/fragment_istream.h 2011-07-16 13:33:13 +0000
+++ src/runtime/parsing_and_serializing/fragment_istream.h 2012-02-03 22:18:21 +0000
@@ -18,55 +18,99 @@
18#define ZORBA_RUNTIME_PARSING_AND_SERIALIZING_FRAGMENT_ISTREAM_H18#define ZORBA_RUNTIME_PARSING_AND_SERIALIZING_FRAGMENT_ISTREAM_H
1919
20#include <iostream>20#include <iostream>
21#include <libxml/parser.h>
22#include <store/api/iterator.h>
2123
22namespace zorba {24namespace zorba {
2325
24/**26/**
25 * A class to hold an input stream for the parse-xml-fragment function27 * A class to hold an input stream for the parse-xml:parse() function
26 * Author: Zorba Team28 * Author: Nicolae Brinza
27 */29 */
28class FragmentIStream : public std::istream30class FragmentIStream : public std::istream
29{31{
30public:32public:
33 static const unsigned int BUFFER_SIZE = 4096;
34 static const unsigned int LOOKAHEAD_BYTES = 3; // lookahead fetching is implemented, but currently not used
35 static const unsigned int PARSED_NODES_BATCH_SIZE = 1024;
36
37public:
31 FragmentIStream()38 FragmentIStream()
32 :39 :
33 std::istream(NULL),40 std::istream(NULL),
34 theIss(NULL),41 theIss(NULL),
35 theStream(NULL),42 theStream(NULL),
36 theBuffer(NULL),43 theBuffer(NULL),
37 buffer_size(0),44 bytes_in_buffer(0),
38 current_offset(0)45 current_offset(0),
46 current_element_depth(0),
47 root_elements_to_skip(0),
48 ctxt(NULL),
49 first_start_doc(true),
50 forced_parser_stop(false),
51 reached_eof(false),
52 parsed_nodes_count(0),
53 children(NULL)
39 {54 {
40 };55 };
4156
57 bool stream_is_consumed()
58 {
59 return reached_eof && current_offset >= bytes_in_buffer;
60 }
61
42 void reset()62 void reset()
43 {63 {
44 if (theBuffer)64 if (theBuffer)
65 {
45 delete[] theBuffer;66 delete[] theBuffer;
67 }
68
46 if (theIss)69 if (theIss)
70 {
47 delete theIss;71 delete theIss;
72 }
73
74 if (ctxt)
75 {
76 xmlCtxtReset(ctxt);
77 xmlFreeParserCtxt(ctxt);
78 }
4879
49 theIss = NULL;80 theIss = NULL;
50 theStream = NULL;81 theStream = NULL;
51 theBuffer = NULL;82 theBuffer = NULL;
52 buffer_size = 0;83 bytes_in_buffer = 0;
53 current_offset = 0;84 current_offset = 0;
85 current_element_depth = 0;
86 root_elements_to_skip = 0;
87 ctxt = NULL;
88 first_start_doc = true;
89 forced_parser_stop = false;
90 reached_eof = false;
91 parsed_nodes_count = 0;
92 children = NULL;
54 }93 }
5594
56 virtual ~FragmentIStream()95 virtual ~FragmentIStream()
57 {96 {
58 if (theBuffer)97 reset();
59 delete[] theBuffer;
60 if (theIss)
61 delete theIss;
62 }98 }
6399
64public:100public:
65 std::istringstream* theIss;101 std::istringstream* theIss;
66 std::istream* theStream;102 std::istream* theStream;
67 char* theBuffer;103 char* theBuffer;
68 unsigned long buffer_size;104 unsigned long bytes_in_buffer;
69 unsigned long current_offset;105 unsigned long current_offset;
106 int current_element_depth;
107 int root_elements_to_skip;
108 xmlParserCtxtPtr ctxt;
109 bool first_start_doc;
110 bool forced_parser_stop;
111 bool reached_eof;
112 unsigned int parsed_nodes_count;
113 store::Iterator_t children;
70};114};
71115
72}116}
73117
=== modified file 'src/runtime/parsing_and_serializing/parse_fragment_impl.cpp' (properties changed: +x to -x)
--- src/runtime/parsing_and_serializing/parse_fragment_impl.cpp 2011-08-10 02:50:23 +0000
+++ src/runtime/parsing_and_serializing/parse_fragment_impl.cpp 2012-02-03 22:18:21 +0000
@@ -25,117 +25,137 @@
25#include "store/api/store.h"25#include "store/api/store.h"
26#include "store/api/item.h"26#include "store/api/item.h"
27#include "store/api/item_factory.h"27#include "store/api/item_factory.h"
28#include "store/api/load_properties.h"
2829
29#include "system/globalenv.h"30#include "system/globalenv.h"
3031
31#include "types/schema/schema.h"32#include "types/schema/schema.h"
32#include "types/schema/validate.h"33#include "types/schema/validate.h"
3334
35
34namespace zorba36namespace zorba
35{37{
3638
37/*******************************************************************************39/*******************************************************************************
38 14.9.1 fn-zorba-xml:parse-xml-fragment40 14.9.1 fn-zorba-xml:parse
39********************************************************************************/41********************************************************************************/
4042
41class ParseXmlFragmentOptions43store::Item_t getFirstAttribute(store::Item_t node)
42{44{
43public:45 store::Item_t attr;
44 // all options are false by default, except for enableFatelErrorProcessing which is true46 store::Iterator_t attributes = node->getAttributes();
45 bool enableExternalEntitiesProcessing;47 attributes->open();
46 bool enableDTDValidation;48 attributes->next(attr);
47 bool enableStrictSchemaValidation;49 attributes->close();
48 bool enableLaxSchemaValidation;50 return attr;
49 bool enableWhitespaceStripping;51}
50 bool enableFatelErrorProcessing;52
5153void processOptions(store::Item_t item, store::LoadProperties& props, static_context* theSctx, const QueryLoc& loc)
52public:54{
53 ParseXmlFragmentOptions() :55 URI lValidatedBaseUri;
54 enableExternalEntitiesProcessing(false),56 store::Item_t child, tempItem;
55 enableDTDValidation(false),57
56 enableStrictSchemaValidation(false),58 if (item.getp() == NULL)
57 enableLaxSchemaValidation(false),59 return;
58 enableWhitespaceStripping(false),60
59 enableFatelErrorProcessing(true) // only enableFatelErrorProcessing is set to true61#ifndef ZORBA_NO_XMLSCHEMA
60 {62 tempItem = NULL; // used as the effectiveValidationValue()'s typeName
61 }63 Validator::effectiveValidationValue(
6264 item,
63 void reset()65 item,
64 {66 tempItem,
65 enableExternalEntitiesProcessing = false;67 theSctx->get_typemanager(),
66 enableDTDValidation = false;68 ParseConstants::val_strict,
67 enableStrictSchemaValidation = false;69 theSctx,
68 enableLaxSchemaValidation = false;70 loc);
69 enableWhitespaceStripping = false;71#endif
70 enableFatelErrorProcessing = true; // only enableFatelErrorProcessing is set to true72
71 }73 store::Iterator_t children = item->getChildren();
7274 children->open();
73 static ParseXmlFragmentOptions parseOptions(const zstring& options, const QueryLoc& loc)75
74 {76 while (children->next(child))
75 ParseXmlFragmentOptions opt;77 {
7678 if (child->getNodeKind() != store::StoreConsts::elementNode)
77 if (options.find("e") != zstring::npos && options.find("E") != zstring::npos)79 continue;
78 throw XQUERY_EXCEPTION(zerr::ZXQD0003_INCONSISTENT_PARSE_FRAGMENT_OPTIONS,80
79 ERROR_PARAMS(ZED(ParseFragmentOptionCombinationNotAllowed), "e", "E"), ERROR_LOC( loc ));81 if (child->getNodeName()->getLocalName() == "base-uri")
8082 {
81 if (options.find("d") != zstring::npos && options.find("D") != zstring::npos)83 store::Item_t attr = getFirstAttribute(child);
82 throw XQUERY_EXCEPTION(zerr::ZXQD0003_INCONSISTENT_PARSE_FRAGMENT_OPTIONS,84
83 ERROR_PARAMS(ZED(ParseFragmentOptionCombinationNotAllowed), "d", "D"), ERROR_LOC( loc ));85 try {
8486 lValidatedBaseUri = URI(attr->getStringValue());
85 if (options.find("s") != zstring::npos && options.find("S") != zstring::npos)87 } catch (ZorbaException const& /* e */) {
86 throw XQUERY_EXCEPTION(zerr::ZXQD0003_INCONSISTENT_PARSE_FRAGMENT_OPTIONS,88 throw XQUERY_EXCEPTION(
87 ERROR_PARAMS(ZED(ParseFragmentOptionCombinationNotAllowed), "s", "S"), ERROR_LOC( loc ));89 err::FODC0007,
8890 ERROR_PARAMS( attr->getStringValue() ),
89 if (options.find("l") != zstring::npos && options.find("L") != zstring::npos)91 ERROR_LOC( loc )
90 throw XQUERY_EXCEPTION(zerr::ZXQD0003_INCONSISTENT_PARSE_FRAGMENT_OPTIONS,92 );
91 ERROR_PARAMS(ZED(ParseFragmentOptionCombinationNotAllowed), "l", "L"), ERROR_LOC( loc ));93 }
9294
93 if (options.find("w") != zstring::npos && options.find("W") != zstring::npos)95 if (!lValidatedBaseUri.is_absolute()) {
94 throw XQUERY_EXCEPTION(zerr::ZXQD0003_INCONSISTENT_PARSE_FRAGMENT_OPTIONS,96 throw XQUERY_EXCEPTION(
95 ERROR_PARAMS(ZED(ParseFragmentOptionCombinationNotAllowed), "w", "W"), ERROR_LOC( loc ));97 err::FODC0007,
9698 ERROR_PARAMS( lValidatedBaseUri.toString() ),
97 if (options.find("f") != zstring::npos && options.find("F") != zstring::npos)99 ERROR_LOC( loc )
98 throw XQUERY_EXCEPTION(zerr::ZXQD0003_INCONSISTENT_PARSE_FRAGMENT_OPTIONS,100 );
99 ERROR_PARAMS(ZED(ParseFragmentOptionCombinationNotAllowed), "f", "F"), ERROR_LOC( loc ));101 }
100102
101 if (options.find("e") != zstring::npos)103 props.setBaseUri(attr->getStringValue());
102 opt.enableExternalEntitiesProcessing = true;104 }
103 if (options.find("d") != zstring::npos)105 else if (child->getNodeName()->getLocalName() == "no-error")
104 opt.enableDTDValidation = true;106 props.setNoError(true);
105 if (options.find("s") != zstring::npos)107 else if (child->getNodeName()->getLocalName() == "strip-boundary-space")
106 opt.enableStrictSchemaValidation = true;108 props.setStripWhitespace(true);
107 if (options.find("l") != zstring::npos)109 else if (child->getNodeName()->getLocalName() == "schema-validate")
108 opt.enableLaxSchemaValidation = true;110 {
109 if (options.find("w") != zstring::npos)111 store::Item_t attr = getFirstAttribute(child);
110 opt.enableWhitespaceStripping = true;112 if (attr->getStringValue() == "strict")
111 if (options.find("f") != zstring::npos)113 props.setSchemaStrictValidate(true);
112 opt.enableFatelErrorProcessing = true;114 else
113115 props.setSchemaLaxValidate(true);
114 if (options.find("E") != zstring::npos)116 }
115 opt.enableExternalEntitiesProcessing = false;117 else if (child->getNodeName()->getLocalName() == "DTD-validate")
116 if (options.find("D") != zstring::npos)118 props.setDTDValidate(true);
117 opt.enableDTDValidation = false;119 else if (child->getNodeName()->getLocalName() == "DTD-load")
118 if (options.find("S") != zstring::npos)120 props.setDTDLoad(true);
119 opt.enableStrictSchemaValidation = false;121 else if (child->getNodeName()->getLocalName() == "default-DTD-attributes")
120 if (options.find("L") != zstring::npos)122 props.setDefaultDTDAttributes(true);
121 opt.enableLaxSchemaValidation = false;123 else if (child->getNodeName()->getLocalName() == "parse-external-parsed-entity")
122 if (options.find("W") != zstring::npos)124 {
123 opt.enableWhitespaceStripping = false;125 props.setParseExternalParsedEntity(true);
124 if (options.find("F") != zstring::npos)126 store::Item_t attr;
125 opt.enableFatelErrorProcessing = false;127 store::Iterator_t attribs = child->getAttributes();
126128 attribs->open();
127 if (opt.enableExternalEntitiesProcessing129 while (attribs->next(attr))
128 &&130 {
129 (opt.enableDTDValidation || opt.enableStrictSchemaValidation || opt.enableLaxSchemaValidation))131 if (attr->getNodeName()->getLocalName() == "skip-root-nodes")
130 {132 props.setSkipRootNodes(ztd::aton<xs_int>(attr->getStringValue().c_str()));
131 throw XQUERY_EXCEPTION(zerr::ZXQD0003_INCONSISTENT_PARSE_FRAGMENT_OPTIONS,133 else if (attr->getNodeName()->getLocalName() == "skip-top-level-text-nodes")
132 ERROR_PARAMS(ZED(ParseFragmentOptionDSLNotAllowed)), ERROR_LOC( loc ));134 props.setSkipTopLevelTextNodes(true);
133 }135 }
134136 attribs->close();
135 return opt;137 }
136 }138 else if (child->getNodeName()->getLocalName() == "substitute-entities")
137};139 props.setSubstituteEntities(true);
138140 else if (child->getNodeName()->getLocalName() == "xinclude-substitutions")
141 props.setXincludeSubstitutions(true);
142 else if (child->getNodeName()->getLocalName() == "remove-redundant-ns")
143 props.setRemoveRedundantNS(true);
144 else if (child->getNodeName()->getLocalName() == "no-CDATA")
145 props.setNoCDATA(true);
146 else if (child->getNodeName()->getLocalName() == "no-xinclude-nodes")
147 props.setNoXIncludeNodes(true);
148 }
149
150 children->close();
151
152 if (props.getSchemaLaxValidate() + props.getSchemaStrictValidate() +
153 props.getDTDValidate() + props.getParseExternalParsedEntity() > 1)
154 {
155 throw XQUERY_EXCEPTION(zerr::ZXQD0003_INCONSISTENT_PARSE_FRAGMENT_OPTIONS,
156 ERROR_PARAMS(ZED(ParseFragmentOptionCombinationNotAllowed)), ERROR_LOC( loc ));
157 }
158}
139159
140/*******************************************************************************160/*******************************************************************************
141161
@@ -145,8 +165,7 @@
145{165{
146 PlanIteratorState::reset(planState);166 PlanIteratorState::reset(planState);
147 theFragmentStream.reset();167 theFragmentStream.reset();
148 theProperties.setEnableDtd(false);168 theProperties.reset();
149 theProperties.setEnableExtParsedEntity(false);
150 theProperties.setStoreDocument(false);169 theProperties.setStoreDocument(false);
151 baseUri = "";170 baseUri = "";
152 docUri = "";171 docUri = "";
@@ -161,9 +180,7 @@
161{180{
162 store::Store& lStore = GENV.getStore();181 store::Store& lStore = GENV.getStore();
163 zstring docString;182 zstring docString;
164 URI lValidatedBaseUri;
165 store::Item_t tempItem;183 store::Item_t tempItem;
166 ParseXmlFragmentOptions parseOptions;
167 bool validated = true;184 bool validated = true;
168185
169 FnParseXmlFragmentIteratorState* state;186 FnParseXmlFragmentIteratorState* state;
@@ -182,87 +199,61 @@
182 state->theFragmentStream.theStream = state->theFragmentStream.theIss;199 state->theFragmentStream.theStream = state->theFragmentStream.theIss;
183 }200 }
184201
185 // optional base URI argument202 // read options
186 if (theChildren.size() == 3)203 consumeNext(tempItem, theChildren[1].getp(), planState);
187 {204 state->theProperties.setBaseUri(theSctx->get_base_uri());
188 consumeNext(result, theChildren[1].getp(), planState);205 state->theProperties.setStoreDocument(false);
189 ZORBA_ASSERT(result);206 processOptions(tempItem, state->theProperties, theSctx, loc);
190
191 try {
192 lValidatedBaseUri = URI(result->getStringValue());
193 } catch (ZorbaException const& /* e */) {
194 throw XQUERY_EXCEPTION(
195 err::FODC0007,
196 ERROR_PARAMS( result->getStringValue() ),
197 ERROR_LOC( loc )
198 );
199 }
200
201 if (!lValidatedBaseUri.is_absolute()) {
202 throw XQUERY_EXCEPTION(
203 err::FODC0007,
204 ERROR_PARAMS( lValidatedBaseUri.toString() ),
205 ERROR_LOC( loc )
206 );
207 }
208
209 result->getStringValue2(state->baseUri);
210
211 // read options
212 consumeNext(tempItem, theChildren[2].getp(), planState);
213 parseOptions = ParseXmlFragmentOptions::parseOptions(tempItem->getStringValue(), loc);
214
215 } else {
216 // read options
217 consumeNext(tempItem, theChildren[1].getp(), planState);
218 parseOptions = ParseXmlFragmentOptions::parseOptions(tempItem->getStringValue(), loc);
219
220 state->baseUri = theSctx->get_base_uri();
221 }
222207
223 // baseURI serves both as the base URI used by the XML parser208 // baseURI serves both as the base URI used by the XML parser
224 // to resolve relative entity references within the document,209 // to resolve relative entity references within the document,
225 // and as the base URI of the document node that is returned.210 // and as the base URI of the document node that is returned.
226 state->docUri = state->baseUri;211 state->baseUri = state->theProperties.getBaseUri();
227212 state->docUri = state->theProperties.getBaseUri();
228 // The DTD and ExternalEntitiesProcessing options/props cannot both be true at the same time213
229 if (parseOptions.enableDTDValidation)214
230 state->theProperties.setEnableDtd(true);215 ////////////////////////////////////////////////////////////////////////
231 if (parseOptions.enableExternalEntitiesProcessing)216 // External parsed entity processing
232 state->theProperties.setEnableExtParsedEntity(true);217 ////////////////////////////////////////////////////////////////////////
233 state->theProperties.setStoreDocument(false);218 if (state->theProperties.getParseExternalParsedEntity())
234
235 if (state->theProperties.getEnableExtParsedEntity())
236 {219 {
237 // state->theFragmentStream.root_elements_to_skip = 0;220 state->theFragmentStream.root_elements_to_skip = state->theProperties.getSkipRootNodes();
238221
239 while (state->theFragmentStream.theBuffer == NULL222 while ( ! state->theFragmentStream.stream_is_consumed())
240 ||
241 state->theFragmentStream.current_offset < state->theFragmentStream.buffer_size)
242 {223 {
243 try {224 try {
244 result = lStore.loadDocument(state->baseUri, state->docUri, state->theFragmentStream, state->theProperties);225 result = lStore.loadDocument(state->baseUri, state->docUri, state->theFragmentStream, state->theProperties);
245 } catch (ZorbaException const& e) {226 } catch (ZorbaException const& e) {
246 if (parseOptions.enableFatelErrorProcessing)227 if ( ! state->theProperties.getNoError())
247 throw XQUERY_EXCEPTION( err::FODC0006, ERROR_PARAMS("parse-xml:parse-xml-fragment()", e.what()), ERROR_LOC( loc ));228 throw XQUERY_EXCEPTION( err::FODC0006, ERROR_PARAMS("parse-xml:parse()", e.what()), ERROR_LOC( loc ));
248 else229 else
249 result = NULL;230 result = NULL;
250 }231 }
251232
252 if (result != NULL)233 if (result == NULL)
234 continue;
235
236 // Return the children of document node
237 state->theFragmentStream.children = result->getChildren();
238 while (state->theFragmentStream.children->next(result) && result != NULL)
253 {239 {
254 result->getChildren()->next(result);240 if (state->theProperties.getSkipTopLevelTextNodes() && result->getNodeKind() == store::StoreConsts::textNode)
241 continue;
242
255 STACK_PUSH(true, state);243 STACK_PUSH(true, state);
256 }244 }
257 }245 }
258 }246 }
247 ////////////////////////////////////////////////////////////////////////
248 // XML document processing
249 ////////////////////////////////////////////////////////////////////////
259 else // if (!state->theProperties.getEnableExtParsedEntity())250 else // if (!state->theProperties.getEnableExtParsedEntity())
260 {251 {
261 try {252 try {
262 result = lStore.loadDocument(state->baseUri, state->docUri, *state->theFragmentStream.theStream, state->theProperties);253 result = lStore.loadDocument(state->baseUri, state->docUri, *state->theFragmentStream.theStream, state->theProperties);
263 } catch (ZorbaException const& e) {254 } catch (ZorbaException const& e) {
264 if (parseOptions.enableFatelErrorProcessing)255 if ( ! state->theProperties.getNoError())
265 throw XQUERY_EXCEPTION( err::FODC0006, ERROR_PARAMS("parse-xml:parse-xml-fragment()", e.what()), ERROR_LOC( loc ));256 throw XQUERY_EXCEPTION( err::FODC0006, ERROR_PARAMS("parse-xml:parse()", e.what()), ERROR_LOC( loc ));
266 else257 else
267 result = NULL;258 result = NULL;
268 }259 }
@@ -270,7 +261,7 @@
270 if (result != NULL)261 if (result != NULL)
271 {262 {
272#ifndef ZORBA_NO_XMLSCHEMA263#ifndef ZORBA_NO_XMLSCHEMA
273 if (parseOptions.enableStrictSchemaValidation || parseOptions.enableLaxSchemaValidation)264 if (state->theProperties.getSchemaLaxValidate() || state->theProperties.getSchemaStrictValidate())
274 {265 {
275 try266 try
276 {267 {
@@ -280,13 +271,13 @@
280 result,271 result,
281 tempItem,272 tempItem,
282 theSctx->get_typemanager(),273 theSctx->get_typemanager(),
283 parseOptions.enableLaxSchemaValidation ? ParseConstants::val_lax : ParseConstants::val_strict,274 state->theProperties.getSchemaLaxValidate() ? ParseConstants::val_lax : ParseConstants::val_strict,
284 theSctx,275 theSctx,
285 this->loc);276 this->loc);
286 }277 }
287 catch (ZorbaException& /*e*/)278 catch (ZorbaException& /*e*/)
288 {279 {
289 if (parseOptions.enableFatelErrorProcessing)280 if ( ! state->theProperties.getNoError())
290 throw;281 throw;
291 else282 else
292 {283 {
@@ -298,11 +289,6 @@
298#endif289#endif
299 // Ignore the schema validation options if Zorba is built without schema support290 // Ignore the schema validation options if Zorba is built without schema support
300291
301 if (result != NULL && validated && parseOptions.enableWhitespaceStripping)
302 {
303 // TODO: whitespace stripping
304 }
305
306 STACK_PUSH(validated, state);292 STACK_PUSH(validated, state);
307 } // if (result != NULL)293 } // if (result != NULL)
308 } // if (state->theProperties.getEnableExtParsedEntity())294 } // if (state->theProperties.getEnableExtParsedEntity())
309295
=== modified file 'src/runtime/parsing_and_serializing/pregenerated/parse_fragment.cpp' (properties changed: +x to -x)
=== modified file 'src/runtime/parsing_and_serializing/pregenerated/parse_fragment.h' (properties changed: +x to -x)
--- src/runtime/parsing_and_serializing/pregenerated/parse_fragment.h 2011-10-19 15:28:51 +0000
+++ src/runtime/parsing_and_serializing/pregenerated/parse_fragment.h 2012-02-03 22:18:21 +0000
@@ -36,7 +36,7 @@
36namespace zorba {36namespace zorba {
3737
38/**38/**
39 * fn-zorba-xml:parse-xml-fragment39 * fn-zorba-xml:parse
40 * Author: Zorba Team40 * Author: Zorba Team
41 */41 */
42class FnParseXmlFragmentIteratorState : public PlanIteratorState42class FnParseXmlFragmentIteratorState : public PlanIteratorState
4343
=== modified file 'src/runtime/sequences/sequences_impl.cpp'
--- src/runtime/sequences/sequences_impl.cpp 2012-01-20 21:48:24 +0000
+++ src/runtime/sequences/sequences_impl.cpp 2012-02-03 22:18:21 +0000
@@ -464,13 +464,13 @@
464 state->theIsChildReset = false;464 state->theIsChildReset = false;
465465
466 CONSUME(startPosItem, 1);466 CONSUME(startPosItem, 1);
467 startPos = 467 startPos =
468 static_cast<xs_long>(startPosItem->getDoubleValue().round().getNumber()) - 1;468 static_cast<xs_long>(startPosItem->getDoubleValue().round().getNumber()) - 1;
469469
470 if (theChildren.size() == 3)470 if (theChildren.size() == 3)
471 {471 {
472 CONSUME(lengthItem, 2);472 CONSUME(lengthItem, 2);
473 state->theRemaining = 473 state->theRemaining =
474 static_cast<xs_long>(lengthItem->getDoubleValue().round().getNumber());474 static_cast<xs_long>(lengthItem->getDoubleValue().round().getNumber());
475 }475 }
476476
@@ -1016,7 +1016,7 @@
1016}1016}
10171017
1018bool FnDeepEqualIterator::nextImpl(1018bool FnDeepEqualIterator::nextImpl(
1019 store::Item_t& result, 1019 store::Item_t& result,
1020 PlanState& planState) const1020 PlanState& planState) const
1021{1021{
1022 PlanIteratorState* state;1022 PlanIteratorState* state;
@@ -1044,7 +1044,7 @@
1044 break;1044 break;
1045 }1045 }
10461046
1047 if (arg1->isFunction() || arg2->isFunction()) 1047 if (arg1->isFunction() || arg2->isFunction())
1048 {1048 {
1049 throw XQUERY_EXCEPTION(1049 throw XQUERY_EXCEPTION(
1050 err::FOTY0015,1050 err::FOTY0015,
@@ -1144,12 +1144,12 @@
1144 DEFAULT_STACK_INIT(PlanIteratorState, state, planState);1144 DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
11451145
11461146
1147 for (;;) 1147 for (;;)
1148 {1148 {
1149 // load items1149 // load items
1150 for (i = 0; i < 2; i++) 1150 for (i = 0; i < 2; i++)
1151 {1151 {
1152 if (item [i] == NULL) 1152 if (item [i] == NULL)
1153 {1153 {
1154 if (!CONSUME (item[i], i))1154 if (!CONSUME (item[i], i))
1155 {1155 {
@@ -1161,7 +1161,7 @@
11611161
1162 // advance, output1162 // advance, output
1163 order = GENV_STORE.compareNodes(item[0].getp(), item[1].getp());1163 order = GENV_STORE.compareNodes(item[0].getp(), item[1].getp());
1164 if ( order == 0 ) 1164 if ( order == 0 )
1165 {1165 {
1166 result = item[0];1166 result = item[0];
1167 STACK_PUSH (true, state);1167 STACK_PUSH (true, state);
@@ -1721,7 +1721,7 @@
1721 planState.theGlobalDynCtx->theDocLoadingUserTime +=1721 planState.theGlobalDynCtx->theDocLoadingUserTime +=
1722 zorbatm::get_cputime_elapsed(t0user, t1user);1722 zorbatm::get_cputime_elapsed(t0user, t1user);
17231723
1724 planState.theGlobalDynCtx->theDocLoadingTime += 1724 planState.theGlobalDynCtx->theDocLoadingTime +=
1725 zorbatm::get_walltime_elapsed(t0, t1);1725 zorbatm::get_walltime_elapsed(t0, t1);
1726}1726}
17271727
@@ -1815,7 +1815,7 @@
1815 // Prepare a LoadProperties for loading the stream into the store1815 // Prepare a LoadProperties for loading the stream into the store
1816 store::LoadProperties lLoadProperties;1816 store::LoadProperties lLoadProperties;
1817 lLoadProperties.setStoreDocument(true);1817 lLoadProperties.setStoreDocument(true);
1818 lLoadProperties.setEnableDtd( aSctx->is_feature_set( feature::dtd ) );1818 lLoadProperties.setDTDValidate( aSctx->is_feature_set( feature::dtd ) );
18191819
1820 // Resolve URI to a stream1820 // Resolve URI to a stream
1821 zstring lErrorMessage;1821 zstring lErrorMessage;
18221822
=== modified file 'src/runtime/spec/parsing_and_serializing/parse_fragment.xml'
--- src/runtime/spec/parsing_and_serializing/parse_fragment.xml 2011-07-15 16:39:51 +0000
+++ src/runtime/spec/parsing_and_serializing/parse_fragment.xml 2012-02-03 22:18:21 +0000
@@ -19,27 +19,20 @@
1919
20<!--20<!--
21/*******************************************************************************21/*******************************************************************************
22 * 14.9.1 fn:parse-xml-fragment22 * 14.9.1 parse-xml:parse
23********************************************************************************/23********************************************************************************/
24-->24-->
25 <zorba:iterator name="FnParseXmlFragmentIterator">25 <zorba:iterator name="FnParseXmlFragmentIterator">
26 26
27 <zorba:description author="Zorba Team">fn-zorba-xml:parse-xml-fragment</zorba:description>27 <zorba:description author="Zorba Team">fn-zorba-xml:parse</zorba:description>
28 28
29 <zorba:function>29 <zorba:function>
30 <zorba:signature localname="parse-xml-fragment" prefix="fn-zorba-xml">30 <zorba:signature localname="parse" prefix="fn-zorba-xml">
31 <zorba:param>xs:string?</zorba:param> <!-- string to parse -->31 <zorba:param>xs:string?</zorba:param> <!-- string to parse -->
32 <zorba:param>xs:string</zorba:param> <!-- parse-xml options -->32 <zorba:param>element()?</zorba:param> <!-- parse() options -->
33 <zorba:output>node()*</zorba:output>33 <zorba:output>node()*</zorba:output>
34 </zorba:signature>34 </zorba:signature>
3535
36 <zorba:signature localname="parse-xml-fragment" prefix="fn-zorba-xml">
37 <zorba:param>xs:string?</zorba:param> <!-- string to parse -->
38 <zorba:param>xs:string</zorba:param> <!-- baseURI -->
39 <zorba:param>xs:string</zorba:param> <!-- parse-xml options -->
40 <zorba:output>node()*</zorba:output>
41 </zorba:signature>
42
43 <zorba:methods>36 <zorba:methods>
44 <zorba:accessesDynCtx returnValue="true"/>37 <zorba:accessesDynCtx returnValue="true"/>
45 </zorba:methods>38 </zorba:methods>
4639
=== modified file 'src/store/api/load_properties.h'
--- src/store/api/load_properties.h 2011-06-29 15:03:41 +0000
+++ src/store/api/load_properties.h 2012-02-03 22:18:21 +0000
@@ -35,12 +35,70 @@
35{35{
36private:36private:
37 bool theStoreDocument;37 bool theStoreDocument;
38 bool theEnableDtdLoader;38 zstring theBaseUri;
39 bool theEnableExtParsedEntityLoader;39 bool theNoError;
40 bool theStripWhitespace;
41 bool theSchemaLaxValidate;
42 bool theSchemaStrictValidate;
43 bool theDTDValidate;
44 bool theDTDLoad;
45 bool theDefaultDTDAttributes;
46 bool theParseExternalParsedEntity;
47 unsigned int theSkipRootNodes;
48 bool theSkipTopLevelTextNodes;
49 bool theSubstituteEntities;
50 bool theXincludeSubstitutions;
51 bool theRemoveRedundantNS;
52 bool theNoCDATA;
53 bool theNoXIncludeNodes;
4054
41public:55public:
42 LoadProperties() : theStoreDocument(true), theEnableDtdLoader(false), theEnableExtParsedEntityLoader(false) {}56 LoadProperties()
43 virtual ~LoadProperties() {}57 :
58 theStoreDocument(true),
59 theBaseUri(""),
60 theNoError(false),
61 theStripWhitespace(false),
62 theSchemaLaxValidate(false),
63 theSchemaStrictValidate(false),
64 theDTDValidate(false),
65 theDTDLoad(false),
66 theDefaultDTDAttributes(false),
67 theParseExternalParsedEntity(false),
68 theSkipRootNodes(0),
69 theSkipTopLevelTextNodes(false),
70 theSubstituteEntities(false),
71 theXincludeSubstitutions(false),
72 theRemoveRedundantNS(false),
73 theNoCDATA(false),
74 theNoXIncludeNodes(false)
75 {
76 }
77
78 virtual ~LoadProperties()
79 {
80 }
81
82 void reset()
83 {
84 theStoreDocument = true;
85 theBaseUri = "";
86 theNoError = false;
87 theStripWhitespace = false;
88 theSchemaLaxValidate = false;
89 theSchemaStrictValidate = false;
90 theDTDValidate = false;
91 theDTDLoad = false;
92 theDefaultDTDAttributes = false;
93 theParseExternalParsedEntity = false;
94 theSkipRootNodes = 0;
95 theSkipTopLevelTextNodes = false;
96 theSubstituteEntities = false;
97 theXincludeSubstitutions = false;
98 theRemoveRedundantNS = false;
99 theNoCDATA = false;
100 theNoXIncludeNodes = false;
101 }
44102
45 /**103 /**
46 * Set the property storeDocument, it specifies whether the document104 * Set the property storeDocument, it specifies whether the document
@@ -60,40 +118,168 @@
60 return theStoreDocument;118 return theStoreDocument;
61 }119 }
62120
63 /**121 // theBaseUri
64 * Set the property enableDtd, it specifies whether the document's122 void setBaseUri(const zstring& aBaseUri)
65 * dtd should be enabled when loading123 {
66 */124 theBaseUri = aBaseUri;
67 void setEnableDtd(bool aEnableDtdLoader)125 }
68 {126 zstring getBaseUri() const
69 theEnableDtdLoader = aEnableDtdLoader;127 {
70 }128 return theBaseUri;
71129 }
72 /**130
73 * Get the property enableDtd, it specifies whether the document's131 // theNoError
74 * dtd should be enabled when loading132 void setNoError(bool aNoError)
75 */133 {
76 bool getEnableDtd() const134 theNoError = aNoError;
77 {135 }
78 return theEnableDtdLoader;136 bool getNoError() const
79 }137 {
80138 return theNoError;
81 /**139 }
82 * Set the property enableExtParsedEntity, it specifies whether the document140
83 * should be parsed as an enxternal general parsed entity141 // theStripWhitespace
84 */142 void setStripWhitespace(bool aStripWhitespace)
85 void setEnableExtParsedEntity(bool aEnableExtParsedEntityLoader)143 {
86 {144 theStripWhitespace = aStripWhitespace;
87 theEnableExtParsedEntityLoader = aEnableExtParsedEntityLoader;145 }
88 }146 bool getStripWhitespace() const
89147 {
90 /**148 return theStripWhitespace;
91 * Get the property enableDtd, it specifies whether the document149 }
92 * should be parsed as an enxternal general parsed entity150
93 */151 // theSchemaLaxValidate
94 bool getEnableExtParsedEntity() const152 void setSchemaLaxValidate(bool aSchemaLaxValidate)
95 {153 {
96 return theEnableExtParsedEntityLoader;154 theSchemaLaxValidate = aSchemaLaxValidate;
155 if (theSchemaLaxValidate)
156 theSchemaStrictValidate = false;
157 }
158 bool getSchemaLaxValidate() const
159 {
160 return theSchemaLaxValidate;
161 }
162
163 // theSchemaStrictValidate
164 void setSchemaStrictValidate(bool aSchemaStrictValidate)
165 {
166 theSchemaStrictValidate = aSchemaStrictValidate;
167 if (theSchemaStrictValidate)
168 theSchemaLaxValidate = false;
169 }
170 bool getSchemaStrictValidate() const
171 {
172 return theSchemaStrictValidate;
173 }
174
175 // theDTDValidate
176 void setDTDValidate(bool aDTDValidate)
177 {
178 theDTDValidate = aDTDValidate;
179 }
180 bool getDTDValidate() const
181 {
182 return theDTDValidate;
183 }
184
185 // theDTDLoad
186 void setDTDLoad(bool aDTDLoad)
187 {
188 theDTDLoad = aDTDLoad;
189 }
190 bool getDTDLoad() const
191 {
192 return theDTDLoad;
193 }
194
195 // theDefaultDTDAttributes
196 void setDefaultDTDAttributes(bool aDefaultDTDAttributes)
197 {
198 theDefaultDTDAttributes = aDefaultDTDAttributes;
199 }
200 bool getDefaultDTDAttributes() const
201 {
202 return theDefaultDTDAttributes;
203 }
204
205 // theParseExternalParsedEntity
206 void setParseExternalParsedEntity(bool aParseExternalParsedEntity)
207 {
208 theParseExternalParsedEntity = aParseExternalParsedEntity;
209 }
210 bool getParseExternalParsedEntity() const
211 {
212 return theParseExternalParsedEntity;
213 }
214
215 // theSkipRootNodes
216 void setSkipRootNodes(unsigned int aSkipRootNodes)
217 {
218 theSkipRootNodes = aSkipRootNodes;
219 }
220 unsigned int getSkipRootNodes() const
221 {
222 return theSkipRootNodes;
223 }
224
225 // theSkipTopLevelTextNodes
226 void setSkipTopLevelTextNodes(bool aSkipTopLevelTextNodes)
227 {
228 theSkipTopLevelTextNodes = aSkipTopLevelTextNodes;
229 }
230 bool getSkipTopLevelTextNodes() const
231 {
232 return theSkipTopLevelTextNodes;
233 }
234
235 // theSubstituteEntities
236 void setSubstituteEntities(bool aSubstituteEntities)
237 {
238 theSubstituteEntities = aSubstituteEntities;
239 }
240 bool getSubstituteEntities() const
241 {
242 return theSubstituteEntities;
243 }
244
245 // theXincludeSubstitutions
246 void setXincludeSubstitutions(bool aXincludeSubstitutions)
247 {
248 theXincludeSubstitutions = aXincludeSubstitutions;
249 }
250 bool getXincludeSubstitutions() const
251 {
252 return theXincludeSubstitutions;
253 }
254
255 // theRemoveRedundantNS
256 void setRemoveRedundantNS(bool aRemoveRedundantNS)
257 {
258 theRemoveRedundantNS = aRemoveRedundantNS;
259 }
260 bool getRemoveRedundantNS() const
261 {
262 return theRemoveRedundantNS;
263 }
264
265 // theNoCDATA
266 void setNoCDATA(bool aNoCDATA)
267 {
268 theNoCDATA = aNoCDATA;
269 }
270 bool getNoCDATA() const
271 {
272 return theNoCDATA;
273 }
274
275 // theNoXIncludeNodes
276 void setNoXIncludeNodes(bool aNoXIncludeNodes)
277 {
278 theNoXIncludeNodes = aNoXIncludeNodes;
279 }
280 bool getNoXIncludeNodes() const
281 {
282 return theNoXIncludeNodes;
97 }283 }
98};284};
99285
100286
=== modified file 'src/store/naive/loader.h'
--- src/store/naive/loader.h 2011-07-15 16:39:51 +0000
+++ src/store/naive/loader.h 2012-02-03 22:18:21 +0000
@@ -21,6 +21,7 @@
21#include <libxml/xmlstring.h>21#include <libxml/xmlstring.h>
2222
23#include "store/api/item.h"23#include "store/api/item.h"
24#include "store/api/load_properties.h"
2425
25#include "store/naive/ordpath.h"26#include "store/naive/ordpath.h"
2627
@@ -74,6 +75,8 @@
74 static const ulong INPUT_CHUNK_SIZE = 8192;75 static const ulong INPUT_CHUNK_SIZE = 8192;
7576
76protected:77protected:
78 const store::LoadProperties & theLoadProperties;
79
77 xmlParserCtxtPtr ctxt;80 xmlParserCtxtPtr ctxt;
7881
79 xmlSAXHandler theSaxHandler;82 xmlSAXHandler theSaxHandler;
@@ -89,12 +92,19 @@
8992
90 bool theBuildDataGuide;93 bool theBuildDataGuide;
9194
95
96protected:
97 void applyLoadOptions(const store::LoadProperties& props, xmlParserCtxtPtr ctxt);
98
99
92public:100public:
93 XmlLoader(101 XmlLoader(
94 BasicItemFactory* factory,102 BasicItemFactory* factory,
95 XQueryDiagnostics* xqueryDiagnostics,103 XQueryDiagnostics* xqueryDiagnostics,
104 const store::LoadProperties& loadProperties,
96 bool dataguide)105 bool dataguide)
97 :106 :
107 theLoadProperties(loadProperties),
98 ctxt(NULL),108 ctxt(NULL),
99 theFactory(factory),109 theFactory(factory),
100 theXQueryDiagnostics(xqueryDiagnostics),110 theXQueryDiagnostics(xqueryDiagnostics),
@@ -156,6 +166,7 @@
156 FastXmlLoader(166 FastXmlLoader(
157 BasicItemFactory* factory,167 BasicItemFactory* factory,
158 XQueryDiagnostics* xqueryDiagnostics,168 XQueryDiagnostics* xqueryDiagnostics,
169 const store::LoadProperties& loadProperties,
159 bool dataguide);170 bool dataguide);
160171
161 ~FastXmlLoader();172 ~FastXmlLoader();
@@ -245,6 +256,7 @@
245 FragmentXmlLoader(256 FragmentXmlLoader(
246 BasicItemFactory* factory,257 BasicItemFactory* factory,
247 XQueryDiagnostics* xqueryDiagnostics,258 XQueryDiagnostics* xqueryDiagnostics,
259 const store::LoadProperties& loadProperties,
248 bool dataguide);260 bool dataguide);
249261
250 ~FragmentXmlLoader();262 ~FragmentXmlLoader();
@@ -255,7 +267,15 @@
255 std::istream& xmlStream);267 std::istream& xmlStream);
256268
257protected:269protected:
258 static void checkStopParsing(void* ctx);270 bool fillBuffer(FragmentIStream* theFragmentStream);
271
272 unsigned long getCurrentInputOffset() const;
273
274 static void checkStopParsing(void* ctx, bool force = false);
275
276 static void startDocument(void * ctx);
277
278 static void endDocument(void * ctx);
259279
260 static void startElement(280 static void startElement(
261 void * ctx,281 void * ctx,
@@ -295,7 +315,6 @@
295315
296protected:316protected:
297 FragmentIStream* theFragmentStream;317 FragmentIStream* theFragmentStream;
298 int element_depth;
299};318};
300319
301/*******************************************************************************320/*******************************************************************************
@@ -331,8 +350,6 @@
331 zorba::Stack<PathStepInfo> thePathStack;350 zorba::Stack<PathStepInfo> thePathStack;
332 std::stack<NsBindingsContext*> theBindingsStack;351 std::stack<NsBindingsContext*> theBindingsStack;
333352
334 bool theParseExtParsedEntity;
335
336#ifdef DATAGUIDE353#ifdef DATAGUIDE
337 zorba::Stack<ElementGuideNode*> theGuideStack;354 zorba::Stack<ElementGuideNode*> theGuideStack;
338#endif355#endif
@@ -341,8 +358,8 @@
341 DtdXmlLoader(358 DtdXmlLoader(
342 BasicItemFactory* factory,359 BasicItemFactory* factory,
343 XQueryDiagnostics* xqueryDiagnostics,360 XQueryDiagnostics* xqueryDiagnostics,
344 bool dataguide,361 const store::LoadProperties& loadProperties,
345 bool parseExtParsedEntity);362 bool dataguide);
346363
347 ~DtdXmlLoader();364 ~DtdXmlLoader();
348365
349366
=== modified file 'src/store/naive/loader_dtd.cpp'
--- src/store/naive/loader_dtd.cpp 2012-01-11 17:30:25 +0000
+++ src/store/naive/loader_dtd.cpp 2012-02-03 22:18:21 +0000
@@ -76,12 +76,51 @@
76/*******************************************************************************76/*******************************************************************************
7777
78********************************************************************************/78********************************************************************************/
79void XmlLoader::applyLoadOptions(const store::LoadProperties& props, xmlParserCtxtPtr ctxt)
80{
81 int options = 0;
82
83 if (props.getStripWhitespace())
84 options |= XML_PARSE_NOBLANKS;
85
86 if (props.getDTDValidate())
87 options |= XML_PARSE_DTDVALID;
88
89 if (props.getDTDLoad())
90 options |= XML_PARSE_DTDLOAD;
91
92 if (props.getDefaultDTDAttributes())
93 options |= XML_PARSE_DTDATTR;
94
95 if (props.getSubstituteEntities())
96 options |= XML_PARSE_NOENT;
97
98 if (props.getXincludeSubstitutions())
99 options |= XML_PARSE_XINCLUDE;
100
101 if (props.getRemoveRedundantNS())
102 options |= XML_PARSE_NSCLEAN;
103
104 if (props.getNoCDATA())
105 options |= XML_PARSE_NOCDATA;
106
107 if (props.getNoXIncludeNodes())
108 options |= XML_PARSE_NOXINCNODE;
109
110 xmlCtxtUseOptions(ctxt, options);
111}
112
113
114/*******************************************************************************
115
116********************************************************************************/
79FragmentXmlLoader::FragmentXmlLoader(117FragmentXmlLoader::FragmentXmlLoader(
80 BasicItemFactory* factory,118 BasicItemFactory* factory,
81 XQueryDiagnostics* xqueryDiagnostics,119 XQueryDiagnostics* xqueryDiagnostics,
120 const store::LoadProperties& loadProperties,
82 bool dataguide)121 bool dataguide)
83 :122 :
84 FastXmlLoader(factory, xqueryDiagnostics, dataguide)123 FastXmlLoader(factory, xqueryDiagnostics, loadProperties, dataguide)
85{124{
86 theOrdPath.init();125 theOrdPath.init();
87126
@@ -109,6 +148,39 @@
109{148{
110}149}
111150
151bool FragmentXmlLoader::fillBuffer(FragmentIStream* theFragmentStream)
152{
153 if (theFragmentStream->ctxt->input->length > 0 && theFragmentStream->current_offset < theFragmentStream->bytes_in_buffer)
154 {
155 memmove(theFragmentStream->theBuffer, theFragmentStream->theBuffer + theFragmentStream->current_offset,
156 theFragmentStream->bytes_in_buffer - theFragmentStream->current_offset);
157 theFragmentStream->bytes_in_buffer -= theFragmentStream->current_offset;
158 }
159
160 std::streamsize numChars = readPacket(*theFragmentStream->theStream, theFragmentStream->theBuffer + theFragmentStream->bytes_in_buffer,
161 FragmentIStream::BUFFER_SIZE+FragmentIStream::LOOKAHEAD_BYTES - theFragmentStream->bytes_in_buffer);
162 if (numChars < 0)
163 {
164 theXQueryDiagnostics->add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0020_LOADER_IO_ERROR));
165 throw 0; // the argument to throw is not used by the catch clause
166 }
167
168 if (theFragmentStream->theStream->eof())
169 theFragmentStream->reached_eof = true;
170
171 theFragmentStream->bytes_in_buffer += numChars;
172 theFragmentStream->current_offset = 0;
173 theFragmentStream->ctxt->input->base = (xmlChar*)(theFragmentStream->theBuffer);
174 theFragmentStream->ctxt->input->length = (theFragmentStream->bytes_in_buffer < FragmentIStream::BUFFER_SIZE? theFragmentStream->bytes_in_buffer : FragmentIStream::BUFFER_SIZE);
175 theFragmentStream->ctxt->input->cur = theFragmentStream->ctxt->input->base;
176 theFragmentStream->ctxt->input->end = theFragmentStream->ctxt->input->base + theFragmentStream->ctxt->input->length;
177 theFragmentStream->ctxt->checkIndex = 0;
178
179 if (theFragmentStream->bytes_in_buffer < FragmentIStream::BUFFER_SIZE+FragmentIStream::LOOKAHEAD_BYTES)
180 theFragmentStream->theBuffer[theFragmentStream->bytes_in_buffer] = 0;
181
182 return !theFragmentStream->stream_is_consumed();
183}
112184
113store::Item_t FragmentXmlLoader::loadXml(185store::Item_t FragmentXmlLoader::loadXml(
114 const zstring& baseUri,186 const zstring& baseUri,
@@ -138,88 +210,104 @@
138 {210 {
139 theFragmentStream = static_cast<FragmentIStream*>(&stream);211 theFragmentStream = static_cast<FragmentIStream*>(&stream);
140212
141 // Prepare the input buffer213 // Prepare the input buffer and the parser context
142 if (theFragmentStream->theBuffer == NULL)214 if (theFragmentStream->theBuffer == NULL)
143 {215 {
144 theFragmentStream->theStream->seekg(0, std::ios::end);216 // Allocate input buffer
145 std::streamoff fileSize = theFragmentStream->theStream->tellg();217 theFragmentStream->theBuffer = new char[FragmentIStream::BUFFER_SIZE + FragmentIStream::LOOKAHEAD_BYTES];
146 theFragmentStream->theStream->seekg(0, std::ios::beg);218
147219 // Create the LibXml parser context
148 theFragmentStream->theBuffer = new char[static_cast<unsigned int>(fileSize+1)];220 theFragmentStream->ctxt = xmlCreatePushParserCtxt(&theSaxHandler, this, NULL, 0, 0);
149 theFragmentStream->theBuffer[fileSize] = 0;221 if (theFragmentStream->ctxt == NULL)
150222 {
151 std::streamsize numChars = readPacket(*theFragmentStream->theStream,223 theXQueryDiagnostics->add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR, ERROR_PARAMS( ZED( ParserInitFailed ) )));
152 theFragmentStream->theBuffer,224 throw 0; // the argument to throw is not used by the catch clause
153 fileSize);225 }
154 theFragmentStream->buffer_size = numChars;226
155 if (numChars < 0)227 // Apply parser options
156 {228 applyLoadOptions(theLoadProperties, theFragmentStream->ctxt);
157 theXQueryDiagnostics->229
158 add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0020_LOADER_IO_ERROR));230 // Delete the initial empty input stream
159231 xmlFreeInputStream(inputPop(theFragmentStream->ctxt));
160 abortload();232
161 return NULL;233 // Create the LibXml parser input
162 }234 xmlParserInputPtr input = xmlNewInputStream(theFragmentStream->ctxt);
163 else if (numChars == 0)235 if (input == NULL)
164 {236 {
165 theXQueryDiagnostics->237 theXQueryDiagnostics->add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR, ERROR_PARAMS( ZED( ParserInitFailed ) )));
166 add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0020_LOADER_IO_ERROR, 238 throw 0; // the argument to throw is not used by the catch clause
167 ERROR_PARAMS(ZED(NoInputData))));239 }
168240
169 abortload();241 // Initialize the parser input (only filename and the pointer to the current char)
170 return NULL;242 theFragmentStream->theBuffer[0] = ' '; // This assignment is needed for LibXml2-2.7.6, which tries to read the buffer when xmlPushInput() is called
171 }243 input->cur = (xmlChar*)(theFragmentStream->theBuffer);
172 }244 input->filename = (const char*)(xmlCanonicPath((const xmlChar*)theDocUri.c_str()));
173245 xmlPushInput(theFragmentStream->ctxt, input);
174 // Create the LibXml parser context246 }
175 ctxt = xmlCreatePushParserCtxt(&theSaxHandler, this, NULL, 0, 0);247
176 // ctxt = xmlCreate248 theFragmentStream->ctxt->userData = this; // the loader has changed, update the address
177 if (ctxt == NULL)249 theFragmentStream->ctxt->disableSAX = false; // xmlStopParser() sets disableSAX to true
178 {250 theFragmentStream->parsed_nodes_count = 0;
179 theXQueryDiagnostics->251 theFragmentStream->forced_parser_stop = false;
180 add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR, 252
181 ERROR_PARAMS(ZED(ParserInitFailed))));253 if ( ! theFragmentStream->first_start_doc)
182254 {
183 abortload();255 theFragmentStream->ctxt->instate = XML_PARSER_CONTENT;
184 return NULL;256 FragmentXmlLoader::startDocument(theFragmentStream->ctxt->userData);
185 }257 }
186258
187 // Delete the initial empty input stream259 while ( ! theFragmentStream->forced_parser_stop && fillBuffer(theFragmentStream))
188 xmlFreeInputStream(inputPop(ctxt));260 {
189261 // 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;
190 // Create the LibXml parser input262
191 xmlParserInputPtr input = xmlNewInputStream(ctxt);263 // This case needs to be handled here, otherwise LibXml2 will segfault
192 if (input == NULL)264 if (theFragmentStream->ctxt->input->cur[0] == '<' &&
193 {265 theFragmentStream->ctxt->input->cur[1] == '/' &&
194 theXQueryDiagnostics->266 theFragmentStream->current_element_depth == 0)
195 add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR,267 {
196 ERROR_PARAMS(ZED(ParserInitFailed))));268 theXQueryDiagnostics->add_error(theDocUri.empty() ?
197269 NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR, ERROR_PARAMS( ZED( BadXMLNoOpeningTag ))) :
198 abortload();270 NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR, ERROR_PARAMS( ZED( BadXMLNoOpeningTag ), theDocUri))
199 return NULL;271 );
200 }272 throw 0; // the argument to throw is not used by the catch clause
201273 }
202 // Initialize the parser input274
203 input->filename = (const char*)(xmlCanonicPath((const xmlChar*)theDocUri.c_str()));275 xmlParseChunk(theFragmentStream->ctxt, (const char*)theFragmentStream->ctxt->input->cur,
204 input->base = (xmlChar*)(theFragmentStream->theBuffer + theFragmentStream->current_offset);276 theFragmentStream->ctxt->input->length, 0);
205 input->cur = (xmlChar*)(theFragmentStream->theBuffer + theFragmentStream->current_offset);277
206 input->length = theFragmentStream->buffer_size - theFragmentStream->current_offset;278 if (theFragmentStream->ctxt->input->base == (xmlChar*)(theFragmentStream->theBuffer)
207 input->end = input->base + input->length;279 &&
208 xmlPushInput(ctxt, input);280 theFragmentStream->current_offset < getCurrentInputOffset())
209281 theFragmentStream->current_offset = getCurrentInputOffset();
210 // Reset element_depth282
211 element_depth = 0;283 // If we didn't get an error and we haven't moved, we might have some freestanding text. Parse it as element character data.
212284 if (theXQueryDiagnostics->errors().empty()
213 // Finally call the parser285 &&
214 if (xmlParseExtParsedEnt(ctxt)==-1)286 theFragmentStream->current_offset == 0)
215 {287 {
216 theXQueryDiagnostics->288 // The input has been reset by xmlStopParser()
217 add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR,289 theFragmentStream->ctxt->input->base = (xmlChar*)(theFragmentStream->theBuffer);
218 ERROR_PARAMS(ZED(ParserNoCreateTree))));290 theFragmentStream->ctxt->input->cur = theFragmentStream->ctxt->input->base;
219291 xmlParseCharData(theFragmentStream->ctxt, 0);
220 abortload();292 }
221 return NULL;293
222 }294 if ( ! theXQueryDiagnostics->errors().empty())
295 throw 0; // the argument to throw is not used by the catch clause
296 }
297
298 // this happens when there are tags that have not been closed
299 if (theFragmentStream->stream_is_consumed()
300 &&
301 theFragmentStream->current_element_depth > 0)
302 {
303 theXQueryDiagnostics->add_error(theDocUri.empty() ?
304 NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR, ERROR_PARAMS( ZED( BadXMLDocument_2o ))) :
305 NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR, ERROR_PARAMS( ZED( BadXMLDocument_2o ), theDocUri))
306 );
307 throw 0;
308 }
309
310 FragmentXmlLoader::endDocument(theFragmentStream->ctxt->userData); // this would not be called otherwise
223 }311 }
224 catch (...)312 catch (...)
225 {313 {
@@ -228,49 +316,36 @@
228 return NULL;316 return NULL;
229 }317 }
230318
231 bool ok = ctxt->wellFormed != 0;
232
233 // The doc may be well formed, but it may have other kinds of errors, e.g., unresolved ns prefixes.319 // The doc may be well formed, but it may have other kinds of errors, e.g., unresolved ns prefixes.
234 if (!theXQueryDiagnostics->errors().empty())320 if (!theXQueryDiagnostics->errors().empty())
235 {321 {
236 abortload();322 abortload();
237 return NULL;323 return NULL;
238 }324 }
239 else if (!ok )325 else if ( ! theFragmentStream->ctxt->wellFormed)
240 {326 {
241 if (!theDocUri.empty())327 theXQueryDiagnostics->add_error(theDocUri.empty() ?
242 {328 NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR, ERROR_PARAMS( ZED( BadXMLDocument_2o ))) :
243 theXQueryDiagnostics->329 NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR, ERROR_PARAMS( ZED( BadXMLDocument_2o ), theDocUri))
244 add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR, 330 );
245 ERROR_PARAMS(ZED(BadXMLDocument_2o), theDocUri)));
246 }
247 else
248 {
249 theXQueryDiagnostics->
250 add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR,
251 ERROR_PARAMS(ZED(BadXMLDocument_2o))));
252 }
253 abortload();331 abortload();
254 return NULL;332 return NULL;
255 }333 }
256 else if ( ctxt->lastError.code != XML_ERR_OK )334 else if (theFragmentStream->ctxt->lastError.code != XML_ERR_OK)
257 {335 {
258 if ( ctxt->lastError.code == XML_NS_ERR_UNDEFINED_NAMESPACE ||336 if (theFragmentStream->ctxt->lastError.code == XML_NS_ERR_UNDEFINED_NAMESPACE
259 ctxt->lastError.code != XML_ERR_NO_DTD )337 ||
338 theFragmentStream->ctxt->lastError.code != XML_ERR_NO_DTD )
260 {339 {
261 theXQueryDiagnostics->340 theXQueryDiagnostics->add_error(theDocUri.empty() ?
262 add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR, 341 NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR, ERROR_PARAMS( ZED( BadXMLDocument_2o ))) :
263 ERROR_PARAMS(ZED(BadXMLDocument_2o))));342 NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR, ERROR_PARAMS( ZED( BadXMLDocument_2o ), theDocUri))
264343 );
265 abortload();344 abortload();
266 return NULL;345 return NULL;
267 }346 }
268 }347 }
269348
270 xmlCtxtReset(ctxt);
271 xmlFreeParserCtxt(ctxt);
272 ctxt = NULL;
273
274 thePathStack.pop();349 thePathStack.pop();
275 assert(thePathStack.empty());350 assert(thePathStack.empty());
276351
@@ -280,23 +355,59 @@
280 return resultNode;355 return resultNode;
281}356}
282357
283358unsigned long FragmentXmlLoader::getCurrentInputOffset() const
284void FragmentXmlLoader::checkStopParsing(void* ctx)359{
285{360 unsigned long offset = theFragmentStream->ctxt->input->cur
286 FragmentXmlLoader& loader = *(static_cast<FragmentXmlLoader*>(ctx));361 - theFragmentStream->ctxt->input->base
287 ZORBA_LOADER_CHECK_ERROR(loader);362 + theFragmentStream->ctxt->input->consumed;
288363
289 if (loader.element_depth == 0)364 return offset;
290 {365}
291 /* if (loader.ctxt->inputNr <= 1)366
292 loader.theFragmentStream->current_offset = loader.theFragmentStream->buffer_size;367void FragmentXmlLoader::checkStopParsing(void* ctx, bool force)
293 else */368{
294 loader.theFragmentStream->current_offset += (loader.ctxt->input->cur - loader.ctxt->input->base)369 FragmentXmlLoader& loader = *(static_cast<FragmentXmlLoader*>(ctx));
295 + loader.ctxt->input->consumed;370 ZORBA_LOADER_CHECK_ERROR(loader);
296 xmlStopParser(loader.ctxt);371
297 }372 unsigned long offset = loader.getCurrentInputOffset();
298}373
299374 if (force
375 ||
376 loader.theFragmentStream->current_element_depth == 0
377 ||
378 (offset >= loader.theFragmentStream->bytes_in_buffer
379 &&
380 loader.theFragmentStream->reached_eof)
381 ||
382 (loader.theFragmentStream->current_element_depth <= loader.theFragmentStream->root_elements_to_skip
383 &&
384 loader.theFragmentStream->parsed_nodes_count >= FragmentIStream::PARSED_NODES_BATCH_SIZE))
385 {
386 loader.theFragmentStream->current_offset = offset;
387 xmlStopParser(loader.theFragmentStream->ctxt);
388 loader.theFragmentStream->ctxt->errNo = XML_SCHEMAV_MISC; // fake error to force stopping
389 loader.theFragmentStream->forced_parser_stop = true;
390 }
391
392 loader.theFragmentStream->parsed_nodes_count++;
393}
394
395void FragmentXmlLoader::startDocument(void * ctx)
396{
397 FragmentXmlLoader& loader = *(static_cast<FragmentXmlLoader*>(ctx));
398 ZORBA_LOADER_CHECK_ERROR(loader);
399 FastXmlLoader::startDocument(ctx);
400 if (loader.theFragmentStream->first_start_doc)
401 {
402 loader.theFragmentStream->first_start_doc = false;
403 FragmentXmlLoader::checkStopParsing(ctx, true);
404 }
405}
406
407void FragmentXmlLoader::endDocument(void * ctx)
408{
409 FastXmlLoader::endDocument(ctx);
410}
300411
301void FragmentXmlLoader::startElement(412void FragmentXmlLoader::startElement(
302 void * ctx,413 void * ctx,
@@ -309,27 +420,34 @@
309 int nb_defaulted,420 int nb_defaulted,
310 const xmlChar ** attributes)421 const xmlChar ** attributes)
311{422{
312 FastXmlLoader::startElement(ctx, localname, prefix, URI, nb_namespaces, namespaces, nb_attributes, nb_defaulted, attributes);
313
314 FragmentXmlLoader& loader = *(static_cast<FragmentXmlLoader*>(ctx));423 FragmentXmlLoader& loader = *(static_cast<FragmentXmlLoader*>(ctx));
315 ZORBA_LOADER_CHECK_ERROR(loader);424 ZORBA_LOADER_CHECK_ERROR(loader);
316 loader.element_depth++;425 loader.theFragmentStream->current_element_depth++;
426 if (loader.theFragmentStream->current_element_depth > loader.theFragmentStream->root_elements_to_skip)
427 {
428 const xmlChar** nsTab = namespaces;
429
430 if (loader.theFragmentStream->current_element_depth == loader.theFragmentStream->root_elements_to_skip + 1)
431 {
432 nsTab = loader.theFragmentStream->ctxt->nsTab;
433 nb_namespaces = loader.theFragmentStream->ctxt->nsNr/2;
434 }
435
436 FastXmlLoader::startElement(ctx, localname, prefix, URI, nb_namespaces, nsTab, nb_attributes, nb_defaulted, attributes);
437 }
317}438}
318439
319
320void FragmentXmlLoader::endElement(440void FragmentXmlLoader::endElement(
321 void * ctx,441 void * ctx,
322 const xmlChar * localname,442 const xmlChar * localname,
323 const xmlChar * prefix,443 const xmlChar * prefix,
324 const xmlChar * URI)444 const xmlChar * URI)
325{445{
326 FastXmlLoader::endElement(ctx, localname, prefix, URI);
327
328 FragmentXmlLoader& loader = *(static_cast<FragmentXmlLoader*>(ctx));446 FragmentXmlLoader& loader = *(static_cast<FragmentXmlLoader*>(ctx));
329 ZORBA_LOADER_CHECK_ERROR(loader);447 ZORBA_LOADER_CHECK_ERROR(loader);
330448 if (loader.theFragmentStream->current_element_depth > loader.theFragmentStream->root_elements_to_skip)
331 loader.element_depth--;449 FastXmlLoader::endElement(ctx, localname, prefix, URI);
332450 loader.theFragmentStream->current_element_depth--;
333 checkStopParsing(ctx);451 checkStopParsing(ctx);
334}452}
335453
@@ -338,7 +456,10 @@
338 const xmlChar * ch,456 const xmlChar * ch,
339 int len)457 int len)
340{458{
341 FastXmlLoader::characters(ctx, ch, len);459 FragmentXmlLoader& loader = *(static_cast<FragmentXmlLoader*>(ctx));
460 ZORBA_LOADER_CHECK_ERROR(loader);
461 if (loader.theFragmentStream->current_element_depth >= loader.theFragmentStream->root_elements_to_skip)
462 FastXmlLoader::characters(ctx, ch, len);
342 checkStopParsing(ctx);463 checkStopParsing(ctx);
343}464}
344465
@@ -347,7 +468,10 @@
347 void * ctx,468 void * ctx,
348 const xmlChar * value)469 const xmlChar * value)
349{470{
350 FastXmlLoader::comment(ctx, value);471 FragmentXmlLoader& loader = *(static_cast<FragmentXmlLoader*>(ctx));
472 ZORBA_LOADER_CHECK_ERROR(loader);
473 if (loader.theFragmentStream->current_element_depth >= loader.theFragmentStream->root_elements_to_skip)
474 FastXmlLoader::comment(ctx, value);
351 checkStopParsing(ctx);475 checkStopParsing(ctx);
352}476}
353477
@@ -357,7 +481,10 @@
357 const xmlChar * value,481 const xmlChar * value,
358 int len)482 int len)
359{483{
360 FastXmlLoader::cdataBlock(ctx, value, len);484 FragmentXmlLoader& loader = *(static_cast<FragmentXmlLoader*>(ctx));
485 ZORBA_LOADER_CHECK_ERROR(loader);
486 if (loader.theFragmentStream->current_element_depth >= loader.theFragmentStream->root_elements_to_skip)
487 FastXmlLoader::cdataBlock(ctx, value, len);
361 checkStopParsing(ctx);488 checkStopParsing(ctx);
362}489}
363490
@@ -367,7 +494,10 @@
367 const xmlChar * target,494 const xmlChar * target,
368 const xmlChar * data)495 const xmlChar * data)
369{496{
370 FastXmlLoader::processingInstruction(ctx, target, data);497 FragmentXmlLoader& loader = *(static_cast<FragmentXmlLoader*>(ctx));
498 ZORBA_LOADER_CHECK_ERROR(loader);
499 if (loader.theFragmentStream->current_element_depth >= loader.theFragmentStream->root_elements_to_skip)
500 FastXmlLoader::processingInstruction(ctx, target, data);
371 checkStopParsing(ctx);501 checkStopParsing(ctx);
372}502}
373503
@@ -378,14 +508,13 @@
378DtdXmlLoader::DtdXmlLoader(508DtdXmlLoader::DtdXmlLoader(
379 BasicItemFactory* factory,509 BasicItemFactory* factory,
380 XQueryDiagnostics* xqueryDiagnostics,510 XQueryDiagnostics* xqueryDiagnostics,
381 bool dataguide,511 const store::LoadProperties& loadProperties,
382 bool parseExtParsedEntity)512 bool dataguide)
383 :513 :
384 XmlLoader(factory, xqueryDiagnostics, dataguide),514 XmlLoader(factory, xqueryDiagnostics, loadProperties, dataguide),
385 theTree(NULL),515 theTree(NULL),
386 theRootNode(NULL),516 theRootNode(NULL),
387 theNodeStack(2048),517 theNodeStack(2048)
388 theParseExtParsedEntity(parseExtParsedEntity)
389{518{
390 theOrdPath.init();519 theOrdPath.init();
391520
@@ -511,10 +640,7 @@
511 Return the number of bytes actually read, throw an exception if any I/O640 Return the number of bytes actually read, throw an exception if any I/O
512 error occured.641 error occured.
513********************************************************************************/642********************************************************************************/
514std::streamsize DtdXmlLoader::readPacket(643std::streamsize DtdXmlLoader::readPacket(std::istream& stream, char* buf, std::streamoff size)
515 std::istream& stream,
516 char* buf,
517 std::streamoff size)
518{644{
519 try645 try
520 {646 {
@@ -626,23 +752,26 @@
626 }752 }
627753
628 // Set the LibXml DTD validation options754 // Set the LibXml DTD validation options
755 /*
629 int options = XML_PARSE_COMPACT;756 int options = XML_PARSE_COMPACT;
630 options |= XML_PARSE_DTDVALID;757 options |= XML_PARSE_DTDVALID;
631 options |= XML_PARSE_DTDLOAD;758 options |= XML_PARSE_DTDLOAD;
759 */
632 //options |= XML_PARSE_SAX1;760 //options |= XML_PARSE_SAX1;
633 //xmlSAXDefaultVersion(1);761 //xmlSAXDefaultVersion(1);
634762
763 // xmlCtxtUseOptions(ctxt, options);
764
635 xmlLoadExtDtdDefaultValue |= XML_DETECT_IDS;765 xmlLoadExtDtdDefaultValue |= XML_DETECT_IDS;
636 xmlLoadExtDtdDefaultValue |= XML_COMPLETE_ATTRS;766 xmlLoadExtDtdDefaultValue |= XML_COMPLETE_ATTRS;
637767
638 xmlCtxtUseOptions(ctxt, options);768 // Apply loader options
769 applyLoadOptions(theLoadProperties, ctxt);
639770
640 if ( xmlParseDocument(ctxt)==-1 )771 if ( xmlParseDocument(ctxt)==-1 )
641 {772 {
642 // std::cout << " xmlParseDocument: Error: Unable to create tree: " << ctxt->lastError.message << std::endl;773 // std::cout << " xmlParseDocument: Error: Unable to create tree: " << ctxt->lastError.message << std::endl;
643 theXQueryDiagnostics->774 theXQueryDiagnostics->add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR,ERROR_PARAMS( ZED( ParserNoCreateTree ) )));
644 add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR,
645 ERROR_PARAMS(ZED(ParserNoCreateTree))));
646 abortload();775 abortload();
647 return NULL;776 return NULL;
648 }777 }
@@ -667,15 +796,21 @@
667 {796 {
668 if (!theDocUri.empty())797 if (!theDocUri.empty())
669 {798 {
670 theXQueryDiagnostics->799 theXQueryDiagnostics->add_error(
671 add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR,800 NEW_ZORBA_EXCEPTION(
672 ERROR_PARAMS(ZED(BadXMLDocument_2o), theDocUri)));801 zerr::ZSTR0021_LOADER_PARSING_ERROR,
802 ERROR_PARAMS( ZED( BadXMLDocument_2o ), theDocUri )
803 )
804 );
673 }805 }
674 else806 else
675 {807 {
676 theXQueryDiagnostics->808 theXQueryDiagnostics->add_error(
677 add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR,809 NEW_ZORBA_EXCEPTION(
678 ERROR_PARAMS(ZED(BadXMLDocument_2o))));810 zerr::ZSTR0021_LOADER_PARSING_ERROR,
811 ERROR_PARAMS( ZED( BadXMLDocument_2o ) )
812 )
813 );
679 }814 }
680815
681 abortload();816 abortload();
@@ -691,9 +826,12 @@
691 if ( ctxt->lastError.code == XML_NS_ERR_UNDEFINED_NAMESPACE ||826 if ( ctxt->lastError.code == XML_NS_ERR_UNDEFINED_NAMESPACE ||
692 ctxt->lastError.code != XML_ERR_NO_DTD )827 ctxt->lastError.code != XML_ERR_NO_DTD )
693 {828 {
694 theXQueryDiagnostics->829 theXQueryDiagnostics->add_error(
695 add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR,830 NEW_ZORBA_EXCEPTION(
696 ERROR_PARAMS(ZED(BadXMLDocument_2o))));831 zerr::ZSTR0021_LOADER_PARSING_ERROR,
832 ERROR_PARAMS( ZED( BadXMLDocument_2o ) )
833 )
834 );
697 abortload();835 abortload();
698 return NULL;836 return NULL;
699837
@@ -704,10 +842,12 @@
704 xmlDoc *doc = ctxt->myDoc;842 xmlDoc *doc = ctxt->myDoc;
705 if (doc == NULL)843 if (doc == NULL)
706 {844 {
707 theXQueryDiagnostics->845 theXQueryDiagnostics->add_error(
708 add_error(NEW_ZORBA_EXCEPTION(zerr::ZSTR0021_LOADER_PARSING_ERROR,846 NEW_ZORBA_EXCEPTION(
709 ERROR_PARAMS(ZED(ParserNoCreateTree))));847 zerr::ZSTR0021_LOADER_PARSING_ERROR,
710848 ERROR_PARAMS( ZED( ParserNoCreateTree ) )
849 )
850 );
711 abortload();851 abortload();
712 return NULL;852 return NULL;
713 }853 }
@@ -859,8 +999,9 @@
859 }999 }
860 catch (...)1000 catch (...)
861 {1001 {
862 loader.theXQueryDiagnostics->1002 loader.theXQueryDiagnostics->add_error(
863 add_error(NEW_ZORBA_EXCEPTION(zerr::ZXQP0003_INTERNAL_ERROR));1003 NEW_ZORBA_EXCEPTION( zerr::ZXQP0003_INTERNAL_ERROR )
1004 );
864 }1005 }
865}1006}
8661007
8671008
=== modified file 'src/store/naive/loader_fast.cpp'
--- src/store/naive/loader_fast.cpp 2012-01-11 17:30:25 +0000
+++ src/store/naive/loader_fast.cpp 2012-02-03 22:18:21 +0000
@@ -76,9 +76,10 @@
76FastXmlLoader::FastXmlLoader(76FastXmlLoader::FastXmlLoader(
77 BasicItemFactory* factory,77 BasicItemFactory* factory,
78 XQueryDiagnostics* xqueryDiagnostics,78 XQueryDiagnostics* xqueryDiagnostics,
79 const store::LoadProperties& loadProperties,
79 bool dataguide)80 bool dataguide)
80 :81 :
81 XmlLoader(factory, xqueryDiagnostics, dataguide),82 XmlLoader(factory, xqueryDiagnostics, loadProperties, dataguide),
82 theTree(NULL),83 theTree(NULL),
83 theRootNode(NULL),84 theRootNode(NULL),
84 theNodeStack(2048)85 theNodeStack(2048)
@@ -298,6 +299,9 @@
298 static_cast<int>(numChars),299 static_cast<int>(numChars),
299 docUri.c_str());300 docUri.c_str());
300301
302 // Apply loader options
303 applyLoadOptions(theLoadProperties, ctxt);
304
301 if (ctxt == NULL)305 if (ctxt == NULL)
302 {306 {
303 theXQueryDiagnostics->307 theXQueryDiagnostics->
304308
=== modified file 'src/store/naive/simple_store.cpp'
--- src/store/naive/simple_store.cpp 2012-01-14 22:52:27 +0000
+++ src/store/naive/simple_store.cpp 2012-02-03 22:18:21 +0000
@@ -350,7 +350,7 @@
350 std::cerr << "Reference: " << (*iter).second350 std::cerr << "Reference: " << (*iter).second
351 << "is still in the nodes to references map" << std::endl;351 << "is still in the nodes to references map" << std::endl;
352 }352 }
353 ZORBA_FATAL(0, theNodeToReferencesMap.size() + 353 ZORBA_FATAL(0, theNodeToReferencesMap.size() +
354 " node references still in the nodes to references map");354 " node references still in the nodes to references map");
355 }355 }
356356
@@ -360,7 +360,7 @@
360 RefNodeMap::iterator end = theReferencesToNodeMap.end();360 RefNodeMap::iterator end = theReferencesToNodeMap.end();
361 for (; iter != end; ++iter)361 for (; iter != end; ++iter)
362 {362 {
363 std::cerr << "Reference: " << (*iter).first 363 std::cerr << "Reference: " << (*iter).first
364 << "is still in the references to nodes map" << std::endl;364 << "is still in the references to nodes map" << std::endl;
365 }365 }
366 ZORBA_FATAL(0, theReferencesToNodeMap.size() +366 ZORBA_FATAL(0, theReferencesToNodeMap.size() +
@@ -486,18 +486,20 @@
486XmlLoader* SimpleStore::getXmlLoader(XQueryDiagnostics* aXQueryDiagnostics,486XmlLoader* SimpleStore::getXmlLoader(XQueryDiagnostics* aXQueryDiagnostics,
487 const store::LoadProperties& loadProperties)487 const store::LoadProperties& loadProperties)
488{488{
489 if (loadProperties.getEnableExtParsedEntity())489 if (loadProperties.getParseExternalParsedEntity())
490 return new FragmentXmlLoader(theItemFactory,490 return new FragmentXmlLoader(theItemFactory,
491 aXQueryDiagnostics,491 aXQueryDiagnostics,
492 loadProperties,
492 store::Properties::instance()->buildDataguide());493 store::Properties::instance()->buildDataguide());
493 else if (loadProperties.getEnableDtd())494 else if (loadProperties.getDTDValidate())
494 return new DtdXmlLoader(theItemFactory,495 return new DtdXmlLoader(theItemFactory,
495 aXQueryDiagnostics,496 aXQueryDiagnostics,
496 store::Properties::instance()->buildDataguide(),497 loadProperties,
497 loadProperties.getEnableExtParsedEntity());498 store::Properties::instance()->buildDataguide());
498 else499 else
499 return new FastXmlLoader(theItemFactory,500 return new FastXmlLoader(theItemFactory,
500 aXQueryDiagnostics,501 aXQueryDiagnostics,
502 loadProperties,
501 store::Properties::instance()->buildDataguide());503 store::Properties::instance()->buildDataguide());
502}504}
503505
@@ -983,7 +985,7 @@
983 return NULL;985 return NULL;
984986
985 store::Collection_t collection;987 store::Collection_t collection;
986 if (theCollections->get(aName, collection, aDynamicCollection)) 988 if (theCollections->get(aName, collection, aDynamicCollection))
987 {989 {
988 return collection;990 return collection;
989 }991 }
@@ -1311,7 +1313,7 @@
1311 Computes the Structural Reference for the given node.1313 Computes the Structural Reference for the given node.
1312********************************************************************************/1314********************************************************************************/
1313bool SimpleStore::getStructuralInformation(1315bool SimpleStore::getStructuralInformation(
1314 store::Item_t& result, 1316 store::Item_t& result,
1315 const store::Item* node)1317 const store::Item* node)
1316{1318{
1317#ifdef TEXT_ORDPATH1319#ifdef TEXT_ORDPATH
@@ -1351,7 +1353,7 @@
13511353
1352/*******************************************************************************1354/*******************************************************************************
1353 Computes the reference of the given node.1355 Computes the reference of the given node.
1354 1356
1355 @param node XDM node1357 @param node XDM node
1356 @return the identifier as an item of type xs:anyURI1358 @return the identifier as an item of type xs:anyURI
1357********************************************************************************/1359********************************************************************************/
@@ -1384,7 +1386,7 @@
13841386
1385/*******************************************************************************1387/*******************************************************************************
1386 Returns the node which is identified by the given reference.1388 Returns the node which is identified by the given reference.
1387 1389
1388 @param reference an xs:anyURI item1390 @param reference an xs:anyURI item
1389 @result the node identified by the reference, or NULL if no node with the given1391 @result the node identified by the reference, or NULL if no node with the given
1390 reference exists1392 reference exists
@@ -1413,7 +1415,7 @@
14131415
1414/*******************************************************************************1416/*******************************************************************************
1415 Returns whether a reference has already been generated for the given node.1417 Returns whether a reference has already been generated for the given node.
1416 1418
1417 @param item XDM node1419 @param item XDM node
1418 @return whether a reference has already been generated for the given node.1420 @return whether a reference has already been generated for the given node.
1419********************************************************************************/1421********************************************************************************/
@@ -1425,7 +1427,7 @@
14251427
1426/*******************************************************************************1428/*******************************************************************************
1427 Removes a node from the reference-to-nodes and nodes-to-references maps.1429 Removes a node from the reference-to-nodes and nodes-to-references maps.
1428 1430
1429 @param node XDM node1431 @param node XDM node
1430 @return whether the node was registered or not.1432 @return whether the node was registered or not.
1431********************************************************************************/1433********************************************************************************/
14321434
=== modified file 'src/types/typeimpl.cpp'
--- src/types/typeimpl.cpp 2012-01-10 10:52:15 +0000
+++ src/types/typeimpl.cpp 2012-02-03 22:18:21 +0000
@@ -361,7 +361,7 @@
361361
362362
363bool NodeXQType::is_subtype(363bool NodeXQType::is_subtype(
364 const TypeManager* tm, 364 const TypeManager* tm,
365 const NodeXQType& supertype,365 const NodeXQType& supertype,
366 const QueryLoc& loc) const366 const QueryLoc& loc) const
367{367{
@@ -443,7 +443,7 @@
443443
444444
445bool NodeXQType::is_supertype(445bool NodeXQType::is_supertype(
446 const TypeManager* tm, 446 const TypeManager* tm,
447 const store::Item* subitem,447 const store::Item* subitem,
448 const QueryLoc& loc) const448 const QueryLoc& loc) const
449{449{
@@ -488,14 +488,30 @@
488 }488 }
489 }489 }
490490
491 if (m_node_kind != store::StoreConsts::elementNode && 491 // document-node( E ) matches any document node that contains exactly one element
492 m_node_kind != store::StoreConsts::attributeNode)492 // node, optionally accompanied by one or more comment and processing instruction
493 // nodes, if E is an ElementTest or SchemaElementTest that matches the element node.
494 bool is_element_test = (
495 m_node_kind == store::StoreConsts::documentNode &&
496 m_content_type != NULL &&
497 m_content_type->type_kind() == XQType::NODE_TYPE_KIND &&
498 dynamic_cast<const NodeXQType*>(m_content_type.getp())->m_schema_test == false);
499
500 if (m_node_kind != store::StoreConsts::elementNode &&
501 m_node_kind != store::StoreConsts::attributeNode &&
502 !is_element_test)
493 return true;503 return true;
494504
495 if (m_content_type == NULL ||505 if (m_content_type == NULL ||
496 m_content_type->type_kind() == XQType::ANY_TYPE_KIND)506 m_content_type->type_kind() == XQType::ANY_TYPE_KIND)
497 return true;507 return true;
498508
509 if (is_element_test)
510 {
511 xqtref_t documentNodeType = tm->create_value_type(subitem, loc);
512 return TypeOps::is_subtype(tm, *documentNodeType, *this);
513 }
514
499 xqtref_t subContentType = tm->create_named_type(subitem->getType(),515 xqtref_t subContentType = tm->create_named_type(subitem->getType(),
500 TypeConstants::QUANT_ONE,516 TypeConstants::QUANT_ONE,
501 loc,517 loc,
502518
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-01.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-01.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-01.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,2 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<from1>Jani</from1>
0\ No newline at end of file3\ No newline at end of file
14
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-02.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-02.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-02.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,6 @@
1<?xml version="1.0" encoding="UTF-8"?>
2
3 <from1>Jani1</from1>
4 <from2>Jani2</from2>
5 <from3>Jani3</from3>
6
07
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-03.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-03.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-03.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,2 @@
1<?xml version="1.0" encoding="UTF-8"?>
2Jani1Jani2Jani3
03
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-04.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-04.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-04.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,12 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<root>
3 <root2>
4 <from1>Jani1</from1>
5 </root2>
6 <root2>
7 <from2>Jani2</from2>
8 </root2>
9 <root2>
10 <from3>Jani3</from3>
11 </root2>
12</root>
013
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-05.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-05.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-05.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,12 @@
1<?xml version="1.0" encoding="UTF-8"?>
2
3 <root2>
4 <from1>Jani1</from1>
5 </root2>
6 <root2>
7 <from2>Jani2</from2>
8 </root2>
9 <root2>
10 <from3>Jani3</from3>
11 </root2>
12
013
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-06.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-06.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-06.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,8 @@
1<?xml version="1.0" encoding="UTF-8"?>
2
3 <from1>Jani1</from1>
4
5 <from2>Jani2</from2>
6
7 <from3>Jani3</from3>
8
09
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-07.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-07.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-07.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,2 @@
1<?xml version="1.0" encoding="UTF-8"?>
2Jani1Jani2Jani3
03
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-08.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-08.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-08.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,2 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<root><from1>Jani1</from1></root>
03
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-09.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-09.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-09.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,2 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<from1>Jani1</from1>
03
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-10.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-10.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-10.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,2 @@
1<?xml version="1.0" encoding="UTF-8"?>
2Jani1
03
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-11.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-11.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-11.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,2 @@
1<?xml version="1.0" encoding="UTF-8"?>
2
03
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-12.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-12.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-12.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,2 @@
1<?xml version="1.0" encoding="UTF-8"?>
2Jani1
03
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-13.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-13.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-13.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,2 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<from1>Jani1</from1>
03
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-14.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-14.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-14.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,2 @@
1<?xml version="1.0" encoding="UTF-8"?>
2Jani1
03
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-15.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-15.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-15.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,2 @@
1<?xml version="1.0" encoding="UTF-8"?>
2Jani1
03
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-16.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-16.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-16.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,2 @@
1<?xml version="1.0" encoding="UTF-8"?>
2Jani1
03
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-17.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-17.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-17.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,2 @@
1<?xml version="1.0" encoding="UTF-8"?>
2root3 text<from1>Jani1</from1>
03
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-18.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-18.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-18.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,2 @@
1<?xml version="1.0" encoding="UTF-8"?>
2Jani1
03
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-19.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-19.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-19.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,8 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<level1>
3 <level2>
4 <level3>
5 <level4>level4 text</level4>
6 </level3>
7 </level2>
8</level1>
09
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-20.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-20.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-20.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,8 @@
1<?xml version="1.0" encoding="UTF-8"?>
2
3 <level2>
4 <level3>
5 <level4>level4 text</level4>
6 </level3>
7 </level2>
8
09
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-21.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-21.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-21.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,6 @@
1<?xml version="1.0" encoding="UTF-8"?>
2
3 <level3>
4 <level4>level4 text</level4>
5 </level3>
6
07
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-22.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-22.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-22.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,4 @@
1<?xml version="1.0" encoding="UTF-8"?>
2
3 <level4>level4 text</level4>
4
05
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-23.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-23.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-23.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,2 @@
1<?xml version="1.0" encoding="UTF-8"?>
2level4 text
03
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-24.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-24.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-24.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,5 @@
1<?xml version="1.0" encoding="UTF-8"?>
2
3 <level4>level4 text</level4>
4 level3 end
5
06
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-25.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-25.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-25.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,14 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<level1>
3 level1 text start
4 <level2>
5 level2 text start
6 <level3>
7 level3 text start
8 <level4>level4 text</level4>
9 level3 text end
10 </level3>
11 level2 text end
12 </level2>
13 level1 text end
14</level1>
015
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-26.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-26.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-26.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,14 @@
1<?xml version="1.0" encoding="UTF-8"?>
2
3 level1 text start
4 <level2>
5 level2 text start
6 <level3>
7 level3 text start
8 <level4>level4 text</level4>
9 level3 text end
10 </level3>
11 level2 text end
12 </level2>
13 level1 text end
14
015
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-27.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-27.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-27.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,10 @@
1<?xml version="1.0" encoding="UTF-8"?>
2
3 level2 text start
4 <level3>
5 level3 text start
6 <level4>level4 text</level4>
7 level3 text end
8 </level3>
9 level2 text end
10
011
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-28.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-28.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-28.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,6 @@
1<?xml version="1.0" encoding="UTF-8"?>
2
3 level3 text start
4 <level4>level4 text</level4>
5 level3 text end
6
07
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-29.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-29.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-29.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,2 @@
1<?xml version="1.0" encoding="UTF-8"?>
2level4 text
03
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-30.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-30.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-30.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,2 @@
1<?xml version="1.0" encoding="UTF-8"?>
2
03
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-31.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-31.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-31.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,59 @@
1<?xml version="1.0" encoding="UTF-8"?>
2
3level0 text
4<level1>
5 level1 text start
6 <level2>
7 level2 text start
8 <level3>
9 level3 text start
10 <level4>level4 text</level4>
11 level3 text end
12 </level3>
13 level2 text end
14 </level2>
15 level1 text end
16</level1>
17level0 text
18<level1>
19 level1 text start
20 <level2>
21 level2 text start
22 <level3>
23 level3 text start
24 <level4>level4 text</level4>
25 level3 text end
26 </level3>
27 level2 text end
28 </level2>
29 level1 text end
30</level1>
31level0 text
32<level1>
33 level1 text start
34 <level2>
35 level2 text start
36 <level3>
37 level3 text start
38 <level4>level4 text</level4>
39 level3 text end
40 </level3>
41 level2 text end
42 </level2>
43 level1 text end
44</level1>
45level0 text
46<level1>
47 level1 text start
48 <level2>
49 level2 text start
50 <level3>
51 level3 text start
52 <level4>level4 text</level4>
53 level3 text end
54 </level3>
55 level2 text end
56 </level2>
57 level1 text end
58</level1>
59level0 text
060
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-32.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-32.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-32.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,50 @@
1<?xml version="1.0" encoding="UTF-8"?>
2
3 level1 text start
4 <level2>
5 level2 text start
6 <level3>
7 level3 text start
8 <level4>level4 text</level4>
9 level3 text end
10 </level3>
11 level2 text end
12 </level2>
13 level1 text end
14
15 level1 text start
16 <level2>
17 level2 text start
18 <level3>
19 level3 text start
20 <level4>level4 text</level4>
21 level3 text end
22 </level3>
23 level2 text end
24 </level2>
25 level1 text end
26
27 level1 text start
28 <level2>
29 level2 text start
30 <level3>
31 level3 text start
32 <level4>level4 text</level4>
33 level3 text end
34 </level3>
35 level2 text end
36 </level2>
37 level1 text end
38
39 level1 text start
40 <level2>
41 level2 text start
42 <level3>
43 level3 text start
44 <level4>level4 text</level4>
45 level3 text end
46 </level3>
47 level2 text end
48 </level2>
49 level1 text end
50
051
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-33.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-33.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-33.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,34 @@
1<?xml version="1.0" encoding="UTF-8"?>
2
3 level2 text start
4 <level3>
5 level3 text start
6 <level4>level4 text</level4>
7 level3 text end
8 </level3>
9 level2 text end
10
11 level2 text start
12 <level3>
13 level3 text start
14 <level4>level4 text</level4>
15 level3 text end
16 </level3>
17 level2 text end
18
19 level2 text start
20 <level3>
21 level3 text start
22 <level4>level4 text</level4>
23 level3 text end
24 </level3>
25 level2 text end
26
27 level2 text start
28 <level3>
29 level3 text start
30 <level4>level4 text</level4>
31 level3 text end
32 </level3>
33 level2 text end
34
035
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-34.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-34.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-34.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,18 @@
1<?xml version="1.0" encoding="UTF-8"?>
2
3 level3 text start
4 <level4>level4 text</level4>
5 level3 text end
6
7 level3 text start
8 <level4>level4 text</level4>
9 level3 text end
10
11 level3 text start
12 <level4>level4 text</level4>
13 level3 text end
14
15 level3 text start
16 <level4>level4 text</level4>
17 level3 text end
18
019
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-35.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-35.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-35.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,2 @@
1<?xml version="1.0" encoding="UTF-8"?>
2level4 textlevel4 textlevel4 textlevel4 text
03
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-36.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-36.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-36.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,2 @@
1<?xml version="1.0" encoding="UTF-8"?>
2
03
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-37.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-37.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-37.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,14 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<doc>
3 <foo>0</foo>
4 <foo>1</foo>
5 <foo>2</foo>
6 <foo>3</foo>
7 <foo>4</foo>
8 <foo>5</foo>
9 <foo>6</foo>
10 <foo>7</foo>
11 <foo>8</foo>
12 <foo>9</foo>
13 <foo>10</foo>
14</doc>
015
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-38.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-38.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-38.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,14 @@
1<?xml version="1.0" encoding="UTF-8"?>
2
3 <foo>0</foo>
4 <foo>1</foo>
5 <foo>2</foo>
6 <foo>3</foo>
7 <foo>4</foo>
8 <foo>5</foo>
9 <foo>6</foo>
10 <foo>7</foo>
11 <foo>8</foo>
12 <foo>9</foo>
13 <foo>10</foo>
14
015
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-39.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-39.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-39.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,2 @@
1<?xml version="1.0" encoding="UTF-8"?>
2012345678910
03
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-40.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-40.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-40.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,3 @@
1<?xml version="1.0" encoding="UTF-8"?>
2
3<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>
04
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-41.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-41.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-41.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,2 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<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>
03
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-42.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-42.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-42.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,2 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<n1:from1 xmlns:n1="ns" xmlns:m1="ms" xmlns:n2="ns2" xmlns:m2="ms2" xmlns:n3="ns3"><from2>Text from2</from2></n1:from1>
0\ No newline at end of file3\ No newline at end of file
14
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-43.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-43.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-43.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,2 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<from2 xmlns:n1="ns" xmlns:m1="ms" xmlns:n2="ns2" xmlns:m2="ms2" xmlns:n3="ns3">Text from2</from2>
0\ No newline at end of file3\ No newline at end of file
14
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-44.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-44.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-44.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,2 @@
1<?xml version="1.0" encoding="UTF-8"?>
2Text from2
0\ No newline at end of file3\ No newline at end of file
14
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-45.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-45.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-45.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,2 @@
1<?xml version="1.0" encoding="UTF-8"?>
2
03
=== added file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-46.xml.res'
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-46.xml.res 1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-fragment-skip-root-46.xml.res 2012-02-03 22:18:21 +0000
@@ -0,0 +1,31 @@
1<?xml version="1.0" encoding="UTF-8"?>
2
3level0 text
4<level1/>
5level0 text
6<level1/>
7level0 text
8<level1/>
9level0 text
10<level1/>
11level0 text
12<level1/>
13level0 text
14<level1/>
15level0 text
16<level1/>
17level0 text
18<level1/>
19level0 text
20<level1/>
21level0 text
22<level1/>
23level0 text
24<level1/>
25level0 text
26<level1/>
27level0 text
28<level1/>
29level0 text
30<level1/>
31level0 text
0\ No newline at end of file32\ No newline at end of file
133
=== modified file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-xml-fragment-01.xml.res' (properties changed: +x to -x)
=== modified file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-xml-fragment-03.xml.res' (properties changed: +x to -x)
=== modified file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-xml-fragment-04.xml.res' (properties changed: +x to -x)
=== modified file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-xml-fragment-05.xml.res' (properties changed: +x to -x)
=== modified file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-xml-fragment-07.xml.res' (properties changed: +x to -x)
=== modified file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-xml-fragment-10.xml.res' (properties changed: +x to -x)
=== modified file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-xml-fragment-11.xml.res' (properties changed: +x to -x)
=== modified file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-xml-fragment-12.xml.res' (properties changed: +x to -x)
--- test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-xml-fragment-12.xml.res 2011-07-15 16:39:51 +0000
+++ test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-xml-fragment-12.xml.res 2012-02-03 22:18:21 +0000
@@ -1,4 +1,4 @@
1<?xml version="1.0" encoding="UTF-8"?>1<?xml version="1.0" encoding="UTF-8"?>
2<fragment><from1>Jani</from1>2<fragment><from1>Jani</from1>
3<from2>Jani</from2>3<from2>Jani</from2>
4<from3>Jani</from3><count>5</count></fragment>
5\ No newline at end of file4\ No newline at end of file
5<from3>Jani</from3><count>6</count></fragment>
6\ No newline at end of file6\ No newline at end of file
77
=== modified file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-xml-fragment-14.xml.res' (properties changed: +x to -x)
=== modified file 'test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-xml-fragment-15.xml.res' (properties changed: +x to -x)
=== 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'
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-01.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-01.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-01.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,8 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?><root><from1>Jani</from1></root>",
5 <opt:options>
6 <opt:parse-external-parsed-entity opt:skip-root-nodes="1"/>
7 </opt:options>
8)
09
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-02.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-02.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-02.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,13 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<root>
6 <from1>Jani1</from1>
7 <from2>Jani2</from2>
8 <from3>Jani3</from3>
9</root>",
10 <opt:options>
11 <opt:parse-external-parsed-entity opt:skip-root-nodes="1"/>
12 </opt:options>
13)
014
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-03.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-03.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-03.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,13 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<root>
6 <from1>Jani1</from1>
7 <from2>Jani2</from2>
8 <from3>Jani3</from3>
9</root>",
10 <opt:options>
11 <opt:parse-external-parsed-entity opt:skip-root-nodes="2"/>
12 </opt:options>
13)
014
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-04.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-04.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-04.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,19 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<root>
6 <root2>
7 <from1>Jani1</from1>
8 </root2>
9 <root2>
10 <from2>Jani2</from2>
11 </root2>
12 <root2>
13 <from3>Jani3</from3>
14 </root2>
15</root>",
16 <opt:options>
17 <opt:parse-external-parsed-entity opt:skip-root-nodes="0"/>
18 </opt:options>
19)
020
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-05.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-05.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-05.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,19 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<root>
6 <root2>
7 <from1>Jani1</from1>
8 </root2>
9 <root2>
10 <from2>Jani2</from2>
11 </root2>
12 <root2>
13 <from3>Jani3</from3>
14 </root2>
15</root>",
16 <opt:options>
17 <opt:parse-external-parsed-entity opt:skip-root-nodes="1"/>
18 </opt:options>
19)
020
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-06.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-06.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-06.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,19 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<root>
6 <root2>
7 <from1>Jani1</from1>
8 </root2>
9 <root2>
10 <from2>Jani2</from2>
11 </root2>
12 <root2>
13 <from3>Jani3</from3>
14 </root2>
15</root>",
16 <opt:options>
17 <opt:parse-external-parsed-entity opt:skip-root-nodes="2"/>
18 </opt:options>
19)
020
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-07.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-07.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-07.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,19 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<root>
6 <root2>
7 <from1>Jani1</from1>
8 </root2>
9 <root2>
10 <from2>Jani2</from2>
11 </root2>
12 <root2>
13 <from3>Jani3</from3>
14 </root2>
15</root>",
16 <opt:options>
17 <opt:parse-external-parsed-entity opt:skip-root-nodes="3"/>
18 </opt:options>
19)
020
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-08.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-08.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-08.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,9 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<root><from1>Jani1</from1></root>",
6 <opt:options>
7 <opt:parse-external-parsed-entity opt:skip-root-nodes="0"/>
8 </opt:options>
9)
010
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-09.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-09.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-09.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,9 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<root><from1>Jani1</from1></root>",
6 <opt:options>
7 <opt:parse-external-parsed-entity opt:skip-root-nodes="1"/>
8 </opt:options>
9)
010
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-10.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-10.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-10.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,9 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<root><from1>Jani1</from1></root>",
6 <opt:options>
7 <opt:parse-external-parsed-entity opt:skip-root-nodes="2"/>
8 </opt:options>
9)
010
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-11.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-11.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-11.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,9 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<root><from1>Jani1</from1></root>",
6 <opt:options>
7 <opt:parse-external-parsed-entity opt:skip-root-nodes="3"/>
8 </opt:options>
9)
010
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-12.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-12.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-12.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,9 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<root><root2><from1>Jani1</from1></root2></root>",
6 <opt:options>
7 <opt:parse-external-parsed-entity opt:skip-root-nodes="3"/>
8 </opt:options>
9)
010
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-13.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-13.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-13.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,9 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<root><root2><root3><from1>Jani1</from1></root3></root2></root>",
6 <opt:options>
7 <opt:parse-external-parsed-entity opt:skip-root-nodes="3"/>
8 </opt:options>
9)
010
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-14.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-14.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-14.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,9 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<root><root2><root3><from1>Jani1</from1></root3></root2></root>",
6 <opt:options>
7 <opt:parse-external-parsed-entity opt:skip-root-nodes="4"/>
8 </opt:options>
9)
010
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-15.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-15.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-15.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,8 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?><root>root1 text<root2>root2 text<root3>root3 text<from1>Jani1</from1></root3></root2></root>",
5 <opt:options>
6 <opt:parse-external-parsed-entity opt:skip-root-nodes="4"/>
7 </opt:options>
8)
09
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-16.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-16.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-16.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,8 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?><root>root1 text<root15>root15 text</root15><root2>root2 text<root3>root3 text<from1>Jani1</from1></root3></root2></root>",
5 <opt:options>
6 <opt:parse-external-parsed-entity opt:skip-root-nodes="4"/>
7 </opt:options>
8)
09
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-17.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-17.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-17.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,8 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?><root>root1 text<root15>root15 text</root15><root2>root2 text<root3>root3 text<from1>Jani1</from1></root3></root2></root>",
5 <opt:options>
6 <opt:parse-external-parsed-entity opt:skip-root-nodes="3"/>
7 </opt:options>
8)
09
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-18.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-18.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-18.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,9 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<root>Jani0<from1>Jani1</from1></root>",
6 <opt:options>
7 <opt:parse-external-parsed-entity opt:skip-root-nodes="2"/>
8 </opt:options>
9)
010
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-19.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-19.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-19.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,15 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<level1>
6 <level2>
7 <level3>
8 <level4>level4 text</level4>
9 </level3>
10 </level2>
11</level1>",
12 <opt:options>
13 <opt:parse-external-parsed-entity opt:skip-root-nodes="0"/>
14 </opt:options>
15)
016
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-20.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-20.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-20.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,15 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<level1>
6 <level2>
7 <level3>
8 <level4>level4 text</level4>
9 </level3>
10 </level2>
11</level1>",
12 <opt:options>
13 <opt:parse-external-parsed-entity opt:skip-root-nodes="1"/>
14 </opt:options>
15)
016
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-21.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-21.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-21.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,15 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<level1>
6 <level2>
7 <level3>
8 <level4>level4 text</level4>
9 </level3>
10 </level2>
11</level1>",
12 <opt:options>
13 <opt:parse-external-parsed-entity opt:skip-root-nodes="2"/>
14 </opt:options>
15)
016
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-22.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-22.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-22.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,15 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<level1>
6 <level2>
7 <level3>
8 <level4>level4 text</level4>
9 </level3>
10 </level2>
11</level1>",
12 <opt:options>
13 <opt:parse-external-parsed-entity opt:skip-root-nodes="3"/>
14 </opt:options>
15)
016
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-23.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-23.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-23.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,15 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<level1>
6 <level2>
7 <level3>
8 <level4>level4 text</level4>
9 </level3>
10 </level2>
11</level1>",
12 <opt:options>
13 <opt:parse-external-parsed-entity opt:skip-root-nodes="4"/>
14 </opt:options>
15)
016
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-24.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-24.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-24.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,16 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<level1>
6 <level2>
7 <level3>
8 <level4>level4 text</level4>
9 level3 end
10 </level3>
11 </level2>
12</level1>",
13 <opt:options>
14 <opt:parse-external-parsed-entity opt:skip-root-nodes="3"/>
15 </opt:options>
16)
017
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-25.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-25.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-25.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,21 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<level1>
6 level1 text start
7 <level2>
8 level2 text start
9 <level3>
10 level3 text start
11 <level4>level4 text</level4>
12 level3 text end
13 </level3>
14 level2 text end
15 </level2>
16 level1 text end
17</level1>",
18 <opt:options>
19 <opt:parse-external-parsed-entity opt:skip-root-nodes="0"/>
20 </opt:options>
21)
022
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-26.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-26.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-26.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,21 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<level1>
6 level1 text start
7 <level2>
8 level2 text start
9 <level3>
10 level3 text start
11 <level4>level4 text</level4>
12 level3 text end
13 </level3>
14 level2 text end
15 </level2>
16 level1 text end
17</level1>",
18 <opt:options>
19 <opt:parse-external-parsed-entity opt:skip-root-nodes="1"/>
20 </opt:options>
21)
022
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-27.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-27.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-27.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,21 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<level1>
6 level1 text start
7 <level2>
8 level2 text start
9 <level3>
10 level3 text start
11 <level4>level4 text</level4>
12 level3 text end
13 </level3>
14 level2 text end
15 </level2>
16 level1 text end
17</level1>",
18 <opt:options>
19 <opt:parse-external-parsed-entity opt:skip-root-nodes="2"/>
20 </opt:options>
21)
022
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-28.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-28.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-28.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,21 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<level1>
6 level1 text start
7 <level2>
8 level2 text start
9 <level3>
10 level3 text start
11 <level4>level4 text</level4>
12 level3 text end
13 </level3>
14 level2 text end
15 </level2>
16 level1 text end
17</level1>",
18 <opt:options>
19 <opt:parse-external-parsed-entity opt:skip-root-nodes="3"/>
20 </opt:options>
21)
022
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-29.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-29.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-29.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,21 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<level1>
6 level1 text start
7 <level2>
8 level2 text start
9 <level3>
10 level3 text start
11 <level4>level4 text</level4>
12 level3 text end
13 </level3>
14 level2 text end
15 </level2>
16 level1 text end
17</level1>",
18 <opt:options>
19 <opt:parse-external-parsed-entity opt:skip-root-nodes="4"/>
20 </opt:options>
21)
022
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-30.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-30.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-30.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,21 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<level1>
6 level1 text start
7 <level2>
8 level2 text start
9 <level3>
10 level3 text start
11 <level4>level4 text</level4>
12 level3 text end
13 </level3>
14 level2 text end
15 </level2>
16 level1 text end
17</level1>",
18 <opt:options>
19 <opt:parse-external-parsed-entity opt:skip-root-nodes="5"/>
20 </opt:options>
21)
022
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-31.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-31.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-31.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,65 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5level0 text
6<level1>
7 level1 text start
8 <level2>
9 level2 text start
10 <level3>
11 level3 text start
12 <level4>level4 text</level4>
13 level3 text end
14 </level3>
15 level2 text end
16 </level2>
17 level1 text end
18</level1>
19level0 text
20<level1>
21 level1 text start
22 <level2>
23 level2 text start
24 <level3>
25 level3 text start
26 <level4>level4 text</level4>
27 level3 text end
28 </level3>
29 level2 text end
30 </level2>
31 level1 text end
32</level1>
33level0 text
34<level1>
35 level1 text start
36 <level2>
37 level2 text start
38 <level3>
39 level3 text start
40 <level4>level4 text</level4>
41 level3 text end
42 </level3>
43 level2 text end
44 </level2>
45 level1 text end
46</level1>
47level0 text
48<level1>
49 level1 text start
50 <level2>
51 level2 text start
52 <level3>
53 level3 text start
54 <level4>level4 text</level4>
55 level3 text end
56 </level3>
57 level2 text end
58 </level2>
59 level1 text end
60</level1>
61level0 text",
62 <opt:options>
63 <opt:parse-external-parsed-entity opt:skip-root-nodes="0"/>
64 </opt:options>
65)
066
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-32.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-32.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-32.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,65 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5level0 text
6<level1>
7 level1 text start
8 <level2>
9 level2 text start
10 <level3>
11 level3 text start
12 <level4>level4 text</level4>
13 level3 text end
14 </level3>
15 level2 text end
16 </level2>
17 level1 text end
18</level1>
19level0 text
20<level1>
21 level1 text start
22 <level2>
23 level2 text start
24 <level3>
25 level3 text start
26 <level4>level4 text</level4>
27 level3 text end
28 </level3>
29 level2 text end
30 </level2>
31 level1 text end
32</level1>
33level0 text
34<level1>
35 level1 text start
36 <level2>
37 level2 text start
38 <level3>
39 level3 text start
40 <level4>level4 text</level4>
41 level3 text end
42 </level3>
43 level2 text end
44 </level2>
45 level1 text end
46</level1>
47level0 text
48<level1>
49 level1 text start
50 <level2>
51 level2 text start
52 <level3>
53 level3 text start
54 <level4>level4 text</level4>
55 level3 text end
56 </level3>
57 level2 text end
58 </level2>
59 level1 text end
60</level1>
61level0 text",
62 <opt:options>
63 <opt:parse-external-parsed-entity opt:skip-root-nodes="1"/>
64 </opt:options>
65)
066
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-33.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-33.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-33.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,65 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5level0 text
6<level1>
7 level1 text start
8 <level2>
9 level2 text start
10 <level3>
11 level3 text start
12 <level4>level4 text</level4>
13 level3 text end
14 </level3>
15 level2 text end
16 </level2>
17 level1 text end
18</level1>
19level0 text
20<level1>
21 level1 text start
22 <level2>
23 level2 text start
24 <level3>
25 level3 text start
26 <level4>level4 text</level4>
27 level3 text end
28 </level3>
29 level2 text end
30 </level2>
31 level1 text end
32</level1>
33level0 text
34<level1>
35 level1 text start
36 <level2>
37 level2 text start
38 <level3>
39 level3 text start
40 <level4>level4 text</level4>
41 level3 text end
42 </level3>
43 level2 text end
44 </level2>
45 level1 text end
46</level1>
47level0 text
48<level1>
49 level1 text start
50 <level2>
51 level2 text start
52 <level3>
53 level3 text start
54 <level4>level4 text</level4>
55 level3 text end
56 </level3>
57 level2 text end
58 </level2>
59 level1 text end
60</level1>
61level0 text",
62 <opt:options>
63 <opt:parse-external-parsed-entity opt:skip-root-nodes="2"/>
64 </opt:options>
65)
066
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-34.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-34.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-34.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,65 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5level0 text
6<level1>
7 level1 text start
8 <level2>
9 level2 text start
10 <level3>
11 level3 text start
12 <level4>level4 text</level4>
13 level3 text end
14 </level3>
15 level2 text end
16 </level2>
17 level1 text end
18</level1>
19level0 text
20<level1>
21 level1 text start
22 <level2>
23 level2 text start
24 <level3>
25 level3 text start
26 <level4>level4 text</level4>
27 level3 text end
28 </level3>
29 level2 text end
30 </level2>
31 level1 text end
32</level1>
33level0 text
34<level1>
35 level1 text start
36 <level2>
37 level2 text start
38 <level3>
39 level3 text start
40 <level4>level4 text</level4>
41 level3 text end
42 </level3>
43 level2 text end
44 </level2>
45 level1 text end
46</level1>
47level0 text
48<level1>
49 level1 text start
50 <level2>
51 level2 text start
52 <level3>
53 level3 text start
54 <level4>level4 text</level4>
55 level3 text end
56 </level3>
57 level2 text end
58 </level2>
59 level1 text end
60</level1>
61level0 text",
62 <opt:options>
63 <opt:parse-external-parsed-entity opt:skip-root-nodes="3"/>
64 </opt:options>
65)
066
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-35.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-35.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-35.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,65 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5level0 text
6<level1>
7 level1 text start
8 <level2>
9 level2 text start
10 <level3>
11 level3 text start
12 <level4>level4 text</level4>
13 level3 text end
14 </level3>
15 level2 text end
16 </level2>
17 level1 text end
18</level1>
19level0 text
20<level1>
21 level1 text start
22 <level2>
23 level2 text start
24 <level3>
25 level3 text start
26 <level4>level4 text</level4>
27 level3 text end
28 </level3>
29 level2 text end
30 </level2>
31 level1 text end
32</level1>
33level0 text
34<level1>
35 level1 text start
36 <level2>
37 level2 text start
38 <level3>
39 level3 text start
40 <level4>level4 text</level4>
41 level3 text end
42 </level3>
43 level2 text end
44 </level2>
45 level1 text end
46</level1>
47level0 text
48<level1>
49 level1 text start
50 <level2>
51 level2 text start
52 <level3>
53 level3 text start
54 <level4>level4 text</level4>
55 level3 text end
56 </level3>
57 level2 text end
58 </level2>
59 level1 text end
60</level1>
61level0 text",
62 <opt:options>
63 <opt:parse-external-parsed-entity opt:skip-root-nodes="4"/>
64 </opt:options>
65)
066
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-36.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-36.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-36.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,65 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5level0 text
6<level1>
7 level1 text start
8 <level2>
9 level2 text start
10 <level3>
11 level3 text start
12 <level4>level4 text</level4>
13 level3 text end
14 </level3>
15 level2 text end
16 </level2>
17 level1 text end
18</level1>
19level0 text
20<level1>
21 level1 text start
22 <level2>
23 level2 text start
24 <level3>
25 level3 text start
26 <level4>level4 text</level4>
27 level3 text end
28 </level3>
29 level2 text end
30 </level2>
31 level1 text end
32</level1>
33level0 text
34<level1>
35 level1 text start
36 <level2>
37 level2 text start
38 <level3>
39 level3 text start
40 <level4>level4 text</level4>
41 level3 text end
42 </level3>
43 level2 text end
44 </level2>
45 level1 text end
46</level1>
47level0 text
48<level1>
49 level1 text start
50 <level2>
51 level2 text start
52 <level3>
53 level3 text start
54 <level4>level4 text</level4>
55 level3 text end
56 </level3>
57 level2 text end
58 </level2>
59 level1 text end
60</level1>
61level0 text",
62 <opt:options>
63 <opt:parse-external-parsed-entity opt:skip-root-nodes="5"/>
64 </opt:options>
65)
066
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-37.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-37.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-37.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,20 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<doc>
5 <foo>0</foo>
6 <foo>1</foo>
7 <foo>2</foo>
8 <foo>3</foo>
9 <foo>4</foo>
10 <foo>5</foo>
11 <foo>6</foo>
12 <foo>7</foo>
13 <foo>8</foo>
14 <foo>9</foo>
15 <foo>10</foo>
16</doc>",
17 <opt:options>
18 <opt:parse-external-parsed-entity opt:skip-root-nodes="0"/>
19 </opt:options>
20)
021
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-38.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-38.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-38.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,20 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<doc>
5 <foo>0</foo>
6 <foo>1</foo>
7 <foo>2</foo>
8 <foo>3</foo>
9 <foo>4</foo>
10 <foo>5</foo>
11 <foo>6</foo>
12 <foo>7</foo>
13 <foo>8</foo>
14 <foo>9</foo>
15 <foo>10</foo>
16</doc>",
17 <opt:options>
18 <opt:parse-external-parsed-entity opt:skip-root-nodes="1"/>
19 </opt:options>
20)
021
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-39.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-39.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-39.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,20 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<doc>
5 <foo>0</foo>
6 <foo>1</foo>
7 <foo>2</foo>
8 <foo>3</foo>
9 <foo>4</foo>
10 <foo>5</foo>
11 <foo>6</foo>
12 <foo>7</foo>
13 <foo>8</foo>
14 <foo>9</foo>
15 <foo>10</foo>
16</doc>",
17 <opt:options>
18 <opt:parse-external-parsed-entity opt:skip-root-nodes="2"/>
19 </opt:options>
20)
021
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-40.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-40.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-40.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,9 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<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>",
6 <opt:options>
7 <opt:parse-external-parsed-entity opt:skip-root-nodes="0"/>
8 </opt:options>
9)
010
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-41.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-41.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-41.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,9 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<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>",
6 <opt:options>
7 <opt:parse-external-parsed-entity opt:skip-root-nodes="1"/>
8 </opt:options>
9)
010
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-42.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-42.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-42.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,9 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<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>",
6 <opt:options>
7 <opt:parse-external-parsed-entity opt:skip-root-nodes="2"/>
8 </opt:options>
9)
010
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-43.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-43.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-43.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,9 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<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>",
6 <opt:options>
7 <opt:parse-external-parsed-entity opt:skip-root-nodes="3"/>
8 </opt:options>
9)
010
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-44.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-44.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-44.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,9 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<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>",
6 <opt:options>
7 <opt:parse-external-parsed-entity opt:skip-root-nodes="4"/>
8 </opt:options>
9)
010
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-45.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-45.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-45.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,9 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5<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>",
6 <opt:options>
7 <opt:parse-external-parsed-entity opt:skip-root-nodes="5"/>
8 </opt:options>
9)
010
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-46.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-46.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-46.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,37 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<?xml version='1.0'?>
5level0 text
6<level1/>
7level0 text
8<level1/>
9level0 text
10<level1/>
11level0 text
12<level1/>
13level0 text
14<level1/>
15level0 text
16<level1/>
17level0 text
18<level1/>
19level0 text
20<level1/>
21level0 text
22<level1/>
23level0 text
24<level1/>
25level0 text
26<level1/>
27level0 text
28<level1/>
29level0 text
30<level1/>
31level0 text
32<level1/>
33level0 text",
34<opt:options>
35 <opt:parse-external-parsed-entity/>
36</opt:options>
37)
038
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-47.spec'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-47.spec 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-47.spec 2012-02-03 22:18:21 +0000
@@ -0,0 +1,1 @@
1Error: http://www.w3.org/2005/xqt-errors:FODC0006
02
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-47.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-47.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-47.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,13 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<root>
5 <test/>
6 <test/>
7 </bad>
8</root>
9",
10 <opt:options>
11 <opt:parse-external-parsed-entity opt:skip-root-nodes="0"/>
12 </opt:options>
13)
014
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-48.spec'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-48.spec 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-48.spec 2012-02-03 22:18:21 +0000
@@ -0,0 +1,1 @@
1Error: http://www.w3.org/2005/xqt-errors:FODC0006
02
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-48.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-48.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-48.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,13 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<root>
5 <test/>
6 <test/>
7 </bad>
8</root>
9",
10 <opt:options>
11 <opt:parse-external-parsed-entity opt:skip-root-nodes="1"/>
12 </opt:options>
13)
014
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-49.spec'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-49.spec 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-49.spec 2012-02-03 22:18:21 +0000
@@ -0,0 +1,1 @@
1Error: http://www.w3.org/2005/xqt-errors:FODC0006
02
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-49.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-49.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-49.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,13 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<root>
5 <test/>
6 <test/>
7 </bad>
8</root>
9",
10 <opt:options>
11 <opt:parse-external-parsed-entity opt:skip-root-nodes="2"/>
12 </opt:options>
13)
014
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-50.spec'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-50.spec 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-50.spec 2012-02-03 22:18:21 +0000
@@ -0,0 +1,1 @@
1Error: http://www.w3.org/2005/xqt-errors:FODC0006
02
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-50.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-50.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-50.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,13 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<root>
5 <test/>
6 <test/>
7</root>
8</bad>
9",
10 <opt:options>
11 <opt:parse-external-parsed-entity opt:skip-root-nodes="1"/>
12 </opt:options>
13)
014
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-51.spec'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-51.spec 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-51.spec 2012-02-03 22:18:21 +0000
@@ -0,0 +1,1 @@
1Error: http://www.w3.org/2005/xqt-errors:FODC0006
02
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-51.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-51.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-51.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,11 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<root>
5 <test/>
6 <test/>
7",
8 <opt:options>
9 <opt:parse-external-parsed-entity opt:skip-root-nodes="0"/>
10 </opt:options>
11)
012
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-52.spec'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-52.spec 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-52.spec 2012-02-03 22:18:21 +0000
@@ -0,0 +1,1 @@
1Error: http://www.w3.org/2005/xqt-errors:FODC0006
02
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-52.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-52.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-fragment-skip-root-52.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,11 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<root>
5 <test/>
6 <test/>
7",
8 <opt:options>
9 <opt:parse-external-parsed-entity opt:skip-root-nodes="1"/>
10 </opt:options>
11)
012
=== modified file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-01.xq' (properties changed: +x to -x)
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-01.xq 2011-07-03 13:45:27 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-01.xq 2012-02-03 22:18:21 +0000
@@ -1,6 +1,7 @@
1import module namespace x = "http://www.zorba-xquery.com/modules/xml";1import module namespace x = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
23
3x:parse-xml-fragment("<?xml version='1.0'?>4x:parse("<?xml version='1.0'?>
4<!DOCTYPE note [5<!DOCTYPE note [
5<!ELEMENT note (to,from,heading,body)>6<!ELEMENT note (to,from,heading,body)>
6<!ELEMENT to (#PCDATA)>7<!ELEMENT to (#PCDATA)>
@@ -15,4 +16,7 @@
15<body>Don't forget me this weekend</body>16<body>Don't forget me this weekend</body>
16</note>17</note>
17", 18",
18"d")19 <opt:options>
20 <opt:DTD-validate/>
21 </opt:options>
22)
1923
=== modified file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-02.spec' (properties changed: +x to -x)
=== modified file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-02.xq' (properties changed: +x to -x)
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-02.xq 2011-07-03 13:45:27 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-02.xq 2012-02-03 22:18:21 +0000
@@ -1,6 +1,7 @@
1import module namespace x = "http://www.zorba-xquery.com/modules/xml";1import module namespace x = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
23
3x:parse-xml-fragment("<?xml version='1.0'?>4x:parse("<?xml version='1.0'?>
4<!DOCTYPE note [5<!DOCTYPE note [
5<!ELEMENT note (to,from,heading,body)>6<!ELEMENT note (to,from,heading,body)>
6<!ELEMENT to (#PCDATA)>7<!ELEMENT to (#PCDATA)>
@@ -12,4 +13,7 @@
12<incorrect>Element not in DTD</incorrect>13<incorrect>Element not in DTD</incorrect>
13</note>14</note>
14", 15",
15"d")16 <opt:options>
17 <opt:DTD-validate/>
18 </opt:options>
19)
1620
=== modified file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-03.xq' (properties changed: +x to -x)
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-03.xq 2011-07-03 13:45:27 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-03.xq 2012-02-03 22:18:21 +0000
@@ -1,8 +1,12 @@
1import module namespace x = "http://www.zorba-xquery.com/modules/xml";1import module namespace x = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
23
3x:parse-xml-fragment("<?xml version='1.0'?>4x:parse("<?xml version='1.0'?>
4<from1>Jani</from1>5<from1>Jani</from1>
5<from2>Jani</from2>6<from2>Jani</from2>
6<from3>Jani</from3>7<from3>Jani</from3>
7", 8",
8"e")9 <opt:options>
10 <opt:parse-external-parsed-entity/>
11 </opt:options>
12)
913
=== modified file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-04.xq' (properties changed: +x to -x)
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-04.xq 2011-07-03 13:45:27 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-04.xq 2012-02-03 22:18:21 +0000
@@ -1,8 +1,12 @@
1import module namespace x = "http://www.zorba-xquery.com/modules/xml";1import module namespace x = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
23
3x:parse-xml-fragment("4x:parse("
4<from1>Jani</from1>5<from1>Jani</from1>
5<from2>Jani</from2>6<from2>Jani</from2>
6<from3>Jani</from3>7<from3>Jani</from3>
7", 8",
8"e")9 <opt:options>
10 <opt:parse-external-parsed-entity/>
11 </opt:options>
12)
913
=== modified file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-05.xq' (properties changed: +x to -x)
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-05.xq 2011-07-03 13:45:27 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-05.xq 2012-02-03 22:18:21 +0000
@@ -1,3 +1,9 @@
1import module namespace x = "http://www.zorba-xquery.com/modules/xml";1import module namespace x = "http://www.zorba-xquery.com/modules/xml";
22import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3x:parse-xml-fragment("<?xml version='1.0'?><a/>", "e")3
4x:parse("<?xml version='1.0'?><a/>",
5 <opt:options>
6 <opt:parse-external-parsed-entity/>
7 </opt:options>
8)
9
410
=== modified file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-06.spec' (properties changed: +x to -x)
=== modified file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-06.xq' (properties changed: +x to -x)
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-06.xq 2011-07-03 13:45:27 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-06.xq 2012-02-03 22:18:21 +0000
@@ -1,8 +1,12 @@
1import module namespace x = "http://www.zorba-xquery.com/modules/xml";1import module namespace x = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
23
3x:parse-xml-fragment("<?xml version='1.0'?>4x:parse("<?xml version='1.0'?>
4<from1>Jani</from1>5<from1>Jani</from1>
5<from2>Jani</from2>6<from2>Jani</from2>
6<from3>Jani</from3>7<from3>Jani</from3>
7", 8",
8"d")9 <opt:options>
10 <opt:DTD-validate/>
11 </opt:options>
12)
913
=== modified file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-07.xq' (properties changed: +x to -x)
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-07.xq 2011-07-03 13:45:27 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-07.xq 2012-02-03 22:18:21 +0000
@@ -1,10 +1,14 @@
1import module namespace x = "http://www.zorba-xquery.com/modules/xml";1import module namespace x = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
2import schema namespace weather = "http://www.w3.org/test/weather" at "weather.xsd";3import schema namespace weather = "http://www.w3.org/test/weather" at "weather.xsd";
34
4x:parse-xml-fragment("<?xml version='1.0' encoding = 'UTF-8'?>5x:parse("<?xml version='1.0' encoding = 'UTF-8'?>
5<weather:weather xmlns:weather='http://www.w3.org/test/weather' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>6<weather:weather xmlns:weather='http://www.w3.org/test/weather' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
6 <weather:temperature>30</weather:temperature>7 <weather:temperature>30</weather:temperature>
7 <weather:precipitation>20</weather:precipitation>8 <weather:precipitation>20</weather:precipitation>
8</weather:weather>9</weather:weather>
9",10",
10"s")11 <opt:options>
12 <opt:schema-validate opt:mode="lax"/>
13 </opt:options>
14)
1115
=== modified file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-08.spec' (properties changed: +x to -x)
=== modified file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-08.xq' (properties changed: +x to -x)
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-08.xq 2011-07-03 13:45:27 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-08.xq 2012-02-03 22:18:21 +0000
@@ -1,10 +1,15 @@
1import module namespace x = "http://www.zorba-xquery.com/modules/xml";1import module namespace x = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
2import schema namespace weather = "http://www.w3.org/test/weather" at "weather.xsd";3import schema namespace weather = "http://www.w3.org/test/weather" at "weather.xsd";
34
4x:parse-xml-fragment("<?xml version='1.0' encoding = 'UTF-8'?>5x:parse("<?xml version='1.0' encoding = 'UTF-8'?>
5<weather:weather xmlns:weather='http://www.w3.org/test/weather' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>6<weather:weather xmlns:weather='http://www.w3.org/test/weather' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
6 <weather:incorrect>30</weather:incorrect>7 <weather:incorrect>30</weather:incorrect>
7 <weather:precipitation>20</weather:precipitation>8 <weather:precipitation>20</weather:precipitation>
8</weather:weather>9</weather:weather>
9",10",
10"s")11 <opt:options>
12 <opt:schema-validate opt:mode="strict"/>
13 </opt:options>
14)
15
1116
=== modified file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-09.spec' (properties changed: +x to -x)
=== modified file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-09.xq' (properties changed: +x to -x)
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-09.xq 2011-07-03 13:45:27 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-09.xq 2012-02-03 22:18:21 +0000
@@ -1,6 +1,10 @@
1import module namespace x = "http://www.zorba-xquery.com/modules/xml";1import module namespace x = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
23
3x:parse-xml-fragment("<?xml version='1.0' encoding = 'UTF-8'?>4x:parse("<?xml version='1.0' encoding = 'UTF-8'?>
4<atomic:root xmlns:atomic='http://www.w3.org/XQueryTest'>5<atomic:root xmlns:atomic='http://www.w3.org/XQueryTest'>
5<atomic:duration>P1Y2M3DT10H30M</atomic:duration>",6<atomic:duration>P1Y2M3DT10H30M</atomic:duration>",
6"e")7 <opt:options>
8 <opt:parse-external-parsed-entity/>
9 </opt:options>
10)
711
=== modified file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-10.xq' (properties changed: +x to -x)
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-10.xq 2011-07-03 13:45:27 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-10.xq 2012-02-03 22:18:21 +0000
@@ -1,6 +1,6 @@
1import module namespace x = "http://www.zorba-xquery.com/modules/xml";1import module namespace x = "http://www.zorba-xquery.com/modules/xml";
22
3x:parse-xml-fragment("<?xml version='1.0'?>3x:parse("<?xml version='1.0'?>
4<root>4<root>
5 <from1>Jani</from1>5 <from1>Jani</from1>
6 6
@@ -8,4 +8,4 @@
8 8
9 <from3>Jani</from3>9 <from3>Jani</from3>
10</root>", 10</root>",
11"")11() )
1212
=== modified file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-11.xq' (properties changed: +x to -x)
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-11.xq 2011-07-03 13:45:27 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-11.xq 2012-02-03 22:18:21 +0000
@@ -1,6 +1,7 @@
1import module namespace x = "http://www.zorba-xquery.com/modules/xml";1import module namespace x = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
23
3x:parse-xml-fragment("<?xml version='1.0'?>4x:parse("<?xml version='1.0'?>
4<!DOCTYPE note [5<!DOCTYPE note [
5<!ELEMENT note (to,from,heading,body)>6<!ELEMENT note (to,from,heading,body)>
6<!ELEMENT to (#PCDATA)>7<!ELEMENT to (#PCDATA)>
@@ -12,4 +13,8 @@
12<incorrect>Element not in DTD</incorrect>13<incorrect>Element not in DTD</incorrect>
13</note>14</note>
14", 15",
15"dF")16 <opt:options>
17 <opt:DTD-validate/>
18 <opt:no-error/>
19 </opt:options>
20)
1621
=== modified file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-12.xq' (properties changed: +x to -x)
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-12.xq 2011-07-09 15:49:26 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-12.xq 2012-02-03 22:18:21 +0000
@@ -1,8 +1,12 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
23
3let $var := z:parse-xml-fragment("<?xml version='1.0'?>4let $var := z:parse("<?xml version='1.0'?>
4<from1>Jani</from1>5<from1>Jani</from1>
5<from2>Jani</from2>6<from2>Jani</from2>
6<from3>Jani</from3>", 7<from3>Jani</from3>",
7"e")8 <opt:options>
9 <opt:parse-external-parsed-entity/>
10 </opt:options>
11)
8return <fragment>{ $var }<count>{ count($var) }</count></fragment>12return <fragment>{ $var }<count>{ count($var) }</count></fragment>
9\ No newline at end of file13\ No newline at end of file
1014
=== modified file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-13.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-13.xq 2011-07-12 17:24:41 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-13.xq 2012-02-03 22:18:21 +0000
@@ -1,4 +1,10 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
23
3for $var in z:parse-xml-fragment("<from1>Jani</from1><from2>Jani</from2><from3>Jani</from3>", "urn:foo", "e")4for $var in z:parse("<from1>Jani</from1><from2>Jani</from2><from3>Jani</from3>",
5 <opt:options>
6 <opt:base-uri opt:value="urn:foo"/>
7 <opt:parse-external-parsed-entity/>
8 </opt:options>
9)
4return <fragment base="{fn:base-uri($var)}">{ $var }</fragment>10return <fragment base="{fn:base-uri($var)}">{ $var }</fragment>
511
=== modified file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-14.xq' (properties changed: +x to -x)
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-14.xq 2011-07-15 16:39:51 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-14.xq 2012-02-03 22:18:21 +0000
@@ -1,6 +1,7 @@
1import module namespace x = "http://www.zorba-xquery.com/modules/xml";1import module namespace x = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
23
3x:parse-xml-fragment("<?xml version='1.0' encoding='UTF-8'?>4x:parse("<?xml version='1.0' encoding='UTF-8'?>
4<!-- Comment-1 -->5<!-- Comment-1 -->
5<?a-pi pi-1?>6<?a-pi pi-1?>
6<!-- Comment-2 -->7<!-- Comment-2 -->
@@ -37,4 +38,7 @@
37<?a-pi pi-6?>38<?a-pi pi-6?>
38<!-- Comment-7 -->39<!-- Comment-7 -->
39",40",
40"e")41 <opt:options>
42 <opt:parse-external-parsed-entity/>
43 </opt:options>
44)
4145
=== modified file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-15.xq' (properties changed: +x to -x)
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-15.xq 2011-07-15 16:39:51 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-15.xq 2012-02-03 22:18:21 +0000
@@ -1,3 +1,9 @@
1import module namespace x = "http://www.zorba-xquery.com/modules/xml";1import module namespace x = "http://www.zorba-xquery.com/modules/xml";
22import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3x:parse-xml-fragment("<a/>", "e")3
4x:parse("<a/>",
5 <opt:options>
6 <opt:parse-external-parsed-entity/>
7 </opt:options>
8)
9
410
=== removed file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-16.spec'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-16.spec 2011-08-10 02:50:23 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-16.spec 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
1Error: http://www.zorba-xquery.com/errors:ZXQD0003
20
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-16.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-16.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-16.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,14 @@
1import module namespace x = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4x:parse("<?xml version='1.0'?>
5<!DOCTYPE note [
6<!ELEMENT note (#PCDATA)>
7<!ATTLIST note nmt NMTOKENS #REQUIRED>
8]>
9<note nmt='aaa'/>
10",
11 <opt:options>
12 <opt:DTD-validate/>
13 </opt:options>
14)
015
=== removed file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-16.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-16.xq 2011-08-10 02:50:23 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-16.xq 1970-01-01 00:00:00 +0000
@@ -1,8 +0,0 @@
1import module namespace x = "http://www.zorba-xquery.com/modules/xml";
2
3x:parse-xml-fragment("<?xml version='1.0'?>
4<from1>Jani</from1>
5<from2>Jani</from2>
6<from3>Jani</from3>
7",
8"eEdDsSlLwWfF")
90
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-17.spec'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-17.spec 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-17.spec 2012-02-03 22:18:21 +0000
@@ -0,0 +1,1 @@
1Error: http://www.w3.org/2005/xqt-errors:FODC0006
02
=== removed file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-17.spec'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-17.spec 2011-08-10 02:50:23 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-17.spec 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
1Error: http://www.zorba-xquery.com/errors:ZXQD0003
20
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-17.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-17.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-17.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,18 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<root><a id='0'>
5 0
6 </b>
7</a>
8<a id='1'>
9 1
10</a>
11<a id='2'>
12 2
13</a>
14</root>",
15 <opt:options>
16 <opt:parse-external-parsed-entity/>
17 </opt:options>
18)
019
=== removed file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-17.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-17.xq 2011-08-10 02:50:23 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-17.xq 1970-01-01 00:00:00 +0000
@@ -1,8 +0,0 @@
1import module namespace x = "http://www.zorba-xquery.com/modules/xml";
2
3x:parse-xml-fragment("<?xml version='1.0'?>
4<from1>Jani</from1>
5<from2>Jani</from2>
6<from3>Jani</from3>
7",
8"edls")
90
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-18.spec'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-18.spec 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-18.spec 2012-02-03 22:18:21 +0000
@@ -0,0 +1,1 @@
1Error: http://www.w3.org/2005/xqt-errors:FODC0006
02
=== added file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-18.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-18.xq 1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-18.xq 2012-02-03 22:18:21 +0000
@@ -0,0 +1,8 @@
1import module namespace z = "http://www.zorba-xquery.com/modules/xml";
2import schema namespace opt = "http://www.zorba-xquery.com/modules/xml-options";
3
4z:parse("<root><a id='0'/></root></test>",
5 <opt:options>
6 <opt:parse-external-parsed-entity/>
7 </opt:options>
8)
09
=== removed file 'test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-18.xq'
--- test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-18.xq 2011-10-12 07:17:05 +0000
+++ test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-18.xq 1970-01-01 00:00:00 +0000
@@ -1,10 +0,0 @@
1import module namespace x = "http://www.zorba-xquery.com/modules/xml";
2
3x:parse-xml-fragment("<?xml version='1.0'?>
4<!DOCTYPE note [
5<!ELEMENT note (#PCDATA)>
6<!ATTLIST note nmt NMTOKENS #REQUIRED>
7]>
8<note nmt='aaa'/>
9",
10"d")
110
=== modified file 'test/rbkt/Queries/zorba/parsing_and_serializing/weather.xsd' (properties changed: +x to -x)

Subscribers

People subscribed via source and target branches