Merge lp:~zorba-coders/zorba/bug1132937 into lp:zorba

Proposed by Rodolfo Ochoa
Status: Superseded
Proposed branch: lp:~zorba-coders/zorba/bug1132937
Merge into: lp:zorba
Diff against target: 6458 lines (+1674/-3087)
103 files modified
doc/php/examples/CMakeLists.txt (+15/-14)
doc/php/examples/php.ini.in (+1/-1)
doc/php/examples/simple.php.in (+1/-1)
doc/php/examples/test.php.in (+1/-1)
doc/php/examples/zorba_api.php (+0/-178)
include/zorba/internal/diagnostic.h (+2/-3)
include/zorba/xquery_exception.h (+2/-2)
src/diagnostics/diagnostic.cpp (+4/-0)
src/precompiled/stdafx.h (+0/-1)
src/unit_tests/test_mem_sizeof.cpp (+1/-0)
swig/Config.h (+0/-1)
swig/DiagnosticHandler.i (+2/-2)
swig/DynamicContext.h (+5/-5)
swig/DynamicContext.i (+2/-2)
swig/Exceptions.i (+3/-3)
swig/Item.h (+2/-2)
swig/Item.i (+2/-2)
swig/ItemFactory.h (+112/-66)
swig/ItemFactory.i (+132/-78)
swig/StaticContext.i (+4/-4)
swig/TypeIdentifier.i (+3/-3)
swig/ZorbaStreamBuffer.i (+1/-1)
swig/csharp/tests/CMakeLists.txt (+2/-0)
swig/csharp/tests/satellites.json (+17/-0)
swig/csharp/tests/test01.cs (+0/-2)
swig/csharp/tests/test09.cs (+95/-0)
swig/csharp/tests/test10.cs (+86/-0)
swig/java/CMakeLists.txt (+12/-12)
swig/php/CMakeLists.txt (+20/-9)
swig/php/XQueryProcessor.php (+1/-1)
swig/php/postfix.cmake (+8/-0)
swig/php/tests/CMakeLists.txt (+24/-64)
swig/php/tests/php.ini.in (+1/-1)
swig/php/tests/satellites.json (+17/-0)
swig/php/tests/test01.php (+1/-1)
swig/php/tests/test02.php (+1/-1)
swig/php/tests/test03.php (+0/-48)
swig/php/tests/test03.php.disabled (+52/-0)
swig/php/tests/test04.php (+1/-1)
swig/php/tests/test05.php (+1/-1)
swig/php/tests/test06.php (+1/-1)
swig/php/tests/test07.php (+1/-1)
swig/php/tests/test08.php (+1/-1)
swig/php/tests/test09.php (+22/-59)
swig/php/tests/test10.php (+41/-29)
swig/php/tests/test11.php (+25/-14)
swig/php/tests/test12.php (+0/-52)
swig/php/tests/test13.php (+0/-53)
swig/php/tests/test14.php (+0/-53)
swig/php/tests/zorba_api.php (+0/-178)
swig/php/zorba_api.i (+8/-0)
swig/php/zorba_api_wrapper.php (+0/-1215)
swig/python/tests/CMakeLists.txt (+26/-25)
swig/python/tests/books.xml (+11/-0)
swig/python/tests/books.xml.in (+0/-11)
swig/python/tests/compilerHints.xq (+4/-0)
swig/python/tests/compilerHints.xq.in (+0/-4)
swig/python/tests/satellites.json (+17/-0)
swig/python/tests/test01.py (+26/-0)
swig/python/tests/test01.py.in (+0/-26)
swig/python/tests/test02.py (+41/-0)
swig/python/tests/test02.py.in (+0/-41)
swig/python/tests/test03.py (+43/-0)
swig/python/tests/test03.py.in (+0/-43)
swig/python/tests/test04.py (+42/-0)
swig/python/tests/test04.py.in (+0/-42)
swig/python/tests/test04.xq (+4/-0)
swig/python/tests/test04.xq.in (+0/-4)
swig/python/tests/test05.py (+42/-0)
swig/python/tests/test05.py.in (+0/-42)
swig/python/tests/test05.xq (+7/-0)
swig/python/tests/test05.xq.in (+0/-7)
swig/python/tests/test06.py (+42/-0)
swig/python/tests/test06.py.in (+0/-42)
swig/python/tests/test06.xq (+7/-0)
swig/python/tests/test06.xq.in (+0/-7)
swig/python/tests/test07.1.py (+54/-0)
swig/python/tests/test07.1.py.in (+0/-54)
swig/python/tests/test07.2.py (+81/-0)
swig/python/tests/test07.2.py.in (+0/-81)
swig/python/tests/test08.py (+112/-0)
swig/python/tests/test08.py.in (+0/-112)
swig/python/tests/test10.py (+51/-0)
swig/python/tests/test10.py.in (+0/-51)
swig/python/tests/test11.py (+42/-0)
swig/python/tests/test11.py.in (+0/-42)
swig/python/tests/test12.py (+51/-0)
swig/python/tests/test12.py.in (+0/-49)
swig/python/tests/test13.py (+43/-0)
swig/python/tests/test13.py.in (+0/-50)
swig/python/tests/test14.py (+50/-0)
swig/python/tests/test14.py.in (+0/-50)
swig/ruby/tests/CMakeLists.txt (+7/-6)
swig/ruby/tests/satellites.json (+17/-0)
swig/ruby/tests/test12.rb (+37/-34)
swig/ruby/tests/test13.rb (+25/-34)
swig/ruby/tests/test14.rb (+26/-33)
swig/ruby/zorba_api.i (+4/-1)
swig/xqj/CMakeLists.txt (+2/-2)
swig/xqj/ZorbaXQDataSource.java (+2/-2)
swig/xqj/ZorbaXQSequenceType.java (+6/-6)
swig/xqj/ZorbaXQStaticCollectionManager.java (+3/-3)
swig/zorba_api.i (+16/-16)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug1132937
Reviewer Review Type Date Requested Status
Rodolfo Ochoa Pending
Review via email: mp+155478@code.launchpad.net

Commit message

Fixes for API

Description of the change

Fixes for API

To post a comment you must log in.
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

The attempt to merge lp:~zorba-coders/zorba/bug1132937 into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:275 (message):
  Validation queue job bug1132937-2013-03-26T12-57-14.27Z is finished. The
  final status was:

  No tests were run - build or configure step must have failed.

  Not commiting changes.

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

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

The attempt to merge lp:~zorba-coders/zorba/bug1132937 into lp:zorba failed. Below is the output from the failed tests.

CMake Error at /home/ceej/zo/testing/zorbatest/tester/TarmacLander.cmake:275 (message):
  Validation queue job bug1132937-2013-03-26T23-29-14.147Z is finished. The
  final status was:

  14 tests did not succeed - changes not commited.

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

lp:~zorba-coders/zorba/bug1132937 updated
11281. By Rodolfo Ochoa

Fixes for PHP in linux

11282. By Rodolfo Ochoa

Merge from trunk

11283. By Rodolfo Ochoa

Merge from xsDateTimeStamp

11284. By Rodolfo Ochoa

- Added DateTimeStamp to the API
- Fix for DocumentType in TypeIdentifier class
- Warning Fix

11285. By Rodolfo Ochoa

merge from .../bug924756-xsDateTimeStamp

11286. By Rodolfo Ochoa

Relocating createDateTimeStamp

11287. By Rodolfo Ochoa

Fix - typo moving methods

11288. By Rodolfo Ochoa

Fixes for older versions of PHP

11289. By Rodolfo Ochoa

More fixes for weird errors

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'doc/php/examples/CMakeLists.txt'
2--- doc/php/examples/CMakeLists.txt 2013-02-07 17:24:36 +0000
3+++ doc/php/examples/CMakeLists.txt 2013-03-27 00:40:33 +0000
4@@ -14,30 +14,31 @@
5
6 IF(PHP5_FOUND)
7
8- MESSAGE(STATUS "PHP Found and Active!")
9-
10+ MESSAGE(STATUS "PHP Found, installing examples...")
11+
12 SET(phpPath ${CMAKE_BINARY_DIR}/swig/php)
13- MESSAGE(STATUS "PHP Path:" ${phpPath})
14 IF (MSVC_IDE)
15 SET(phpExtensionPath ${CMAKE_BINARY_DIR}/swig/php/@CMAKE_BUILD_TYPE@)
16 ELSE (MSVC_IDE)
17 SET(phpExtensionPath ${CMAKE_BINARY_DIR}/swig/php)
18 ENDIF (MSVC_IDE)
19- MESSAGE(STATUS "PHP Extension Path: " ${phpExtensionPath})
20- SET(phpIncludePath ${CMAKE_BINARY_DIR}/swig/php)
21- MESSAGE(STATUS "PHP Include Path: " ${phpExtensionPath})
22+ SET(phpIncludePath ${CMAKE_BINARY_DIR}/swig/php/Zorba)
23+
24+ IF (WIN32)
25+ STRING(REGEX REPLACE "/" "\\\\" phpExtensionPath "${phpExtensionPath}")
26+ STRING(REGEX REPLACE "/" "\\\\" phpPath "${phpPath}")
27+ STRING(REGEX REPLACE "/" "\\\\" phpIncludePath "${phpIncludePath}")
28+ ENDIF (WIN32)
29+
30 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/php.ini.in ${CMAKE_CURRENT_BINARY_DIR}/php.ini)
31- MESSAGE(STATUS "Configuration file: " ${CMAKE_CURRENT_BINARY_DIR}/php.ini)
32 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/simple.php.in ${CMAKE_CURRENT_BINARY_DIR}/simple.php)
33- MESSAGE(STATUS "Simple configuration file: " ${CMAKE_CURRENT_BINARY_DIR}/simple.php)
34 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test.php.in ${CMAKE_CURRENT_BINARY_DIR}/test.php)
35- MESSAGE(STATUS "PHP test file configured: " ${CMAKE_CURRENT_BINARY_DIR}/test.php)
36- ADD_TEST("php1" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/simple.php)
37- MESSAGE(STATUS "Installing: " ${CMAKE_CURRENT_BINARY_DIR}/simple.php)
38+
39+ IF (NOT WIN32) #Disabled, on windows there is a bug in php - Segfault within Try..Catch
40+ ADD_TEST("php1" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/simple.php)
41+ ENDIF (NOT WIN32)
42+
43 ADD_TEST("php2" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/test.php)
44-
45- MESSAGE(STATUS "Installing: " ${CMAKE_CURRENT_BINARY_DIR}/test.php)
46-
47
48 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/simple.php ${CMAKE_CURRENT_BINARY_DIR}/test.php
49 COMPONENT "php_examples"
50
51=== modified file 'doc/php/examples/php.ini.in'
52--- doc/php/examples/php.ini.in 2013-02-07 17:24:36 +0000
53+++ doc/php/examples/php.ini.in 2013-03-27 00:40:33 +0000
54@@ -1,3 +1,3 @@
55 enable_dl=On
56 extension_dir=@phpExtensionPath@
57-include_path=".:@phpIncludePath@"
58\ No newline at end of file
59+include_path="@phpIncludePath@"
60\ No newline at end of file
61
62=== modified file 'doc/php/examples/simple.php.in'
63--- doc/php/examples/simple.php.in 2013-02-07 17:24:36 +0000
64+++ doc/php/examples/simple.php.in 2013-03-27 00:40:33 +0000
65@@ -14,7 +14,7 @@
66 * See the License for the specific language governing permissions and
67 * limitations under the License.
68 */
69-require '@phpPath@/Zorba/zorba_api_wrapper.php';
70+require 'zorba_api_wrapper.php';
71
72 function example_1(Zorba $aZorba)
73 {
74
75=== modified file 'doc/php/examples/test.php.in'
76--- doc/php/examples/test.php.in 2012-01-18 08:31:25 +0000
77+++ doc/php/examples/test.php.in 2013-03-27 00:40:33 +0000
78@@ -14,7 +14,7 @@
79 * See the License for the specific language governing permissions and
80 * limitations under the License.
81 */
82-require '@phpPath@/Zorba/XQueryProcessor.php';
83+require 'XQueryProcessor.php';
84
85 function omitXMLDecl($xml)
86 {
87
88=== removed file 'doc/php/examples/zorba_api.php'
89--- doc/php/examples/zorba_api.php 2013-02-07 17:24:36 +0000
90+++ doc/php/examples/zorba_api.php 1970-01-01 00:00:00 +0000
91@@ -1,178 +0,0 @@
92-<?php
93-/*
94- * Copyright 2006-2012 The FLWOR Foundation.
95- *
96- * Licensed under the Apache License, Version 2.0 (the "License");
97- * you may not use this file except in compliance with the License.
98- * You may obtain a copy of the License at
99- *
100- * http://www.apache.org/licenses/LICENSE-2.0
101- *
102- * Unless required by applicable law or agreed to in writing, software
103- * distributed under the License is distributed on an "AS IS" BASIS,
104- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
105- * See the License for the specific language governing permissions and
106- * limitations under the License.
107- */
108-
109-// Try to load our extension if it's not already loaded.
110-if (!extension_loaded("zorba_api")) {
111- if (strtolower(substr(PHP_OS, 0, 3)) === 'win') {
112- if (!dl('zorba_api.dll')) return;
113- } else {
114- // PHP_SHLIB_SUFFIX is available as of PHP 4.3.0, for older PHP assume 'so'.
115- // It gives 'dylib' on MacOS X which is for libraries, modules are 'so'.
116- if (PHP_SHLIB_SUFFIX === 'PHP_SHLIB_SUFFIX' || PHP_SHLIB_SUFFIX === 'dylib') {
117- if (!dl('zorba_api.so')) return;
118- } else {
119- if (!dl('zorba_api.'.PHP_SHLIB_SUFFIX)) return;
120- }
121- }
122-}
123-
124-class Item {
125- public $_cPtr=null;
126-
127- static function createEmptyItem() {
128- $r=Item_createEmptyItem();
129- return is_resource($r) ? new Item($r) : $r;
130- }
131-
132- function getStringValue() {
133- return Item_getStringValue($this->_cPtr);
134- }
135-
136- function __construct() {
137- $this->_cPtr=new_Item();
138- }
139-}
140-
141-class Iterator {
142- public $_cPtr=null;
143-
144- function open() {
145- Iterator_open($this->_cPtr);
146- }
147-
148- function next($arg1) {
149- return Iterator_next($this->_cPtr,$arg1);
150- }
151-
152- function close() {
153- Iterator_close($this->_cPtr);
154- }
155-
156- function destroy() {
157- Iterator_destroy($this->_cPtr);
158- }
159-
160- function __construct($cPtr) {
161- $this->_cPtr=$cPtr;
162- }
163-
164- public function __destruct() {
165- $this->destroy();
166- }
167-}
168-
169-class XQuery {
170- public $_cPtr=null;
171-
172- function execute() {
173- return XQuery_execute($this->_cPtr);
174- }
175-
176- function isUpdateQuery() {
177- return XQuery_isUpdateQuery($this->_cPtr);
178- }
179-
180- function applyUpdates() {
181- XQuery_applyUpdates($this->_cPtr);
182- }
183-
184- function destroy() {
185- XQuery_destroy($this->_cPtr);
186- }
187-
188- function iterator() {
189- $r=XQuery_iterator($this->_cPtr);
190- return is_resource($r) ? new Iterator($r) : $r;
191- }
192-
193- function __construct($cPtr) {
194- $this->_cPtr=$cPtr;
195- }
196-
197- function __destruct() {
198- $this->destroy();
199- }
200-}
201-
202-class Store {
203- //public $_cPtr=null;
204-
205- //function __construct() {
206- // $this->_cPtr=new_Store();
207- //}
208-}
209-
210-class InMemoryStore extends Store {
211- public $_cPtr=null;
212-
213- static function getInstance() {
214- $r=InMemoryStore_getInstance();
215- return is_resource($r) ? new InMemoryStore($r) : $r;
216- }
217-
218- static function shutdown($arg1) {
219- InMemoryStore_shutdown($arg1);
220- }
221-
222- private function __construct($cPtr) {
223- $this->_cPtr=$cPtr;
224- }
225-}
226-
227-class XmlDataManager {
228- public $_cPtr=null;
229-
230- function loadDocument($aName,$aContent) {
231- XmlDataManager_loadDocument($this->_cPtr,$aName,$aContent);
232- }
233-
234- function deleteDocument($aName) {
235- return XmlDataManager_deleteDocument($this->_cPtr,$aName);
236- }
237-
238- function __construct($cPtr) {
239- $this->_cPtr=$cPtr;
240- }
241-}
242-
243-class Zorba {
244- public $_cPtr=null;
245-
246- static function getInstance($arg1) {
247- $r=Zorba_getInstance($arg1->_cPtr);
248- return is_resource($r) ? new Zorba($r) : $r;
249- }
250-
251- function compileQuery($aStr) {
252- $r=Zorba_compileQuery($this->_cPtr,$aStr);
253- return is_resource($r) ? new XQuery($r) : $r;
254- }
255-
256- function getXmlDataManager() {
257- $r=Zorba_getXmlDataManager($this->_cPtr);
258- return is_resource($r) ? new XmlDataManager($r) : $r;
259- }
260-
261- function shutdown() {
262- Zorba_shutdown($this->_cPtr);
263- }
264-
265- private function __construct($cPtr) {
266- $this->_cPtr=$cPtr;
267- }
268-}
269-?>
270
271=== modified file 'include/zorba/internal/diagnostic.h'
272--- include/zorba/internal/diagnostic.h 2013-02-26 04:12:43 +0000
273+++ include/zorba/internal/diagnostic.h 2013-03-27 00:40:33 +0000
274@@ -201,6 +201,7 @@
275 column_type column_end_;
276
277 friend bool operator==( location const&, location const& );
278+ friend bool operator!=( location const&, location const& );
279
280 // for plan serialization
281 friend void serialization::operator&( serialization::Archiver&, location& );
282@@ -224,9 +225,7 @@
283 * @param j The second location.
284 * @return Returns \c true only if the two locations are not equal.
285 */
286-inline bool operator!=( location const &i, location const &j ) {
287- return !(i == j);
288-}
289+bool operator!=( location const &i, location const &j );
290
291 ///////////////////////////////////////////////////////////////////////////////
292
293
294=== modified file 'include/zorba/xquery_exception.h'
295--- include/zorba/xquery_exception.h 2013-02-26 04:12:43 +0000
296+++ include/zorba/xquery_exception.h 2013-03-27 00:40:33 +0000
297@@ -295,7 +295,7 @@
298 * @return Returns \a true only if stack traces will be included.
299 */
300 static bool get_print_trace( std::ostream &o ) {
301- return static_cast<print_trace>( o.iword( get_ios_trace_index() ) );
302+ return !!( o.iword( get_ios_trace_index() ) );
303 }
304
305 /**
306@@ -404,7 +404,7 @@
307 */
308 inline std::ostream& operator<<( std::ostream &o,
309 XQueryException::print_trace t ) {
310- XQueryException::set_print_trace( o, t );
311+ XQueryException::set_print_trace( o, !!t );
312 return o;
313 }
314
315
316=== modified file 'src/diagnostics/diagnostic.cpp'
317--- src/diagnostics/diagnostic.cpp 2013-02-26 04:12:43 +0000
318+++ src/diagnostics/diagnostic.cpp 2013-03-27 00:40:33 +0000
319@@ -177,6 +177,10 @@
320
321 location const location::empty;
322
323+bool operator!=( location const &i, location const &j ) {
324+ return !(i == j);
325+}
326+
327 bool operator==( location const &i, location const &j ) {
328 return i.file_ == j.file_
329 && i.line_ == j.line_
330
331=== modified file 'src/precompiled/stdafx.h'
332--- src/precompiled/stdafx.h 2013-02-07 17:24:36 +0000
333+++ src/precompiled/stdafx.h 2013-03-27 00:40:33 +0000
334@@ -44,7 +44,6 @@
335 #include "compiler/parser/parse_constants.h"
336 #include "zorbautils/checked_vector.h"
337 #include "compiler/parser/xquery_driver.h"
338- #include "util/sorter.h"
339 #include "compiler/xqueryx/xqueryx_to_xquery.h"
340 #include <zorba/store_manager.h>
341 #include <zorba/xquery.h>
342
343=== modified file 'src/unit_tests/test_mem_sizeof.cpp'
344--- src/unit_tests/test_mem_sizeof.cpp 2013-02-05 04:00:09 +0000
345+++ src/unit_tests/test_mem_sizeof.cpp 2013-03-27 00:40:33 +0000
346@@ -14,6 +14,7 @@
347 * limitations under the License.
348 */
349
350+#include "stdafx.h"
351 #include <iostream>
352 #include <string>
353
354
355=== modified file 'swig/Config.h'
356--- swig/Config.h 2012-08-06 22:08:44 +0000
357+++ swig/Config.h 2013-03-27 00:40:33 +0000
358@@ -18,5 +18,4 @@
359
360 #define ZORBA_STREAM_BUFFER_SIZE @ZORBA_STREAM_BUFFER_SIZE@
361
362-
363 #endif
364\ No newline at end of file
365
366=== modified file 'swig/DiagnosticHandler.i'
367--- swig/DiagnosticHandler.i 2013-02-07 17:24:36 +0000
368+++ swig/DiagnosticHandler.i 2013-03-27 00:40:33 +0000
369@@ -20,11 +20,11 @@
370
371 void DiagnosticHandler::error (const zorba::ZorbaException &ze)
372 {
373- if ( zorba::XQueryException const *xe = dynamic_cast<zorba::XQueryException const*>( &ze ) ) {
374+ if (zorba::XQueryException const *xe = dynamic_cast<zorba::XQueryException const*>( &ze )) {
375 const XQueryException xe2(xe);
376 error(xe2);
377 }
378- if ( zorba::UserException const *ue = dynamic_cast<zorba::UserException const*>( &ze ) ) {
379+ if (zorba::UserException const *ue = dynamic_cast<zorba::UserException const*>( &ze )) {
380 const UserException ue2(ue);
381 error(ue2);
382 }
383
384=== modified file 'swig/DynamicContext.h'
385--- swig/DynamicContext.h 2013-02-07 17:24:36 +0000
386+++ swig/DynamicContext.h 2013-03-27 00:40:33 +0000
387@@ -36,14 +36,14 @@
388 DynamicContext(const DynamicContext& aCtx):theContext(aCtx.theContext) {}
389 DynamicContext(zorba::DynamicContext* aCtx):theContext(aCtx) {}
390
391- bool getContextItem (Item& aItem);
392+ bool getContextItem (Item& aItem);
393
394 /** \brief Retrieve the dateTime Item used at the time the query is executed
395 * (see setCurrentDateTime()).
396 *
397 * @return Item the dateTime Item used at the time the query is executed.
398 */
399- Item getCurrentDateTime ();
400+ Item getCurrentDateTime ();
401
402 /** \brief Return the value of the default collection that is used when calling the
403 * fn:collection function without a parameter.
404@@ -51,7 +51,7 @@
405 * @return Item the default collection that is set in this dynamic context.
406 * @throw ZorbaException if an error occured.
407 */
408- Item getDefaultCollection ();
409+ Item getDefaultCollection ();
410
411 /** \brief Retrieve the implicit timezone used in comparisons or arithmetic operations
412 * of date, time, or dateTime values.
413@@ -60,7 +60,7 @@
414 * and an DiagnosticHandler is used.
415 * @throw ZorbaException if an error occured.
416 */
417- int getImplicitTimezone ();
418+ int getImplicitTimezone ();
419
420 /** \brief Returns the current value of an external
421 * variable. Exactly one of the two return values (aItem or
422@@ -78,7 +78,7 @@
423 * @return true if the variable has been retrieved successfully, false otherwise.
424 * @throw ZorbaException if an error occured.
425 */
426- bool getVariable (const std::string& aNamespace, const std::string& aLocalname, Item& aItem, Iterator& aIterator);
427+ bool getVariable (const std::string& aNamespace, const std::string& aLocalname, Item& aItem, Iterator& aIterator);
428
429 /** \brief Defines the context item.
430 *
431
432=== modified file 'swig/DynamicContext.i'
433--- swig/DynamicContext.i 2013-02-07 17:24:36 +0000
434+++ swig/DynamicContext.i 2013-03-27 00:40:33 +0000
435@@ -25,10 +25,10 @@
436 Item DynamicContext::getDefaultCollection () {
437 return Item(theContext->getDefaultCollection());
438 }
439- int DynamicContext::getImplicitTimezone (){
440+ int DynamicContext::getImplicitTimezone (){
441 return theContext->getImplicitTimezone();
442 }
443- bool DynamicContext::getVariable (const std::string& aNamespace, const std::string& aLocalname, Item& aItem, Iterator& aIterator) {
444+ bool DynamicContext::getVariable (const std::string& aNamespace, const std::string& aLocalname, Item& aItem, Iterator& aIterator) {
445 return theContext->getVariable(aNamespace, aLocalname, aItem.theItem, aIterator.theIterator);
446 }
447
448
449=== modified file 'swig/Exceptions.i'
450--- swig/Exceptions.i 2013-02-07 17:24:36 +0000
451+++ swig/Exceptions.i 2013-03-27 00:40:33 +0000
452@@ -115,9 +115,9 @@
453 private:
454 XQueryException();
455 public:
456- virtual unsigned int getColumnBegin () const;
457- virtual unsigned int getLineBegin () const;
458- virtual std::string getQueryURI () const;
459+ virtual unsigned int getColumnBegin () const;
460+ virtual unsigned int getLineBegin () const;
461+ virtual std::string getQueryURI () const;
462 };
463
464 /* vim:set et sw=2 ts=2: */
465
466=== modified file 'swig/Item.h'
467--- swig/Item.h 2013-02-07 17:24:36 +0000
468+++ swig/Item.h 2013-03-27 00:40:33 +0000
469@@ -159,7 +159,7 @@
470 * @return Item the int value of the Item.
471 * @throw ZorbaException if an error occured.
472 */
473- double getDoubleValue () const;
474+ double getDoubleValue () const;
475
476 /** \brief Get the long value of the Item.
477 *
478@@ -211,7 +211,7 @@
479 * @return element or document parent node of this node.
480 * @throw ZorbaException if an error occured, e.g. the Item is not of type node.
481 */
482- Item getParent () const;
483+ Item getParent () const;
484
485 /** \brief Get the (optional) value of a QName's prefix.
486 *
487
488=== modified file 'swig/Item.i'
489--- swig/Item.i 2013-02-07 17:24:36 +0000
490+++ swig/Item.i 2013-03-27 00:40:33 +0000
491@@ -60,7 +60,7 @@
492 int Item::getIntValue () const
493 { return theItem.getIntValue(); }
494
495- double Item::getDoubleValue () const
496+ double Item::getDoubleValue () const
497 { return theItem.getDoubleValue(); }
498
499 long long Item::getLongValue () const
500@@ -89,7 +89,7 @@
501 bool Item::getNodeName (Item &aNodeName) const
502 { return theItem.getNodeName( aNodeName.theItem ); }
503
504- Item Item::getParent () const
505+ Item Item::getParent () const
506 { return theItem.getParent(); }
507
508 std::string Item::getPrefix () const
509
510=== modified file 'swig/ItemFactory.h'
511--- swig/ItemFactory.h 2013-02-07 17:24:36 +0000
512+++ swig/ItemFactory.h 2013-03-27 00:40:33 +0000
513@@ -40,7 +40,7 @@
514 * @param aURI String representation of the AnyURI.
515 * @return The AnyURI Item.
516 */
517- Item createAnyURI (const std::string &aURI);
518+ Item createAnyURI (const std::string &aURI);
519
520 /**
521 * Create a new attribute node N and place it among the
522@@ -57,10 +57,9 @@
523 * @param aTypedValue The typed value of the new node.
524 * @return The new node N created by this method
525 */
526- Item createAttributeNode (Item& aParent, Item& aNodeName, Item& aTypeName, Item& aTypedValue);
527-#ifndef SWIGRUBY
528- Item createAttributeNode (Item& aParent, Item& aNodeName, Item& aTypeName, std::vector< Item > aTypedValue);
529-#endif
530+ Item createAttributeNode (Item& aParent, Item& aNodeName, Item& aTypeName, Item& aTypedValue);
531+
532+ Item createAttributeNode (Item& aParent, Item& aNodeName, Item& aTypeName, std::vector< Item > aTypedValue);
533
534 /** \brief Creates a Base64Binary Item
535 * see [http://www.w3.org/TR/xmlschema-2/#base64Binary]
536@@ -69,7 +68,7 @@
537 * @param aLength the length of the base64 binary data.
538 * @return The Base64Binary Item.
539 */
540- Item createBase64Binary (const char *aBinData, size_t aLength);
541+ Item createBase64Binary (const char *aBinData, size_t aLength);
542
543 /** \brief Creates a Base64Binary Item
544 * see [http://www.w3.org/TR/xmlschema-2/#base64Binary]
545@@ -77,7 +76,7 @@
546 * @param aStream A stream containing the Base64 encoded data.
547 * @return the Base64Binary Item.
548 */
549- Item createBase64Binary (std::istream &aStream);
550+ Item createBase64Binary (std::istream &aStream);
551
552 /** \brief Creates a Base64Binary Item
553 * see [http://www.w3.org/TR/xmlschema-2/#base64Binary]
554@@ -86,7 +85,7 @@
555 * @param aLength the length of the data
556 * @return the Base64Binary Item.
557 */
558- Item createBase64Binary (const unsigned char *aBinData, size_t aLength);
559+ Item createBase64Binary (const unsigned char *aBinData, size_t aLength);
560
561 /** \brief Creates a Boolean Item
562 * see [http://www.w3.org/TR/xmlschema-2/#bool]
563@@ -94,7 +93,7 @@
564 * @param aValue bool representation of the Boolean.
565 * @return The Boolean Item.
566 */
567- Item createBoolean (bool aValue);
568+ Item createBoolean (bool aValue);
569
570 /** \brief Creates a Byte Item
571 * see [http://www.w3.org/TR/xmlschema-2/#byte]
572@@ -102,7 +101,7 @@
573 * @param aByte char representation of the Byte.
574 * @return The Byte Item.
575 */
576- Item createByte (char aByte);
577+ Item createByte (char aByte);
578
579 /**
580 * Create a new comment node N and place it as the last child of a given
581@@ -113,7 +112,7 @@
582 * @param aContent The content of the new node.
583 * @return The new node N created by this method
584 */
585- Item createCommentNode (Item &aParent, const std::string &aContent);
586+ Item createCommentNode (Item &aParent, const std::string &aContent);
587
588 /** \brief Creates a Date Item
589 * see [http://www.w3.org/TR/xmlschema-2/#date]
590@@ -121,7 +120,7 @@
591 * @param aDate String representation of the Date (e.g. 2002-10-10).
592 * @return The Date Item.
593 */
594- Item createDate (const std::string &aDate);
595+ Item createDate (const std::string &aDate);
596
597 /** \brief Creates a Date Item
598 * see [http://www.w3.org/TR/xmlschema-2/#date]
599@@ -131,7 +130,7 @@
600 * @param aDay short-valued representation of the day.
601 * @return The Date Item.
602 */
603- Item createDate (short aYear, short aMonth, short aDay);
604+ Item createDate (short aYear, short aMonth, short aDay);
605
606 /** \brief Creates a DateTime Item
607 * see [http://www.w3.org/TR/xmlschema-2/#dateTime]
608@@ -140,7 +139,7 @@
609 * (for example, 2002-10-10T12:00:00-05:00).
610 * @return The DateTime Item.
611 */
612- Item createDateTime (const std::string &aDateTimeValue);
613+ Item createDateTime (const std::string &aDateTimeValue);
614
615 /** \brief Creates a DateTime Item
616 * see [http://www.w3.org/TR/xmlschema-2/#dateTime]
617@@ -154,7 +153,7 @@
618 * @param aTimeZone_hours short-valued representation of the difference in hours to UTC.
619 * @return The DateTime Item.
620 */
621- Item createDateTime (short aYear, short aMonth, short aDay, short aHour, short aMinute, double aSecond, short aTimeZone_hours);
622+ Item createDateTime (short aYear, short aMonth, short aDay, short aHour, short aMinute, double aSecond, short aTimeZone_hours);
623
624 /** \brief Creates a Decimal Item
625 * see [http://www.w3.org/TR/xmlschema-2/#decimal]
626@@ -162,7 +161,7 @@
627 * @param aValue String representation of the Decimal (e.g. 12678967.543233).
628 * @return The Decimal Item.
629 */
630- Item createDecimal (const std::string &aValue);
631+ Item createDecimal (const std::string &aValue);
632
633 /** \brief Creates a Decimal Item
634 * see [http://www.w3.org/TR/xmlschema-2/#decimal]
635@@ -170,7 +169,7 @@
636 * @param aValue double representation of the Decimal.
637 * @return The Decimal Item.
638 */
639- Item createDecimalFromDouble (double aValue);
640+ Item createDecimalFromDouble (double aValue);
641
642 /** \brief Creates a Decimal Item
643 * see [http://www.w3.org/TR/xmlschema-2/#decimal]
644@@ -178,7 +177,7 @@
645 * @param aValue unsigned long representation of the Decimal.
646 * @return The Decimal Item.
647 */
648- Item createDecimalFromLong (unsigned long aValue);
649+ Item createDecimalFromLong (unsigned long aValue);
650
651 /** \brief Creates a Double Item
652 * see [http://www.w3.org/TR/xmlschema-2/#double]
653@@ -186,7 +185,7 @@
654 * @param aValue String representation of the Double.
655 * @return The Double Item.
656 */
657- Item createDouble (const std::string &aValue);
658+ Item createDouble (const std::string &aValue);
659
660 /** \brief Creates a Double Item
661 * see [http://www.w3.org/TR/xmlschema-2/#double]
662@@ -194,7 +193,7 @@
663 * @param aValue double representation of the Double.
664 * @return The Double Item.
665 */
666- Item createDouble (double aValue);
667+ Item createDouble (double aValue);
668
669 /** \brief Creates a Duration Item
670 * see [http://www.w3.org/TR/xmlschema-2/#duration]
671@@ -202,7 +201,7 @@
672 * @param aValue String representation of the NCName.
673 * @return The Duration Item.
674 */
675- Item createDuration (const std::string &aValue);
676+ Item createDuration (const std::string &aValue);
677
678 /** \brief Creates a Duration Item
679 * see [http://www.w3.org/TR/xmlschema-2/#duration]
680@@ -215,7 +214,7 @@
681 * @param aSeconds double-valued representation of the seconds and fractional seconds.
682 * @return The Duration Item.
683 */
684- Item createDuration (short aYear, short aMonths, short aDays, short aHours, short aMinutes, double aSeconds);
685+ Item createDuration (short aYear, short aMonths, short aDays, short aHours, short aMinutes, double aSeconds);
686
687 /** \brief Creates a dayTimeDuration Item
688 * see [http://www.w3.org/TR/xpath-functions/#duration-subtypes]
689@@ -223,7 +222,7 @@
690 * @param aValue String lexical representation of the duration.
691 * @return the dayTimeDuration Item.
692 */
693- Item createDayTimeDuration (const std::string &aValue);
694+ Item createDayTimeDuration (const std::string &aValue);
695
696 /** \brief Creates a yearMonthDuration Item
697 * see [http://www.w3.org/TR/xpath-functions/#duration-subtypes]
698@@ -231,7 +230,7 @@
699 * @param aValue String lexical representation of the duration.
700 * @return the yearMonthDuration Item.
701 */
702- Item createYearMonthDuration (const std::string &aValue);
703+ Item createYearMonthDuration (const std::string &aValue);
704
705 /** \brief Creates a documentNode Item
706 * see [http://www.w3.org/TR/xpath-functions/#duration-subtypes]
707@@ -240,8 +239,8 @@
708 * @param aDocUri String representation of the Document URI.
709 * @return the documentNode Item.
710 */
711- Item createDocumentNode (const std::string &aBaseUri, const std::string &aDocUri);
712-#ifndef SWIGRUBY
713+ Item createDocumentNode (const std::string &aBaseUri, const std::string &aDocUri);
714+
715 /**
716 * @brief Creates a new element node.
717 *
718@@ -264,8 +263,7 @@
719 * property of P.
720 * @return The new node N created by this method
721 */
722- Item createElementNode (Item &aParent, Item &aNodeName, Item &aTypeName, bool aHasTypedValue, bool aHasEmptyValue, std::vector< std::pair< std::string, std::string > > aNsBindings);
723-#endif
724+ Item createElementNode (Item &aParent, Item &aNodeName, Item &aTypeName, bool aHasTypedValue, bool aHasEmptyValue, std::vector< std::pair< std::string, std::string > > aNsBindings);
725
726 /**
727 * @brief Creates a new element node.
728@@ -286,7 +284,7 @@
729 * complex type with empty content.
730 * @return The new node N created by this method
731 */
732- Item createElementNode (Item &aParent, Item &aNodeName, Item &aTypeName, bool aHasTypedValue, bool aHasEmptyValue);
733+ Item createElementNode (Item &aParent, Item &aNodeName, Item &aTypeName, bool aHasTypedValue, bool aHasEmptyValue);
734
735 /** \brief creates a float item
736 * see [http://www.w3.org/tr/xmlschema-2/#float]
737@@ -294,7 +292,7 @@
738 * @param aValue string representation of the float.
739 * @return the float item.
740 */
741- Item createFloat (const std::string &aValue);
742+ Item createFloat (const std::string &aValue);
743
744 /** \brief creates a float item
745 * see [http://www.w3.org/tr/xmlschema-2/#float]
746@@ -302,7 +300,7 @@
747 * @param aValue float representation of the float.
748 * @return the float item.
749 */
750- Item createFloat (float aValue);
751+ Item createFloat (float aValue);
752
753 /** \brief Creates a gDay Item
754 * see [http://www.w3.org/TR/xmlschema-2/#gDay]
755@@ -310,7 +308,7 @@
756 * @param aValue String representation of the gDay.
757 * @return The gDay Item.
758 */
759- Item createGDay (const std::string &aValue);
760+ Item createGDay (const std::string &aValue);
761
762 /** \brief Creates a gDay Item
763 * see [http://www.w3.org/TR/xmlschema-2/#gDay]
764@@ -318,7 +316,7 @@
765 * @param aDay short representation of the gDay.
766 * @return The gDay Item.
767 */
768- Item createGDay (short aDay);
769+ Item createGDay (short aDay);
770
771 /** \brief Creates a gMonth Item
772 * see [http://www.w3.org/TR/xmlschema-2/#gMonth]
773@@ -326,7 +324,7 @@
774 * @param aValue String representation of the gMonth.
775 * @return The gMonth Item.
776 */
777- Item createGMonth (const std::string &aValue);
778+ Item createGMonth (const std::string &aValue);
779
780 /** \brief Creates a gMonth Item
781 * see [http://www.w3.org/TR/xmlschema-2/#gMonth]
782@@ -334,7 +332,7 @@
783 * @param aMonth short representation of the gMonth.
784 * @return The gMonth Item.
785 */
786- Item createGMonth (short aMonth);
787+ Item createGMonth (short aMonth);
788
789 /** \brief Creates a gMonthDay Item
790 * see [http://www.w3.org/TR/xmlschema-2/#gMonthDay]
791@@ -342,7 +340,7 @@
792 * @param aValue String representation of the gMonthDay.
793 * @return The gMonthDay Item.
794 */
795- Item createGMonthDay (const std::string &aValue);
796+ Item createGMonthDay (const std::string &aValue);
797
798 /** \brief Creates a gMonthDay Item
799 * see [http://www.w3.org/TR/xmlschema-2/#gMonthDay]
800@@ -351,7 +349,7 @@
801 * @param aDay short representation of the day.
802 * @return The gMonthDay Item.
803 */
804- Item createGMonthDay (short aMonth, short aDay);
805+ Item createGMonthDay (short aMonth, short aDay);
806
807 /** \brief Creates a gYear Item
808 * see [http://www.w3.org/TR/xmlschema-2/#gYear]
809@@ -359,7 +357,7 @@
810 * @param aYear short representation of the gYear.
811 * @return The gYear Item.
812 */
813- Item createGYear (short aYear);
814+ Item createGYear (short aYear);
815
816 /** \brief Creates a gYear Item
817 * see [http://www.w3.org/TR/xmlschema-2/#gYear]
818@@ -367,7 +365,7 @@
819 * @param aValue String representation of the gYear.
820 * @return The gYear Item.
821 */
822- Item createGYear (const std::string &aValue);
823+ Item createGYear (const std::string &aValue);
824
825 /** \brief Creates a gYearMonth Item
826 * see [http://www.w3.org/TR/xmlschema-2/#gYearMonth]
827@@ -375,7 +373,7 @@
828 * @param aValue String representation of the gYearMonth.
829 * @return The gYearMonth Item.
830 */
831- Item createGYearMonth (const std::string &aValue);
832+ Item createGYearMonth (const std::string &aValue);
833
834 /** \brief Creates a gYearMonth Item
835 * see [http://www.w3.org/TR/xmlschema-2/#gYearMonth]
836@@ -384,7 +382,7 @@
837 * @param aMonth short representation of the month.
838 * @return The gYearMonth Item.
839 */
840- Item createGYearMonth (short aYear, short aMonth);
841+ Item createGYearMonth (short aYear, short aMonth);
842
843 /** \brief Creates a HexBinary Item
844 * see [http://www.w3.org/TR/xmlschema-2/#hexBinary]
845@@ -393,7 +391,7 @@
846 * @param aSize size of the hexdata.
847 * @return The HexBinary Item.
848 */
849- Item createHexBinary (const char *aHexData, size_t aSize);
850+ Item createHexBinary (const char *aHexData, size_t aSize);
851
852 /** \brief Creates a Int Item
853 * see [http://www.w3.org/TR/xmlschema-2/#int]
854@@ -401,7 +399,7 @@
855 * @param aInt int representation of the Int.
856 * @return The NCName Item.
857 */
858- Item createInt (int aInt);
859+ Item createInt (int aInt);
860
861 /** \brief Creates an Integer Item
862 * see [http://www.w3.org/TR/xmlschema-2/#integer]
863@@ -409,7 +407,7 @@
864 * @param aInteger String representation of the Integer.
865 * @return The Integer Item.
866 */
867- Item createInteger (const std::string &aInteger);
868+ Item createInteger (const std::string &aInteger);
869
870 /** \brief Creates an Integer Item
871 * see [http://www.w3.org/TR/xmlschema-2/#integer]
872@@ -417,7 +415,7 @@
873 * @param aInteger unsigned long representation of the Integer.
874 * @return The Integer Item.
875 */
876- Item createInteger (long long aInteger);
877+ Item createInteger (long long aInteger);
878
879 /** \brief Creates a Long Item
880 * see [http://www.w3.org/TR/xmlschema-2/#long]
881@@ -425,7 +423,7 @@
882 * @param aLong long long representation of the Long.
883 * @return The Long Item.
884 */
885- Item createLong (long long aLong);
886+ Item createLong (long long aLong);
887
888 /** \brief Creates a NCName Item
889 * see [http://www.w3.org/TR/xmlschema-2/#NCName]
890@@ -433,7 +431,7 @@
891 * @param aValue String representation of the NCName.
892 * @return The NCName Item.
893 */
894- Item createNCName (const std::string &aValue);
895+ Item createNCName (const std::string &aValue);
896
897 /** \brief Creates a negativeInteger Item
898 * see [http://www.w3.org/TR/xmlschema-2/#negativeInteger]
899@@ -441,7 +439,7 @@
900 * @param aValue long long representation of the negativeInteger.
901 * @return The negativeInteger Item.
902 */
903- Item createNegativeInteger (long long aValue);
904+ Item createNegativeInteger (long long aValue);
905
906 /** \brief Creates a nonNegativeInteger Item
907 * see [http://www.w3.org/TR/xmlschema-2/#nonNegativeInteger]
908@@ -449,7 +447,7 @@
909 * @param aValue unsigned long representation of the nonNegativeInteger.
910 * @return The nonNegativeInteger Item.
911 */
912- Item createNonNegativeInteger (unsigned long long aValue);
913+ Item createNonNegativeInteger (unsigned long long aValue);
914
915 /** \brief Creates a nonPositiveInteger Item
916 * see [http://www.w3.org/TR/xmlschema-2/#nonPositiveInteger]
917@@ -457,7 +455,7 @@
918 * @param aValue long long representation of the NCName.
919 * @return The nonPositiveInteger Item.
920 */
921- Item createNonPositiveInteger (long long aValue);
922+ Item createNonPositiveInteger (long long aValue);
923
924 /**
925 * Create a new Processing Instruction node N and place it among the
926@@ -470,7 +468,7 @@
927 * @param aBaseUri The Base URI of the new node, may be NULL.
928 * @return The new node N created by this method
929 */
930- Item createPiNode (Item &aParent, const std::string &aTarget, const std::string &aContent, const std::string &aBaseUri);
931+ Item createPiNode (Item &aParent, const std::string &aTarget, const std::string &aContent, const std::string &aBaseUri);
932
933 /** \brief Creates a positiveInteger\ Item
934 * see [http://www.w3.org/TR/xmlschema-2/#positiveInteger]
935@@ -478,7 +476,7 @@
936 * @param aValue unsigned long representation of the positiveInteger.
937 * @return The positiveInteger Item.
938 */
939- Item createPositiveInteger (unsigned long long aValue);
940+ Item createPositiveInteger (unsigned long long aValue);
941
942 /** \brief Creates a QName Item
943 * see [http://www.w3.org/TR/xmlschema-2/#QName]
944@@ -489,7 +487,7 @@
945 *
946 * @return The QName Item.
947 */
948- Item createQName (const std::string &aNamespace, const std::string &aPrefix, const std::string &aLocalname);
949+ Item createQName (const std::string &aNamespace, const std::string &aPrefix, const std::string &aLocalname);
950
951 /** \brief Creates a QName Item
952 * see [http://www.w3.org/TR/xmlschema-2/#QName]
953@@ -498,7 +496,7 @@
954 * @param aLocalname String representation of the localname. *
955 * @return The QName Item.
956 */
957- Item createQName (const std::string &aNamespace, const std::string &aLocalname);
958+ Item createQName (const std::string &aNamespace, const std::string &aLocalname);
959
960 /** \brief Creates a QName Item
961 * see [http://www.w3.org/TR/xmlschema-2/#QName]
962@@ -509,7 +507,7 @@
963 * @param aQNameString String in the QName notation by James Clark.
964 * @return The QName Item.
965 */
966- Item createQName (const std::string &aQNameString);
967+ Item createQName (const std::string &aQNameString);
968
969 /** \brief Creates a Short Item
970 * see [http://www.w3.org/TR/xmlschema-2/#short]
971@@ -517,8 +515,8 @@
972 * @param aShort short representation of the Short.
973 * @return The Short Item.
974 */
975- Item createShort (short aShort);
976- //Item createStreamableString (std::istream &stream, StreamReleaser streamReleaser, bool seekable=false);
977+ Item createShort (short aShort);
978+ //Item createStreamableString (std::istream &stream, StreamReleaser streamReleaser, bool seekable=false);
979
980 /** \brief Creates a String Item
981 * see [http://www.w3.org/TR/xmlschema-2/#string]
982@@ -526,7 +524,7 @@
983 * @param aString String representation of the String Item.
984 * @return The String Item
985 */
986- Item createString (const std::string &aString);
987+ Item createString (const std::string &aString);
988
989 /**
990 * Create a new text node N and place it among the
991@@ -537,7 +535,7 @@
992 * @param aContent The content of the new node.
993 * @return The new node N created by this method
994 */
995- Item createTextNode (Item &aParent, const std::string &aContent);
996+ Item createTextNode (Item &aParent, const std::string &aContent);
997
998 /** \brief Creates a Time Item
999 * see [http://www.w3.org/TR/xmlschema-2/#time]
1000@@ -548,7 +546,7 @@
1001 * @param aTimeZone_hours short representation of the timezone difference in hours to UTC.
1002 * @return The Time Item.
1003 */
1004- Item createTime (short aHour, short aMinute, double aSecond, short aTimeZone_hours);
1005+ Item createTime (short aHour, short aMinute, double aSecond, short aTimeZone_hours);
1006
1007 /** \brief Creates a Time Item
1008 * see [http://www.w3.org/TR/xmlschema-2/#time]
1009@@ -558,7 +556,7 @@
1010 * @param aSecond double representation of the seconds and fractional seconds.
1011 * @return The Time Item.
1012 */
1013- Item createTime (short aHour, short aMinute, double aSecond);
1014+ Item createTime (short aHour, short aMinute, double aSecond);
1015
1016 /** \brief Creates a Time Item
1017 * see [http://www.w3.org/TR/xmlschema-2/#time]
1018@@ -566,7 +564,7 @@
1019 * @param aValue String representation of the Time.
1020 * @return The Time Item
1021 */
1022- Item createTime (const std::string &aValue);
1023+ Item createTime (const std::string &aValue);
1024
1025 /** \brief Creates an Unsigned Byte Item
1026 * see [http://www.w3.org/TR/xmlschema-2/#unsignedByte]
1027@@ -574,7 +572,7 @@
1028 * @param aValue unsignedByte unsigned char representation of the unsigned byte.
1029 * @return The Unsigned Byte Item.
1030 */
1031- Item createUnsignedByte (const unsigned char aValue);
1032+ Item createUnsignedByte (const unsigned char aValue);
1033
1034 /** \brief Creates an unsigned int Item
1035 * see [http://www.w3.org/TR/xmlschema-2/#unsignedInt]
1036@@ -582,7 +580,7 @@
1037 * @param aValue unsigned int representation of the unsignedInt.
1038 * @return The unsignedInt Item.
1039 */
1040- Item createUnsignedInt (unsigned int aValue);
1041+ Item createUnsignedInt (unsigned int aValue);
1042
1043 /** \brief Creates an unsignedLong Item
1044 * see [http://www.w3.org/TR/xmlschema-2/#unsignedLong]
1045@@ -590,7 +588,7 @@
1046 * @param aValue unsignedLong long long representation of the unsignedLong.
1047 * @return The unsignedLong Item.
1048 */
1049- Item createUnsignedLong (unsigned long long aValue);
1050+ Item createUnsignedLong (unsigned long long aValue);
1051
1052 /** \brief Creates a unsignedShort Item
1053 * see [http://www.w3.org/TR/xmlschema-2/#unsignedShort]
1054@@ -598,7 +596,55 @@
1055 * @param aValue unsigned short representation of the unsignedShort.
1056 * @return The unsignedShort Item.
1057 */
1058- Item createUnsignedShort (unsigned short aValue);
1059+ Item createUnsignedShort (unsigned short aValue);
1060+
1061+ /**
1062+ * \brief Create a JSON null item.
1063+ */
1064+ Item createJSONNull();
1065+
1066+ /**
1067+ * \brief Create a JSON Number item from a string.
1068+ * This will actually be
1069+ * an xs:integer, xs:double, or xs:decimal, depending on the content
1070+ * of the string.
1071+ *
1072+ * @param aString The input string.
1073+ */
1074+ Item createJSONNumber(std::string aString);
1075+
1076+ /**
1077+ * \brief Create a JSON Object containing the specified JSON Pairs.
1078+ *
1079+ * @param aNames A vector containing the name and value of each pair.
1080+ */
1081+ Item createJSONObject(std::vector<std::pair<Item, Item> >& aNames);
1082+
1083+ /**
1084+ * \brief Create a JSON Object containing the specified string Pairs.
1085+ *
1086+ * @param aNames A vector containing the name and value of each pair.
1087+ */
1088+ Item createJSONObject(std::vector<std::pair<std::string, std::string> >& aNames);
1089+
1090+ /**
1091+ * \brief Create a JSON Array containing the specified items.
1092+ *
1093+ * @param aItems a Vector<Item> containing Items which may
1094+ * be stored in a JSON Array (namely JSON Arrays, JSON Objects,
1095+ * JSON nulls, valid JSON numeric types, or xs:strings).
1096+ */
1097+ Item createJSONArray(std::vector<Item>& aItems);
1098+
1099+ /**
1100+ * \brief Create a JSON Array containing the specified items.
1101+ *
1102+ * @param aItems a Vector<String> containing strings which may
1103+ * be stored in a JSON Array.
1104+ */
1105+ Item createJSONArray(std::vector<std::string>& aItems);
1106+
1107+
1108 }; // class ItemFactory
1109
1110 #endif
1111\ No newline at end of file
1112
1113=== modified file 'swig/ItemFactory.i'
1114--- swig/ItemFactory.i 2013-02-07 17:24:36 +0000
1115+++ swig/ItemFactory.i 2013-03-27 00:40:33 +0000
1116@@ -3,16 +3,15 @@
1117
1118
1119
1120- Item ItemFactory::createAnyURI (const std::string &aURI){
1121+ Item ItemFactory::createAnyURI (const std::string &aURI){
1122 return Item(theItemFactory->createAnyURI(aURI));
1123 }
1124
1125- Item ItemFactory::createAttributeNode (Item& aParent, Item& aNodeName, Item& aTypeName, Item& aTypedValue){
1126+ Item ItemFactory::createAttributeNode (Item& aParent, Item& aNodeName, Item& aTypeName, Item& aTypedValue){
1127 return Item( theItemFactory->createAttributeNode( aParent.theItem, aNodeName.theItem, aTypeName.theItem, aTypedValue.theItem ));
1128 }
1129
1130-#ifndef SWIGRUBY
1131- Item ItemFactory::createAttributeNode (Item& aParent, Item& aNodeName, Item& aTypeName, std::vector< Item > aTypedValue){
1132+ Item ItemFactory::createAttributeNode (Item& aParent, Item& aNodeName, Item& aTypeName, std::vector< Item > aTypedValue){
1133
1134 std::vector< zorba::Item > typedValue;
1135 typedValue.reserve(aTypedValue.size());
1136@@ -22,71 +21,70 @@
1137 }
1138 return Item( theItemFactory->createAttributeNode (aParent.theItem, aNodeName.theItem, aTypeName.theItem, typedValue ));
1139 }
1140-#endif
1141
1142- Item ItemFactory::createBase64Binary (const char *aBinData, size_t aLength){
1143+ Item ItemFactory::createBase64Binary (const char *aBinData, size_t aLength){
1144 return Item( theItemFactory->createBase64Binary(aBinData, aLength));
1145 }
1146- Item ItemFactory::createBase64Binary (std::istream &aStream){
1147+ Item ItemFactory::createBase64Binary (std::istream &aStream){
1148 return Item( theItemFactory->createBase64Binary(aStream));
1149 }
1150- Item ItemFactory::createBase64Binary (const unsigned char *aBinData, size_t aLength){
1151+ Item ItemFactory::createBase64Binary (const unsigned char *aBinData, size_t aLength){
1152 return Item( theItemFactory->createBase64Binary(aBinData, aLength));
1153 }
1154- Item ItemFactory::createBoolean (bool aValue){
1155+ Item ItemFactory::createBoolean (bool aValue){
1156 return Item( theItemFactory->createBoolean(aValue));
1157 }
1158- Item ItemFactory::createByte (char aByte){
1159+ Item ItemFactory::createByte (char aByte){
1160 return Item( theItemFactory->createByte(aByte));
1161 }
1162- Item ItemFactory::createCommentNode (Item &aParent, const std::string &aContent){
1163+ Item ItemFactory::createCommentNode (Item &aParent, const std::string &aContent){
1164 zorba::String lContent = zorba::String(aContent);
1165 return Item( theItemFactory->createCommentNode (aParent.theItem, lContent));
1166 }
1167- Item ItemFactory::createDate (const std::string &aDate){
1168+ Item ItemFactory::createDate (const std::string &aDate){
1169 return Item( theItemFactory->createDate(aDate));
1170 }
1171- Item ItemFactory::createDate (short aYear, short aMonth, short aDay){
1172+ Item ItemFactory::createDate (short aYear, short aMonth, short aDay){
1173 return Item( theItemFactory->createDate (aYear, aMonth, aDay));
1174 }
1175- Item ItemFactory::createDateTime (const std::string &aDateTimeValue){
1176+ Item ItemFactory::createDateTime (const std::string &aDateTimeValue){
1177 return Item( theItemFactory->createDateTime (aDateTimeValue));
1178 }
1179- Item ItemFactory::createDateTime (short aYear, short aMonth, short aDay, short aHour, short aMinute, double aSecond, short aTimeZone_hours){
1180+ Item ItemFactory::createDateTime (short aYear, short aMonth, short aDay, short aHour, short aMinute, double aSecond, short aTimeZone_hours){
1181 return Item( theItemFactory->createDateTime (aYear, aMonth, aDay, aHour, aMinute, aSecond, aTimeZone_hours));
1182 }
1183- Item ItemFactory::createDecimal (const std::string &aValue){
1184+ Item ItemFactory::createDecimal (const std::string &aValue){
1185 return Item( theItemFactory->createDecimal (aValue));
1186 }
1187- Item ItemFactory::createDecimalFromDouble (double aValue){
1188+ Item ItemFactory::createDecimalFromDouble (double aValue){
1189 return Item( theItemFactory->createDecimalFromDouble (aValue));
1190 }
1191- Item ItemFactory::createDecimalFromLong (unsigned long aValue){
1192+ Item ItemFactory::createDecimalFromLong (unsigned long aValue){
1193 return Item( theItemFactory->createDecimalFromLong (aValue));
1194 }
1195- Item ItemFactory::createDouble (const std::string &aValue){
1196- return Item( theItemFactory->createDouble (aValue));
1197- }
1198- Item ItemFactory::createDouble (double aValue){
1199- return Item( theItemFactory->createDouble (aValue));
1200- }
1201- Item ItemFactory::createDuration (const std::string &aValue){
1202+ Item ItemFactory::createDouble (const std::string &aValue){
1203+ return Item( theItemFactory->createDouble (aValue));
1204+ }
1205+ Item ItemFactory::createDouble (double aValue){
1206+ return Item( theItemFactory->createDouble (aValue));
1207+ }
1208+ Item ItemFactory::createDuration (const std::string &aValue){
1209 return Item( theItemFactory->createDuration (aValue));
1210 }
1211- Item ItemFactory::createDuration (short aYear, short aMonths, short aDays, short aHours, short aMinutes, double aSeconds){
1212+ Item ItemFactory::createDuration (short aYear, short aMonths, short aDays, short aHours, short aMinutes, double aSeconds){
1213 return Item( theItemFactory->createDuration (aYear, aMonths, aDays, aHours, aMinutes, aSeconds));
1214 }
1215- Item ItemFactory::createDayTimeDuration (const std::string &aValue){
1216+ Item ItemFactory::createDayTimeDuration (const std::string &aValue){
1217 return Item( theItemFactory->createDayTimeDuration (aValue));
1218 }
1219- Item ItemFactory::createYearMonthDuration (const std::string &aValue){
1220+ Item ItemFactory::createYearMonthDuration (const std::string &aValue){
1221 return Item( theItemFactory->createYearMonthDuration (aValue));
1222 }
1223- Item ItemFactory::createDocumentNode (const std::string &aBaseUri, const std::string &aDocUri){
1224+ Item ItemFactory::createDocumentNode (const std::string &aBaseUri, const std::string &aDocUri){
1225 return Item( theItemFactory->createDocumentNode (aBaseUri, aDocUri));
1226 }
1227-#ifndef SWIGRUBY
1228- Item ItemFactory::createElementNode (Item &aParent, Item& aNodeName, Item& aTypeName, bool aHasTypedValue, bool aHasEmptyValue, std::vector< std::pair< std::string, std::string > > aNsBindings){
1229+
1230+ Item ItemFactory::createElementNode (Item &aParent, Item& aNodeName, Item& aTypeName, bool aHasTypedValue, bool aHasEmptyValue, std::vector< std::pair< std::string, std::string > > aNsBindings){
1231 std::vector< std::pair< zorba::String, zorba::String > > items;
1232 items.reserve(aNsBindings.size());
1233 std::vector< std::pair< std::string, std::string > >::iterator iter;
1234@@ -98,128 +96,184 @@
1235 }
1236 return Item( theItemFactory->createElementNode (aParent.theItem, aNodeName.theItem, aTypeName.theItem, aHasTypedValue, aHasEmptyValue, items));
1237 }
1238-#endif
1239- Item ItemFactory::createElementNode (Item &aParent, Item& aNodeName, Item& aTypeName, bool aHasTypedValue, bool aHasEmptyValue){
1240+
1241+ Item ItemFactory::createElementNode (Item &aParent, Item& aNodeName, Item& aTypeName, bool aHasTypedValue, bool aHasEmptyValue){
1242 return Item( theItemFactory->createElementNode (aParent.theItem, aNodeName.theItem, aTypeName.theItem, aHasTypedValue, aHasEmptyValue, std::vector<std::pair<zorba::String, zorba::String> >()));
1243 }
1244- Item ItemFactory::createFloat (const std::string &aValue){
1245- return Item( theItemFactory->createFloat (aValue));
1246- }
1247- Item ItemFactory::createFloat (float aValue){
1248- return Item( theItemFactory->createFloat (aValue));
1249- }
1250- Item ItemFactory::createGDay (const std::string &aValue){
1251+ Item ItemFactory::createFloat (const std::string &aValue){
1252+ return Item( theItemFactory->createFloat (aValue));
1253+ }
1254+ Item ItemFactory::createFloat (float aValue){
1255+ return Item( theItemFactory->createFloat (aValue));
1256+ }
1257+ Item ItemFactory::createGDay (const std::string &aValue){
1258 return Item( theItemFactory->createGDay (aValue));
1259 }
1260- Item ItemFactory::createGDay (short aDay){
1261+ Item ItemFactory::createGDay (short aDay){
1262 return Item( theItemFactory->createGDay (aDay));
1263 }
1264- Item ItemFactory::createGMonth (const std::string &aValue){
1265+ Item ItemFactory::createGMonth (const std::string &aValue){
1266 return Item( theItemFactory->createGMonth (aValue));
1267 }
1268- Item ItemFactory::createGMonth (short aMonth){
1269+ Item ItemFactory::createGMonth (short aMonth){
1270 return Item( theItemFactory->createGMonth (aMonth));
1271 }
1272- Item ItemFactory::createGMonthDay (const std::string &aValue){
1273+ Item ItemFactory::createGMonthDay (const std::string &aValue){
1274 return Item( theItemFactory->createGMonthDay (aValue));
1275 }
1276- Item ItemFactory::createGMonthDay (short aMonth, short aDay){
1277+ Item ItemFactory::createGMonthDay (short aMonth, short aDay){
1278 return Item( theItemFactory->createGMonthDay (aMonth, aDay));
1279 }
1280- Item ItemFactory::createGYear (short aYear){
1281+ Item ItemFactory::createGYear (short aYear){
1282 return Item( theItemFactory->createGYear (aYear));
1283 }
1284- Item ItemFactory::createGYear (const std::string &aValue){
1285+ Item ItemFactory::createGYear (const std::string &aValue){
1286 return Item( theItemFactory->createGYear (aValue));
1287 }
1288- Item ItemFactory::createGYearMonth (const std::string &aValue){
1289+ Item ItemFactory::createGYearMonth (const std::string &aValue){
1290 return Item( theItemFactory->createGYearMonth (aValue));
1291 }
1292- Item ItemFactory::createGYearMonth (short aYear, short aMonth){
1293+ Item ItemFactory::createGYearMonth (short aYear, short aMonth){
1294 return Item( theItemFactory->createGYearMonth (aYear, aMonth));
1295 }
1296- Item ItemFactory::createHexBinary (const char *aHexData, size_t aSize){
1297+ Item ItemFactory::createHexBinary (const char *aHexData, size_t aSize){
1298 return Item( theItemFactory->createHexBinary (aHexData, aSize));
1299 }
1300- Item ItemFactory::createInt (int aInt){
1301+ Item ItemFactory::createInt (int aInt){
1302 return Item( theItemFactory->createInt (aInt));
1303 }
1304- Item ItemFactory::createInteger (const std::string &aInteger){
1305- return Item( theItemFactory->createInteger (aInteger));
1306- }
1307- Item ItemFactory::createInteger (long long aInteger){
1308- return Item( theItemFactory->createInteger (aInteger));
1309- }
1310- Item ItemFactory::createLong (long long aLong){
1311+ Item ItemFactory::createInteger (const std::string &aInteger){
1312+ return Item( theItemFactory->createInteger (aInteger));
1313+ }
1314+ Item ItemFactory::createInteger (long long aInteger){
1315+ return Item( theItemFactory->createInteger (aInteger));
1316+ }
1317+ Item ItemFactory::createLong (long long aLong){
1318 return Item( theItemFactory->createLong (aLong));
1319 }
1320- Item ItemFactory::createNCName (const std::string &aValue){
1321+ Item ItemFactory::createNCName (const std::string &aValue){
1322 return Item( theItemFactory->createNCName (aValue));
1323 }
1324- Item ItemFactory::createNegativeInteger (long long aValue){
1325+ Item ItemFactory::createNegativeInteger (long long aValue){
1326 return Item( theItemFactory->createNegativeInteger (aValue));
1327 }
1328- Item ItemFactory::createNonNegativeInteger (unsigned long long aValue){
1329+ Item ItemFactory::createNonNegativeInteger (unsigned long long aValue){
1330 return Item( theItemFactory->createNonNegativeInteger (aValue));
1331 }
1332- Item ItemFactory::createNonPositiveInteger (long long aValue){
1333+ Item ItemFactory::createNonPositiveInteger (long long aValue){
1334 return Item( theItemFactory->createNonPositiveInteger (aValue));
1335 }
1336- Item ItemFactory::createPiNode (Item &aParent, const std::string &aTarget, const std::string &aContent, const std::string &aBaseUri){
1337+ Item ItemFactory::createPiNode (Item &aParent, const std::string &aTarget, const std::string &aContent, const std::string &aBaseUri){
1338 zorba::String lTarget = zorba::String(aTarget);
1339 zorba::String lContent = zorba::String(aContent);
1340 zorba::String lBaseUri = zorba::String(aBaseUri);
1341 return Item( theItemFactory->createPiNode (aParent.theItem, lTarget, lContent, lBaseUri));
1342 }
1343- Item ItemFactory::createPositiveInteger (unsigned long long aValue){
1344+ Item ItemFactory::createPositiveInteger (unsigned long long aValue){
1345 return Item( theItemFactory->createPositiveInteger (aValue));
1346 }
1347- Item ItemFactory::createQName (const std::string &aNamespace, const std::string &aPrefix, const std::string &aLocalname){
1348+ Item ItemFactory::createQName (const std::string &aNamespace, const std::string &aPrefix, const std::string &aLocalname){
1349 return Item( theItemFactory->createQName (aNamespace, aPrefix, aLocalname));
1350 }
1351- Item ItemFactory::createQName (const std::string &aNamespace, const std::string &aLocalname){
1352+ Item ItemFactory::createQName (const std::string &aNamespace, const std::string &aLocalname){
1353 return Item( theItemFactory->createQName (aNamespace, aLocalname));
1354 }
1355- Item ItemFactory::createQName (const std::string &aQNameString){
1356+ Item ItemFactory::createQName (const std::string &aQNameString){
1357 return Item( theItemFactory->createQName (aQNameString));
1358 }
1359- Item ItemFactory::createShort (short aShort){
1360+ Item ItemFactory::createShort (short aShort){
1361 return Item( theItemFactory->createShort (aShort));
1362 }
1363 /*
1364- Item ItemFactory::createStreamableString (std::istream &stream, StreamReleaser streamReleaser, bool seekable=false){
1365+ Item ItemFactory::createStreamableString (std::istream &stream, StreamReleaser streamReleaser, bool seekable=false){
1366 return Item( theItemFactory->createStreamableString (std::istream &stream, StreamReleaser streamReleaser, seekable));
1367 }
1368 */
1369- Item ItemFactory::createString (const std::string &aString){
1370+ Item ItemFactory::createString (const std::string &aString){
1371 return Item( theItemFactory->createString (aString));
1372 }
1373- Item ItemFactory::createTextNode (Item &aParent, const std::string &aContent){
1374+ Item ItemFactory::createTextNode (Item &aParent, const std::string &aContent){
1375 zorba::String lContent = zorba::String(aContent);
1376 return Item( theItemFactory->createTextNode (aParent.theItem, lContent));
1377 }
1378- Item ItemFactory::createTime (short aHour, short aMinute, double aSecond, short aTimeZone_hours){
1379+ Item ItemFactory::createTime (short aHour, short aMinute, double aSecond, short aTimeZone_hours){
1380 return Item( theItemFactory->createTime (aHour, aMinute, aSecond, aTimeZone_hours));
1381 }
1382- Item ItemFactory::createTime (short aHour, short aMinute, double aSecond){
1383+ Item ItemFactory::createTime (short aHour, short aMinute, double aSecond){
1384 return Item( theItemFactory->createTime (aHour, aMinute, aSecond));
1385 }
1386- Item ItemFactory::createTime (const std::string &aValue){
1387+ Item ItemFactory::createTime (const std::string &aValue){
1388 return Item( theItemFactory->createTime (aValue));
1389 }
1390- Item ItemFactory::createUnsignedByte (const unsigned char aValue){
1391+ Item ItemFactory::createUnsignedByte (const unsigned char aValue){
1392 return Item( theItemFactory->createUnsignedByte (aValue));
1393 }
1394- Item ItemFactory::createUnsignedInt (unsigned int aValue){
1395+ Item ItemFactory::createUnsignedInt (unsigned int aValue){
1396 return Item( theItemFactory->createUnsignedInt (aValue));
1397 }
1398- Item ItemFactory::createUnsignedLong (unsigned long long aValue){
1399+ Item ItemFactory::createUnsignedLong (unsigned long long aValue){
1400 return Item( theItemFactory->createUnsignedLong (aValue));
1401 }
1402- Item ItemFactory::createUnsignedShort (unsigned short aValue){
1403+ Item ItemFactory::createUnsignedShort (unsigned short aValue){
1404 return Item( theItemFactory->createUnsignedShort (aValue));
1405 }
1406
1407+ Item ItemFactory::createJSONNull() {
1408+ return Item( theItemFactory->createJSONNull() );
1409+ }
1410+
1411+ Item ItemFactory::createJSONNumber(std::string aString) {
1412+ return Item( theItemFactory->createJSONNumber(aString));
1413+ }
1414+
1415+ Item ItemFactory::createJSONObject(std::vector<std::pair<Item, Item> >& aNames) {
1416+ std::vector< std::pair< zorba::Item, zorba::Item > > names;
1417+ names.reserve(aNames.size());
1418+
1419+ for(std::vector< std::pair< Item, Item > >::iterator iter = aNames.begin(); iter != aNames.end(); iter++) {
1420+ std::pair< zorba::Item, zorba::Item > pair;
1421+ pair.first = (*iter).first.theItem;
1422+ pair.second = (*iter).second.theItem;
1423+ names.push_back(pair);
1424+ }
1425+ return Item( theItemFactory->createJSONObject (names) );
1426+ }
1427+
1428+ Item ItemFactory::createJSONObject(std::vector<std::pair<std::string, std::string> >& aNames) {
1429+ std::vector< std::pair< zorba::Item, zorba::Item > > names;
1430+ names.reserve(aNames.size());
1431+
1432+ for(std::vector<std::pair<std::string, std::string> >::iterator iter = aNames.begin(); iter != aNames.end(); iter++) {
1433+ std::pair< zorba::Item, zorba::Item > pair;
1434+ pair.first = theItemFactory->createString( (*iter).first );
1435+ pair.second = theItemFactory->createString( (*iter).second );
1436+ names.push_back(pair);
1437+ }
1438+ return Item( theItemFactory->createJSONObject (names) );
1439+ }
1440+
1441+ Item ItemFactory::createJSONArray(std::vector<Item>& aItems) {
1442+ std::vector< zorba::Item > items;
1443+ items.reserve(aItems.size());
1444+
1445+ for(std::vector< Item >::iterator iter = aItems.begin(); iter != aItems.end(); iter++) {
1446+ zorba::Item item = (*iter).theItem;
1447+ items.push_back(item);
1448+ }
1449+ return Item( theItemFactory->createJSONArray (items) );
1450+ }
1451+
1452+ Item ItemFactory::createJSONArray(std::vector<std::string>& aItems) {
1453+ std::vector< zorba::Item > items;
1454+ items.reserve(aItems.size());
1455+
1456+ for(std::vector< std::string >::iterator iter = aItems.begin(); iter != aItems.end(); iter++) {
1457+ zorba::Item item = theItemFactory->createString(*iter);
1458+ items.push_back(item);
1459+ }
1460+ return Item( theItemFactory->createJSONArray (items) );
1461+ }
1462+
1463
1464 %} // end Implementation
1465
1466
1467=== modified file 'swig/StaticContext.i'
1468--- swig/StaticContext.i 2013-02-07 17:24:36 +0000
1469+++ swig/StaticContext.i 2013-03-27 00:40:33 +0000
1470@@ -35,13 +35,13 @@
1471 bool StaticContext::containsFunction(const std::string &aFnNameUri, const std::string &aFnNameLocal, int arity) const
1472 { return theStaticContext->containsFunction(aFnNameUri, aFnNameLocal, arity); }
1473
1474-StaticContext StaticContext::createChildContext() const
1475+StaticContext StaticContext::createChildContext() const
1476 { return StaticContext(theStaticContext->createChildContext()); }
1477
1478-void StaticContext::declareOption (const Item &aQName, const std::string &aOptionVal)
1479+void StaticContext::declareOption (const Item &aQName, const std::string &aOptionVal)
1480 { return theStaticContext->declareOption(aQName.theItem, aOptionVal); }
1481
1482-void StaticContext::disableFunction (const Item &aQName, int arity)
1483+void StaticContext::disableFunction (const Item &aQName, int arity)
1484 { theStaticContext->disableFunction( aQName.theItem, arity); }
1485
1486 std::string StaticContext::getBaseURI () const
1487@@ -65,7 +65,7 @@
1488 result = ZorbaConstants::PRESERVE_CONSTRUCTION;
1489 }
1490 return result;
1491- }
1492+ }
1493
1494 ZorbaConstants::PreserveMode StaticContext::getCopyNamespacesModePreserve()
1495 {
1496
1497=== modified file 'swig/TypeIdentifier.i'
1498--- swig/TypeIdentifier.i 2012-03-27 00:56:11 +0000
1499+++ swig/TypeIdentifier.i 2013-03-27 00:40:33 +0000
1500@@ -19,7 +19,7 @@
1501 zorba::IdentTypes::quantifier_t
1502 TypeIdentifier::convertQuantifier(IdentTypes::Quantifier quantifier)
1503 {
1504- zorba::IdentTypes::quantifier_t result;
1505+ zorba::IdentTypes::quantifier_t result = zorba::IdentTypes::QUANT_ONE;
1506 switch (quantifier) {
1507 case IdentTypes::QUANT_ONE:
1508 result = zorba::IdentTypes::QUANT_ONE;
1509@@ -44,7 +44,7 @@
1510 IdentTypes::Kind TypeIdentifier::getKind()
1511 {
1512 zorba::IdentTypes::kind_t lKind = theTypeIdentifier->getKind();
1513- IdentTypes::Kind result;
1514+ IdentTypes::Kind result = IdentTypes::ANY_NODE_TYPE;
1515 switch (lKind) {
1516 case zorba::IdentTypes::NAMED_TYPE:
1517 result = IdentTypes::NAMED_TYPE;
1518@@ -92,7 +92,7 @@
1519 IdentTypes::Quantifier TypeIdentifier::getQuantifier()
1520 {
1521 zorba::IdentTypes::quantifier_t lQuantifier = theTypeIdentifier->getQuantifier();
1522- IdentTypes::Quantifier result;
1523+ IdentTypes::Quantifier result = IdentTypes::QUANT_ONE;
1524 switch (lQuantifier) {
1525 case zorba::IdentTypes::QUANT_ONE:
1526 result = IdentTypes::QUANT_ONE;
1527
1528=== modified file 'swig/ZorbaStreamBuffer.i'
1529--- swig/ZorbaStreamBuffer.i 2012-09-06 23:54:47 +0000
1530+++ swig/ZorbaStreamBuffer.i 2013-03-27 00:40:33 +0000
1531@@ -82,7 +82,7 @@
1532
1533 std::streamsize ZorbaStreamBuffer::xsputn ( const char * BYTE, std::streamsize len ) {
1534 // Wrapping to virtual function
1535- streamWrapper->write(BYTE, len);
1536+ streamWrapper->write(BYTE, static_cast<size_t>(len));
1537 return len;
1538 }
1539
1540
1541=== modified file 'swig/csharp/tests/CMakeLists.txt'
1542--- swig/csharp/tests/CMakeLists.txt 2012-07-27 22:56:27 +0000
1543+++ swig/csharp/tests/CMakeLists.txt 2013-03-27 00:40:33 +0000
1544@@ -21,6 +21,8 @@
1545 STRING(REGEX REPLACE "/" "\\\\" CSharpPath "${CSharpPath}")
1546 STRING(REGEX REPLACE "/" "\\\\" CSharpBuildPath "${CSharpBuildPath}")
1547
1548+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/satellites.json ${CMAKE_CURRENT_BINARY_DIR}/satellites.json COPYONLY)
1549+
1550 FILE(GLOB CSHARP_EXAMPLES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/" "${CMAKE_CURRENT_SOURCE_DIR}/*.in")
1551 FOREACH(CSHARP_EXAMPLE ${CSHARP_EXAMPLES})
1552 STRING(REPLACE ".in" "" CSHARP_EXAMPLE_DEST ${CSHARP_EXAMPLE})
1553
1554=== added file 'swig/csharp/tests/satellites.json'
1555--- swig/csharp/tests/satellites.json 1970-01-01 00:00:00 +0000
1556+++ swig/csharp/tests/satellites.json 2013-03-27 00:40:33 +0000
1557@@ -0,0 +1,17 @@
1558+{
1559+ "creator" : "Satellites plugin version 0.6.4",
1560+ "satellites" : {
1561+ "AAU CUBESAT" : {
1562+ "tle1" : "1 27846U 03031G 10322.04074654 .00000056 00000-0 45693-4 0 8768",
1563+ "visible" : false
1564+ },
1565+ "AJISAI (EGS)" : {
1566+ "tle1" : "1 16908U 86061A 10321.84797408 -.00000083 00000-0 10000-3 0 3696",
1567+ "visible" : true
1568+ },
1569+ "AKARI (ASTRO-F)" : {
1570+ "tle1" : "1 28939U 06005A 10321.96319841 .00000176 00000-0 48808-4 0 4294",
1571+ "visible" : true
1572+ }
1573+ }
1574+}
1575
1576=== modified file 'swig/csharp/tests/test01.cs'
1577--- swig/csharp/tests/test01.cs 2012-07-20 21:21:21 +0000
1578+++ swig/csharp/tests/test01.cs 2013-03-27 00:40:33 +0000
1579@@ -14,8 +14,6 @@
1580 * limitations under the License.
1581 */
1582 using System;
1583-using System.Collections.Generic;
1584-using System.Linq;
1585 using System.Text;
1586 using org.zorbaxquery.api;
1587
1588
1589=== added file 'swig/csharp/tests/test09.cs'
1590--- swig/csharp/tests/test09.cs 1970-01-01 00:00:00 +0000
1591+++ swig/csharp/tests/test09.cs 2013-03-27 00:40:33 +0000
1592@@ -0,0 +1,95 @@
1593+/*
1594+ * Copyright 2006-2012 The FLWOR Foundation.
1595+ *
1596+ * Licensed under the Apache License, Version 2.0 (the "License");
1597+ * you may not use this file except in compliance with the License.
1598+ * You may obtain a copy of the License at
1599+ *
1600+ * http://www.apache.org/licenses/LICENSE-2.0
1601+ *
1602+ * Unless required by applicable law or agreed to in writing, software
1603+ * distributed under the License is distributed on an "AS IS" BASIS,
1604+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1605+ * See the License for the specific language governing permissions and
1606+ * limitations under the License.
1607+ */
1608+using System;
1609+using System.Text;
1610+using org.zorbaxquery.api;
1611+
1612+namespace ZorbaApplication
1613+{
1614+
1615+ class MyDiagnosticHandler : DiagnosticHandler {
1616+ public override void error(ZorbaException exception) {
1617+ System.Console.WriteLine("Exception catched in MyDiagnosticHandler");
1618+ System.Console.WriteLine("Description: " + exception.getDescription());
1619+ }
1620+ }
1621+
1622+ class Program
1623+ {
1624+ static String test(String query) {
1625+ MyDiagnosticHandler diagnosticHandler = new MyDiagnosticHandler();
1626+
1627+ InMemoryStore store = InMemoryStore.getInstance();
1628+ Zorba zorba = Zorba.getInstance(store);
1629+
1630+ XQuery xquery = zorba.compileQuery(query, diagnosticHandler);
1631+
1632+ StringBuilder sbuilder = new StringBuilder();
1633+ sbuilder.Append(xquery.execute());
1634+
1635+ xquery.destroy();
1636+ xquery.Dispose();
1637+
1638+ zorba.shutdown();
1639+ InMemoryStore.shutdown(store);
1640+
1641+ return sbuilder.ToString();
1642+ }
1643+
1644+ static void Main(string[] args)
1645+ {
1646+ System.Console.WriteLine("Running: Compile query string using JSONiq");
1647+
1648+ String query = @"
1649+ let $sats:=jn:json-doc('@CSharpPath@/tests/satellites.json')('satellites')
1650+ return {
1651+ 'visible' : [
1652+ for $sat in jn:keys($sats)
1653+ where $sats($sat)('visible')
1654+ return $sat
1655+ ],
1656+ 'invisible' : [
1657+ for $sat in jn:keys($sats)
1658+ where not($sats($sat)('visible'))
1659+ return $sat
1660+ ]
1661+ }
1662+ ";
1663+
1664+ String testResult = "{ \"visible\" : [ \"AJISAI (EGS)\", \"AKARI (ASTRO-F)\" ], \"invisible\" : [ \"AAU CUBESAT\" ] }";
1665+ System.Console.WriteLine("Query: " + query);
1666+ String result;
1667+ try {
1668+ result = test(query);
1669+ } catch(Exception e) {
1670+ System.Console.WriteLine("Failed");
1671+ Console.WriteLine("{0} Exception caught.", e);
1672+ return;
1673+ }
1674+
1675+ System.Console.WriteLine("Expecting: " + testResult);
1676+ System.Console.WriteLine("Result: " + result);
1677+
1678+ if (result.Equals(testResult)) {
1679+ System.Console.WriteLine("Success");
1680+ } else {
1681+ System.Console.WriteLine("Failed");
1682+ }
1683+
1684+
1685+ }
1686+ }
1687+}
1688
1689=== added file 'swig/csharp/tests/test10.cs'
1690--- swig/csharp/tests/test10.cs 1970-01-01 00:00:00 +0000
1691+++ swig/csharp/tests/test10.cs 2013-03-27 00:40:33 +0000
1692@@ -0,0 +1,86 @@
1693+/*
1694+ * Copyright 2006-2012 The FLWOR Foundation.
1695+ *
1696+ * Licensed under the Apache License, Version 2.0 (the "License");
1697+ * you may not use this file except in compliance with the License.
1698+ * You may obtain a copy of the License at
1699+ *
1700+ * http://www.apache.org/licenses/LICENSE-2.0
1701+ *
1702+ * Unless required by applicable law or agreed to in writing, software
1703+ * distributed under the License is distributed on an "AS IS" BASIS,
1704+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1705+ * See the License for the specific language governing permissions and
1706+ * limitations under the License.
1707+ */
1708+using System;
1709+using System.Text;
1710+using org.zorbaxquery.api;
1711+
1712+namespace ZorbaApplication
1713+{
1714+
1715+ class MyDiagnosticHandler : DiagnosticHandler {
1716+ public override void error(ZorbaException exception) {
1717+ System.Console.WriteLine("Exception catched in MyDiagnosticHandler");
1718+ System.Console.WriteLine("Description: " + exception.getDescription());
1719+ }
1720+ }
1721+
1722+ class Program
1723+ {
1724+ static String test() {
1725+ MyDiagnosticHandler diagnosticHandler = new MyDiagnosticHandler();
1726+
1727+ InMemoryStore store = InMemoryStore.getInstance();
1728+ Zorba zorba = Zorba.getInstance(store);
1729+
1730+ ItemFactory itemFactory = zorba.getItemFactory();
1731+ Item iNull = itemFactory.createJSONNull();
1732+ System.Console.WriteLine( "Creating JSON Item null: " + iNull.serialize());
1733+ iNull.Dispose();
1734+
1735+ Item iNumber = itemFactory.createJSONNumber("5");
1736+ System.Console.WriteLine( "Creating JSON Item number: " + iNumber.serialize() );
1737+ iNumber.Dispose();
1738+
1739+ StringVector sv = new StringVector();
1740+ sv.Add("Hello");
1741+ sv.Add("Zorba");
1742+ sv.Add("Hello");
1743+ sv.Add("Zorba");
1744+ Item iArray = itemFactory.createJSONArray(sv);
1745+ sv.Dispose();
1746+ System.Console.WriteLine( "Creating JSON Item array: " + iArray.serialize() );
1747+ iArray.Dispose();
1748+
1749+ zorba.shutdown();
1750+ InMemoryStore.shutdown(store);
1751+
1752+ return "ok";
1753+ }
1754+
1755+ static void Main(string[] args)
1756+ {
1757+ System.Console.WriteLine("Running: Compile query string using Diagnostic Handler");
1758+
1759+ String testResult = "ok";
1760+ String result;
1761+ try {
1762+ result = test();
1763+ } catch(Exception e) {
1764+ System.Console.WriteLine("Failed");
1765+ Console.WriteLine("{0} Exception caught.", e);
1766+ return;
1767+ }
1768+
1769+ if (result.Equals(testResult)) {
1770+ System.Console.WriteLine("Success");
1771+ } else {
1772+ System.Console.WriteLine("Failed");
1773+ }
1774+
1775+
1776+ }
1777+ }
1778+}
1779
1780=== modified file 'swig/java/CMakeLists.txt'
1781--- swig/java/CMakeLists.txt 2013-02-07 17:24:36 +0000
1782+++ swig/java/CMakeLists.txt 2013-03-27 00:40:33 +0000
1783@@ -32,21 +32,21 @@
1784
1785 SET( CMAKE_SWIG_FLAGS -package org.zorbaxquery.api)
1786
1787- SWIG_ADD_MODULE( lib_zorba_java_api java zorba_api.i )
1788- SWIG_LINK_LIBRARIES( lib_zorba_java_api zorba_simplestore ${JAVA_LIBRARY} )
1789+ SWIG_ADD_MODULE( zorba_api_java java zorba_api.i )
1790+ SWIG_LINK_LIBRARIES( zorba_api_java zorba_simplestore ${JAVA_LIBRARY} )
1791 IF (WIN32)
1792- SET_TARGET_PROPERTIES( lib_zorba_java_api PROPERTIES PROJECT_LABEL "Java" OUTPUT_NAME "zorba_api" FOLDER "APIs")
1793+ SET_TARGET_PROPERTIES( zorba_api_java PROPERTIES PROJECT_LABEL "Java" OUTPUT_NAME "zorba_api" FOLDER "APIs")
1794 ELSE (WIN32)
1795- SET_TARGET_PROPERTIES( lib_zorba_java_api PROPERTIES OUTPUT_NAME "libzorba_api")
1796+ SET_TARGET_PROPERTIES( zorba_api_java PROPERTIES OUTPUT_NAME "libzorba_api")
1797 ENDIF (WIN32)
1798 IF ( APPLE )
1799- SET_TARGET_PROPERTIES( lib_zorba_java_api PROPERTIES SUFFIX .jnilib )
1800+ SET_TARGET_PROPERTIES( zorba_api_java PROPERTIES SUFFIX .jnilib )
1801 ENDIF ( APPLE )
1802
1803 # The following fix was added because of the changes in CMake 2.8, which have the
1804 # result of naming the java binding library "liblibzorba_api.so" instead of "libzorba_api.so"
1805 IF (LINUX OR CYGWIN OR APPLE)
1806- SET_TARGET_PROPERTIES( lib_zorba_java_api PROPERTIES PREFIX "" )
1807+ SET_TARGET_PROPERTIES( zorba_api_java PROPERTIES PREFIX "" )
1808 ENDIF (LINUX OR CYGWIN OR APPLE)
1809
1810 FILE(GLOB ZORBA_API_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/../" "${CMAKE_CURRENT_SOURCE_DIR}/../*.h")
1811@@ -60,7 +60,7 @@
1812 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/${ZORBA_JAVA_EXTRA}" "${CMAKE_CURRENT_BINARY_DIR}/${ZORBA_JAVA_EXTRA}")
1813 ENDFOREACH(ZORBA_JAVA_EXTRA ${ZORBA_JAVA_EXTRAS})
1814
1815- ADD_CUSTOM_COMMAND(TARGET lib_zorba_java_api
1816+ ADD_CUSTOM_COMMAND(TARGET zorba_api_java
1817 POST_BUILD
1818 COMMAND cmake -E echo "Compiling Java files..."
1819 COMMAND ${Java_JAVAC_EXECUTABLE} *.java -d ${CMAKE_CURRENT_BINARY_DIR}
1820@@ -79,12 +79,12 @@
1821
1822 IF ( APPLE )
1823 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${ZORBA_SWIG_LIB_PREFIX}libzorba_api.jnilib DESTINATION ${JAVA_SITEARCH_DIR})
1824- INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/zorba_api.jar DESTINATION ${JAVA_SITEARCH_DIR})
1825+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/zorba_api.jar DESTINATION ${JAVA_SITEARCH_DIR})
1826 ELSE ( APPLE )
1827- IF(NOT WIN32)
1828+ IF(NOT WIN32)
1829 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libzorba_api.so DESTINATION ${JAVA_SITEARCH_DIR})
1830- INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/zorba_api.jar DESTINATION ${JAVA_SITEARCH_DIR})
1831- ELSE(NOT WIN32)
1832+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/zorba_api.jar DESTINATION ${JAVA_SITEARCH_DIR})
1833+ ELSE(NOT WIN32)
1834 IF (MSVC_IDE)
1835 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/zorba_api.dll
1836 DESTINATION share/java
1837@@ -100,7 +100,7 @@
1838 DESTINATION share/java
1839 COMPONENT "java_swig")
1840 ENDIF (MSVC_IDE)
1841- ENDIF(NOT WIN32)
1842+ ENDIF(NOT WIN32)
1843 ENDIF ( APPLE )
1844
1845
1846
1847=== modified file 'swig/php/CMakeLists.txt'
1848--- swig/php/CMakeLists.txt 2013-02-07 17:24:36 +0000
1849+++ swig/php/CMakeLists.txt 2013-03-27 00:40:33 +0000
1850@@ -24,25 +24,32 @@
1851 ADD_DEFINITIONS(-DZEND_WIN32 -DPHP_WIN32 -DZEND_INCLUDE_FULL_WINDOWS_HEADERS -DZEND_DEBUG=0 -DZTS=1)
1852 ENDIF (WIN32)
1853
1854- SWIG_ADD_MODULE (zorba_api php5 zorba_api.i)
1855+ SWIG_ADD_MODULE (zorba_api_php php5 zorba_api.i)
1856
1857 IF (APPLE)
1858- SWIG_LINK_LIBRARIES (zorba_api zorba_simplestore ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
1859+ SWIG_LINK_LIBRARIES (zorba_api_php zorba_simplestore ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
1860 ELSE (APPLE)
1861- SWIG_LINK_LIBRARIES (zorba_api zorba_simplestore)
1862+ SWIG_LINK_LIBRARIES (zorba_api_php zorba_simplestore)
1863 ENDIF (APPLE)
1864
1865+ #fix for library path, using windows backslash causes error
1866 IF (WIN32)
1867 STRING(REGEX REPLACE "\\\\" "/" PHP5_LIBRARY "${PHP5_LIBRARY}")
1868- SWIG_LINK_LIBRARIES (zorba_api ${PHP5_LIBRARY})
1869+ SWIG_LINK_LIBRARIES (zorba_api_php ${PHP5_LIBRARY})
1870 ENDIF (WIN32)
1871
1872 #Copy test to the build folder
1873 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/test.xq" "${CMAKE_CURRENT_BINARY_DIR}/test.xq" COPYONLY)
1874
1875- #Copy
1876+ #Copy alternate files
1877 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/XQueryProcessor.php" "${CMAKE_CURRENT_BINARY_DIR}/Zorba/XQueryProcessor.php" COPYONLY)
1878- CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/zorba_api_wrapper.php" "${CMAKE_CURRENT_BINARY_DIR}/Zorba/zorba_api_wrapper.php" COPYONLY)
1879+ #fix for swig error with wrapper name
1880+ ADD_CUSTOM_COMMAND(
1881+ TARGET zorba_api_php
1882+ POST_BUILD
1883+ COMMAND cmake -E echo "Fixing PHP wrapper..."
1884+ COMMAND cmake -P "${CMAKE_CURRENT_SOURCE_DIR}/postfix.cmake"
1885+ )
1886
1887 FILE(GLOB ZORBA_API_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/../" "${CMAKE_CURRENT_SOURCE_DIR}/../*.h")
1888 FOREACH(ZORBA_API_HEADER ${ZORBA_API_HEADERS})
1889@@ -51,10 +58,14 @@
1890
1891 # The following fix was added because of the changes in CMake 2.8, which have the
1892 # result of naming the java binding library "liblibzorba_api.so" instead of "libzorba_api.so"
1893- SET_TARGET_PROPERTIES( ${SWIG_MODULE_zorba_api_REAL_NAME} PROPERTIES PROJECT_LABEL "PHP" FOLDER "APIs")
1894 IF (LINUX OR CYGWIN OR APPLE)
1895 SET_TARGET_PROPERTIES (${SWIG_MODULE_zorba_api_REAL_NAME} PROPERTIES PREFIX "")
1896 ENDIF (LINUX OR CYGWIN OR APPLE)
1897+
1898+ #set project folder location for IDEs
1899+ SET_TARGET_PROPERTIES(zorba_api_php PROPERTIES PROJECT_LABEL "PHP" FOLDER "APIs")
1900+
1901+ SET_TARGET_PROPERTIES(zorba_api_php PROPERTIES OUTPUT_NAME "zorba_api")
1902
1903 IF (NOT WIN32 OR CYGWIN)
1904 STRING (REPLACE ${CMAKE_INSTALL_PREFIX} "" PHP5_INSTALL_PATH ${PHP5_EXTENSION_DIR})
1905@@ -67,7 +78,7 @@
1906 ${CMAKE_CURRENT_BINARY_DIR}/${ZORBA_SWIG_LIB_PREFIX}zorba_api.so
1907 DESTINATION ${PHP5_INSTALL_PATH}
1908 )
1909- ELSE (NOT WIN32 OR CYGWIN)
1910+ ELSE (NOT WIN32 OR CYGWIN)
1911 IF (MSVC_IDE)
1912 INSTALL ( FILES
1913 ${CMAKE_CURRENT_BINARY_DIR}/Zorba/XQueryProcessor.php
1914@@ -79,7 +90,7 @@
1915 INSTALL ( FILES
1916 ${CMAKE_CURRENT_BINARY_DIR}/Zorba/XQueryProcessor.php
1917 ${CMAKE_CURRENT_BINARY_DIR}/Zorba/zorba_api_wrapper.php
1918- ${CMAKE_CURRENT_BINARY_DIR}/php_zorba_api.dll
1919+ ${CMAKE_CURRENT_BINARY_DIR}/zorba_api.dll
1920 COMPONENT "php_swig"
1921 DESTINATION share/php )
1922 ENDIF (MSVC_IDE)
1923
1924=== modified file 'swig/php/XQueryProcessor.php'
1925--- swig/php/XQueryProcessor.php 2012-01-17 13:30:49 +0000
1926+++ swig/php/XQueryProcessor.php 2013-03-27 00:40:33 +0000
1927@@ -1,5 +1,5 @@
1928 <?php
1929-require_once 'Zorba/zorba_api_wrapper.php';
1930+require_once 'zorba_api_wrapper.php';
1931
1932 class XQueryCompilerException extends Exception{}
1933 class XQueryProcessorException extends Exception{}
1934
1935=== added file 'swig/php/postfix.cmake'
1936--- swig/php/postfix.cmake 1970-01-01 00:00:00 +0000
1937+++ swig/php/postfix.cmake 2013-03-27 00:40:33 +0000
1938@@ -0,0 +1,8 @@
1939+
1940+FILE(READ "${CMAKE_CURRENT_BINARY_DIR}/zorba_api.php" FILE_CONTENT)
1941+STRING(REGEX REPLACE "php_zorba_api.dll" "zorba_api.dll" MODIFIED_FILE_CONTENT "${FILE_CONTENT}")
1942+STRING(REGEX REPLACE "zorba_api.so" "libzorba_api.so" MODIFIED_FILE_CONTENT "${MODIFIED_FILE_CONTENT}")
1943+STRING(REGEX REPLACE "'zorba_api.'" "'libzorba_api.'" MODIFIED_FILE_CONTENT "${MODIFIED_FILE_CONTENT}")
1944+FILE(WRITE "${CMAKE_CURRENT_BINARY_DIR}/zorba_api.php" "${MODIFIED_FILE_CONTENT}")
1945+
1946+CONFIGURE_FILE("${CMAKE_CURRENT_BINARY_DIR}/zorba_api.php" "${CMAKE_CURRENT_BINARY_DIR}/Zorba/zorba_api_wrapper.php" COPYONLY)
1947
1948=== modified file 'swig/php/tests/CMakeLists.txt'
1949--- swig/php/tests/CMakeLists.txt 2013-02-07 17:24:36 +0000
1950+++ swig/php/tests/CMakeLists.txt 2013-03-27 00:40:33 +0000
1951@@ -1,4 +1,4 @@
1952-# Copyright 2006-2011 The FLWOR Foundation.
1953+# Copyright 2006-2013 The FLWOR Foundation.
1954 #
1955 # Licensed under the Apache License, Version 2.0 (the "License");
1956 # you may not use this file except in compliance with the License.
1957@@ -18,69 +18,29 @@
1958 ELSE (MSVC_IDE)
1959 SET(phpExtensionPath ${CMAKE_BINARY_DIR}/swig/php)
1960 ENDIF (MSVC_IDE)
1961-SET(phpIncludePath ${CMAKE_BINARY_DIR}/swig/php)
1962+SET(phpIncludePath ${CMAKE_BINARY_DIR}/swig/php/Zorba)
1963+
1964+IF (WIN32)
1965+ STRING(REGEX REPLACE "/" "\\\\" phpExtensionPath "${phpExtensionPath}")
1966+ STRING(REGEX REPLACE "/" "\\\\" phpPath "${phpPath}")
1967+ STRING(REGEX REPLACE "/" "\\\\" phpIncludePath "${phpIncludePath}")
1968+ENDIF (WIN32)
1969
1970 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/php.ini.in ${CMAKE_CURRENT_BINARY_DIR}/php.ini)
1971-
1972 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/books.xml ${CMAKE_CURRENT_BINARY_DIR}/books.xml COPYONLY)
1973-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/compilerHints.xq ${CMAKE_CURRENT_BINARY_DIR}/compilerHints.xq COPYONLY)
1974-
1975-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test01.php ${CMAKE_CURRENT_BINARY_DIR}/test01.php)
1976-ADD_TEST("php_test01" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test01.php)
1977-SET_TESTS_PROPERTIES("php_test01" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
1978-
1979-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test02.php ${CMAKE_CURRENT_BINARY_DIR}/test02.php)
1980-ADD_TEST("php_test02" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test02.php)
1981-SET_TESTS_PROPERTIES("php_test02" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
1982-
1983-#CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test03.php ${CMAKE_CURRENT_BINARY_DIR}/test03.php)
1984-#ADD_TEST("php_test03" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test03.php)
1985-#SET_TESTS_PROPERTIES("php_test03" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
1986-
1987-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test04.php ${CMAKE_CURRENT_BINARY_DIR}/test04.php)
1988-ADD_TEST("php_test04" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test04.php)
1989-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test04.xq ${CMAKE_CURRENT_BINARY_DIR}/test04.xq COPYONLY)
1990-SET_TESTS_PROPERTIES("php_test04" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
1991-
1992-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test05.php ${CMAKE_CURRENT_BINARY_DIR}/test05.php)
1993-ADD_TEST("php_test05" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test05.php)
1994-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test05.xq ${CMAKE_CURRENT_BINARY_DIR}/test05.xq COPYONLY)
1995-SET_TESTS_PROPERTIES("php_test05" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
1996-
1997-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test06.php ${CMAKE_CURRENT_BINARY_DIR}/test06.php)
1998-ADD_TEST("php_test06" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test06.php)
1999-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test06.xq ${CMAKE_CURRENT_BINARY_DIR}/test06.xq COPYONLY)
2000-SET_TESTS_PROPERTIES("php_test06" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
2001-
2002-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test07.php ${CMAKE_CURRENT_BINARY_DIR}/test07.php)
2003-ADD_TEST("php_test07" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test07.php)
2004-SET_TESTS_PROPERTIES("php_test07" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
2005-
2006-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test08.php ${CMAKE_CURRENT_BINARY_DIR}/test08.php)
2007-ADD_TEST("php_test08" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test08.php)
2008-SET_TESTS_PROPERTIES("php_test08" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
2009-
2010-#CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test09.php ${CMAKE_CURRENT_BINARY_DIR}/test09.php)
2011-#ADD_TEST("php_test09" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test09.php)
2012-#SET_TESTS_PROPERTIES("php_test09" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
2013-
2014-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test10.php ${CMAKE_CURRENT_BINARY_DIR}/test10.php)
2015-ADD_TEST("php_test10" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test10.php)
2016-SET_TESTS_PROPERTIES("php_test10" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
2017-
2018-#CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test11.php ${CMAKE_CURRENT_BINARY_DIR}/test11.php)
2019-#ADD_TEST("php_test11" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test11.php)
2020-#SET_TESTS_PROPERTIES("php_test11" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
2021-
2022-#CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test12.php ${CMAKE_CURRENT_BINARY_DIR}/test12.php)
2023-#ADD_TEST("php_test12" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test12.php)
2024-#SET_TESTS_PROPERTIES("php_test12" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
2025-
2026-#CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test13.php ${CMAKE_CURRENT_BINARY_DIR}/test13.php)
2027-#ADD_TEST("php_test13" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test13.php)
2028-#SET_TESTS_PROPERTIES("php_test13" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
2029-
2030-#CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test14.php ${CMAKE_CURRENT_BINARY_DIR}/test14.php)
2031-#ADD_TEST("php_test14" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} test14.php)
2032-#SET_TESTS_PROPERTIES("php_test14" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
2033-
2034+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/satellites.json ${CMAKE_CURRENT_BINARY_DIR}/satellites.json COPYONLY)
2035+
2036+#copy tests
2037+FILE(GLOB ZORBA_PHP_TESTS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/" "${CMAKE_CURRENT_SOURCE_DIR}/*.php")
2038+FOREACH(ZORBA_PHP_TEST ${ZORBA_PHP_TESTS})
2039+ CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/${ZORBA_PHP_TEST}" "${CMAKE_CURRENT_BINARY_DIR}/${ZORBA_PHP_TEST}")
2040+ STRING(REGEX REPLACE ".php" "" ZORBA_PHP_TEST_NAME "${ZORBA_PHP_TEST}")
2041+ ADD_TEST("php_${ZORBA_PHP_TEST_NAME}" ${PHP5_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} ${ZORBA_PHP_TEST})
2042+ SET_TESTS_PROPERTIES("php_${ZORBA_PHP_TEST_NAME}" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
2043+ENDFOREACH(ZORBA_PHP_TEST ${ZORBA_PHP_TESTS})
2044+
2045+#copy additional .xq files
2046+FILE(GLOB ZORBA_PHP_XQS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/" "${CMAKE_CURRENT_SOURCE_DIR}/*.xq")
2047+FOREACH(ZORBA_PHP_XQ ${ZORBA_PHP_XQS})
2048+ CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/${ZORBA_PHP_XQ}" "${CMAKE_CURRENT_BINARY_DIR}/${ZORBA_PHP_XQ}" COPYONLY)
2049+ENDFOREACH(ZORBA_PHP_XQ ${ZORBA_PHP_XQS})
2050
2051=== modified file 'swig/php/tests/php.ini.in'
2052--- swig/php/tests/php.ini.in 2012-03-27 00:56:11 +0000
2053+++ swig/php/tests/php.ini.in 2013-03-27 00:40:33 +0000
2054@@ -1,3 +1,3 @@
2055 enable_dl=On
2056 extension_dir=@phpExtensionPath@
2057-include_path=".:@phpIncludePath@"
2058\ No newline at end of file
2059+include_path="@phpIncludePath@"
2060\ No newline at end of file
2061
2062=== added file 'swig/php/tests/satellites.json'
2063--- swig/php/tests/satellites.json 1970-01-01 00:00:00 +0000
2064+++ swig/php/tests/satellites.json 2013-03-27 00:40:33 +0000
2065@@ -0,0 +1,17 @@
2066+{
2067+ "creator" : "Satellites plugin version 0.6.4",
2068+ "satellites" : {
2069+ "AAU CUBESAT" : {
2070+ "tle1" : "1 27846U 03031G 10322.04074654 .00000056 00000-0 45693-4 0 8768",
2071+ "visible" : false
2072+ },
2073+ "AJISAI (EGS)" : {
2074+ "tle1" : "1 16908U 86061A 10321.84797408 -.00000083 00000-0 10000-3 0 3696",
2075+ "visible" : true
2076+ },
2077+ "AKARI (ASTRO-F)" : {
2078+ "tle1" : "1 28939U 06005A 10321.96319841 .00000176 00000-0 48808-4 0 4294",
2079+ "visible" : true
2080+ }
2081+ }
2082+}
2083
2084=== modified file 'swig/php/tests/test01.php'
2085--- swig/php/tests/test01.php 2012-03-27 00:56:11 +0000
2086+++ swig/php/tests/test01.php 2013-03-27 00:40:33 +0000
2087@@ -15,7 +15,7 @@
2088 * limitations under the License.
2089 */
2090
2091-require '@phpPath@/Zorba/zorba_api_wrapper.php';
2092+require 'zorba_api_wrapper.php';
2093
2094 print "Running: Get zorba instance and shutdown\n";
2095
2096
2097=== modified file 'swig/php/tests/test02.php'
2098--- swig/php/tests/test02.php 2012-03-27 00:56:11 +0000
2099+++ swig/php/tests/test02.php 2013-03-27 00:40:33 +0000
2100@@ -15,7 +15,7 @@
2101 * limitations under the License.
2102 */
2103
2104-require '@phpPath@/Zorba/zorba_api_wrapper.php';
2105+require 'zorba_api_wrapper.php';
2106
2107 function test(Zorba $aZorba) {
2108 $lQuery = $aZorba->compileQuery("(1,2,3,4,5)");
2109
2110=== removed file 'swig/php/tests/test03.php'
2111--- swig/php/tests/test03.php 2012-03-27 00:56:11 +0000
2112+++ swig/php/tests/test03.php 1970-01-01 00:00:00 +0000
2113@@ -1,48 +0,0 @@
2114-<?
2115-/*
2116- * Copyright 2006-2012 The FLWOR Foundation.
2117- *
2118- * Licensed under the Apache License, Version 2.0 (the "License");
2119- * you may not use this file except in compliance with the License.
2120- * You may obtain a copy of the License at
2121- *
2122- * http://www.apache.org/licenses/LICENSE-2.0
2123- *
2124- * Unless required by applicable law or agreed to in writing, software
2125- * distributed under the License is distributed on an "AS IS" BASIS,
2126- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2127- * See the License for the specific language governing permissions and
2128- * limitations under the License.
2129- */
2130-
2131-require '@phpPath@/Zorba/zorba_api_wrapper.php';
2132-
2133-class MyDiagnosticHandler(DiagnosticHandler handler) {
2134- funtion error(self, *args) {
2135- print "Error args: ", args;
2136- }
2137-}
2138-
2139-function test(Zorba $aZorba)
2140-{
2141- diagnosticHandler = MyDiagnosticHandler()
2142- try {
2143- xquery = zorba.compileQuery("1 div 0", diagnosticHandler);
2144- print xquery.execute()
2145- } catch (Exception e) {
2146- print "Caught error: ";
2147- }
2148- return
2149-}
2150-
2151-$store = InMemoryStore::getInstance();
2152-$zorba = Zorba::getInstance($store);
2153-
2154-print "Running: Compile query string using Diagnostic Handler"
2155-test($zorba);
2156-print "Success";
2157-
2158-$zorba->shutdown();
2159-InMemoryStore::shutdown($store);
2160-
2161-?>
2162\ No newline at end of file
2163
2164=== added file 'swig/php/tests/test03.php.disabled'
2165--- swig/php/tests/test03.php.disabled 1970-01-01 00:00:00 +0000
2166+++ swig/php/tests/test03.php.disabled 2013-03-27 00:40:33 +0000
2167@@ -0,0 +1,52 @@
2168+<?
2169+/*
2170+ * Copyright 2006-2013 The FLWOR Foundation.
2171+ *
2172+ * Licensed under the Apache License, Version 2.0 (the "License");
2173+ * you may not use this file except in compliance with the License.
2174+ * You may obtain a copy of the License at
2175+ *
2176+ * http://www.apache.org/licenses/LICENSE-2.0
2177+ *
2178+ * Unless required by applicable law or agreed to in writing, software
2179+ * distributed under the License is distributed on an "AS IS" BASIS,
2180+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2181+ * See the License for the specific language governing permissions and
2182+ * limitations under the License.
2183+ */
2184+
2185+require 'zorba_api_wrapper.php';
2186+
2187+class MyDiagnosticHandler extends DiagnosticHandler {
2188+ public function error($args) {
2189+ print "Error caught in DiagnosticHandler: " . $args->getDescription() . "\n";
2190+ }
2191+}
2192+
2193+function test(Zorba $aZorba)
2194+{
2195+ $diagnosticHandler = new MyDiagnosticHandler();
2196+ try {
2197+ $xquery = $aZorba->compileQuery("1 div 0", $diagnosticHandler);
2198+ $xquery->execute();
2199+ } catch (ZorbaException $e) {
2200+ print "Caught unexpected Zorba error: " . $e->getDescription();
2201+ exit();
2202+ } catch (Exception $e) {
2203+ print "Caught error: " . $e;
2204+ exit();
2205+ }
2206+ return;
2207+}
2208+
2209+$store = InMemoryStore::getInstance();
2210+$zorba = Zorba::getInstance($store);
2211+
2212+print "Running: Compile query string using Diagnostic Handler\n";
2213+test($zorba);
2214+print "Success\n";
2215+
2216+$zorba->shutdown();
2217+InMemoryStore::shutdown($store);
2218+
2219+?>
2220
2221=== modified file 'swig/php/tests/test04.php'
2222--- swig/php/tests/test04.php 2012-03-27 00:56:11 +0000
2223+++ swig/php/tests/test04.php 2013-03-27 00:40:33 +0000
2224@@ -15,7 +15,7 @@
2225 * limitations under the License.
2226 */
2227
2228-require '@phpPath@/Zorba/zorba_api_wrapper.php';
2229+require 'zorba_api_wrapper.php';
2230
2231 function test(Zorba $aZorba) {
2232 #Read and write result
2233
2234=== modified file 'swig/php/tests/test05.php'
2235--- swig/php/tests/test05.php 2012-03-27 00:56:11 +0000
2236+++ swig/php/tests/test05.php 2013-03-27 00:40:33 +0000
2237@@ -15,7 +15,7 @@
2238 * limitations under the License.
2239 */
2240
2241-require '@phpPath@/Zorba/zorba_api_wrapper.php';
2242+require 'zorba_api_wrapper.php';
2243
2244 function test(Zorba $aZorba) {
2245 #Read and write result
2246
2247=== modified file 'swig/php/tests/test06.php'
2248--- swig/php/tests/test06.php 2012-03-27 00:56:11 +0000
2249+++ swig/php/tests/test06.php 2013-03-27 00:40:33 +0000
2250@@ -15,7 +15,7 @@
2251 * limitations under the License.
2252 */
2253
2254-require '@phpPath@/Zorba/zorba_api_wrapper.php';
2255+require 'zorba_api_wrapper.php';
2256
2257 function test(Zorba $aZorba) {
2258 #Read and write result
2259
2260=== modified file 'swig/php/tests/test07.php'
2261--- swig/php/tests/test07.php 2012-03-27 00:56:11 +0000
2262+++ swig/php/tests/test07.php 2013-03-27 00:40:33 +0000
2263@@ -15,7 +15,7 @@
2264 * limitations under the License.
2265 */
2266
2267-require '@phpPath@/Zorba/zorba_api_wrapper.php';
2268+require 'zorba_api_wrapper.php';
2269
2270 function test(Zorba $aZorba) {
2271 $filename = 'books.xml';
2272
2273=== modified file 'swig/php/tests/test08.php'
2274--- swig/php/tests/test08.php 2012-03-27 00:56:11 +0000
2275+++ swig/php/tests/test08.php 2013-03-27 00:40:33 +0000
2276@@ -15,7 +15,7 @@
2277 * limitations under the License.
2278 */
2279
2280-require '@phpPath@/Zorba/zorba_api_wrapper.php';
2281+require 'zorba_api_wrapper.php';
2282
2283 function println($string) {
2284 print $string."\n";
2285
2286=== modified file 'swig/php/tests/test09.php'
2287--- swig/php/tests/test09.php 2012-03-27 00:56:11 +0000
2288+++ swig/php/tests/test09.php 2013-03-27 00:40:33 +0000
2289@@ -15,66 +15,29 @@
2290 * limitations under the License.
2291 */
2292
2293-require '@phpPath@/Zorba/zorba_api_wrapper.php';
2294+require 'zorba_api_wrapper.php';
2295
2296 function test(Zorba $aZorba) {
2297- $xquery = $aZorba->compileQuery("<a>text-a1<b at1='att1' at2='{1+2}'>text-b1</b>text-a2</a>");
2298-
2299-
2300- $saxHandler = new SAX2ContentHandlerProxy();
2301- $saxHandler->setStartDocumentHandler(startDocumentHandler);
2302- $saxHandler->setEndDocumentHandler(endDocumentHandler);
2303- $saxHandler->setStartElementHandler(startElementHandler);
2304- $saxHandler->setEndElementHandler(endElementHandler);
2305- $saxHandler->setCharactersHandler(charactersHandler);
2306- $saxHandler->setProcessingInstructionHandler(processingInstructionHandler);
2307- $saxHandler->setIgnorableWhitespaceHandler(ignorableWhitespaceHandler);
2308- $saxHandler->setStartPrefixMappingHandler(startPrefixMappingHandler);
2309- $saxHandler->setEndPrefixMappingHandler(endPrefixMappingHandler);
2310- $saxHandler->setSkippedEntityHandler(skippedEntityHandler);
2311- $xquery->executeSAX($saxHandler);
2312-
2313- return;
2314-}
2315-
2316-function startDocumentHandler() {
2317- print "Start Document";
2318- return;
2319-}
2320-function endDocumentHandler() {
2321- print "End Document";
2322- return;
2323-}
2324-function startElementHandler($URI, $localName, $QName, $SAXAttributes) {
2325- print "Start Element - " . $QName;
2326- return;
2327-}
2328-function endElementHandler($URI, $localName, $QName) {
2329- print "End Element - " . $QName;
2330- return;
2331-}
2332-function charactersHandler($text) {
2333- print "Characters - " . $text;
2334- return;
2335-}
2336-function processingInstructionHandler($target, $data) {
2337- print "Processing Instruction";
2338- return;
2339-}
2340-function ignorableWhitespaceHandler($text) {
2341- print "Ignorable Whitespace - " . $text;
2342- return;
2343-}
2344-function startPrefixMappingHandler($prefix, $URI) {
2345- print "Start Prefix Mapping - " . $prefix;
2346- return;
2347-}
2348-function endPrefixMappingHandler($prefix) {
2349- print "End Prefix Mapping - " . $prefix;
2350- return;
2351-}
2352-function skippedEntityHandler($name) {
2353- print "Skipped Entity - " . $name;
2354+ $filename = 'books.xml';
2355+ $f = fopen($filename, 'r');
2356+ $contents = fread($f, filesize($filename));
2357+ fclose($f);
2358+
2359+ $dataManager = $aZorba->getXmlDataManager();
2360+ $docIter = $dataManager->parseXML($contents);
2361+ $docIter->open();
2362+
2363+ $doc = Item::createEmptyItem();
2364+ $docIter->next($doc);
2365+
2366+ $docIter->close();
2367+ $docIter->destroy();
2368+
2369+ $xquery = $aZorba->compileQuery(".");
2370+ $dynCtx = $xquery->getDynamicContext();
2371+ $dynCtx->setContextItem($doc);
2372+ print $xquery->execute()."\n";
2373+
2374 return;
2375 }
2376
2377@@ -82,7 +45,7 @@
2378 $store = InMemoryStore::getInstance();
2379 $zorba = Zorba::getInstance($store);
2380
2381-print "Running: XQuery execute - executeSAX\n";
2382+print "Running: XQuery execute - Get Iterator and print info from its items\n";
2383 test($zorba);
2384 print "Success";
2385
2386
2387=== modified file 'swig/php/tests/test10.php'
2388--- swig/php/tests/test10.php 2012-03-27 00:56:11 +0000
2389+++ swig/php/tests/test10.php 2013-03-27 00:40:33 +0000
2390@@ -1,6 +1,6 @@
2391 <?
2392 /*
2393- * Copyright 2006-2012 The FLWOR Foundation.
2394+ * Copyright 2006-2013 The FLWOR Foundation.
2395 *
2396 * Licensed under the Apache License, Version 2.0 (the "License");
2397 * you may not use this file except in compliance with the License.
2398@@ -15,41 +15,53 @@
2399 * limitations under the License.
2400 */
2401
2402-require '@phpPath@/Zorba/zorba_api_wrapper.php';
2403-
2404-function test(Zorba $aZorba) {
2405- $filename = 'books.xml';
2406- $f = fopen($filename, 'r');
2407- $contents = fread($f, filesize($filename));
2408- fclose($f);
2409-
2410- $dataManager = $aZorba->getXmlDataManager();
2411- $docIter = $dataManager->parseXML($contents);
2412- $docIter->open();
2413-
2414- $doc = Item::createEmptyItem();
2415- $docIter->next($doc);
2416-
2417- $docIter->close();
2418- $docIter->destroy();
2419-
2420- $xquery = $aZorba->compileQuery(".");
2421- $dynCtx = $xquery->getDynamicContext();
2422- $dynCtx->setContextItem($doc);
2423- print $xquery->execute()."\n";
2424-
2425+require 'zorba_api_wrapper.php';
2426+
2427+class MyDiagnosticHandler extends DiagnosticHandler {
2428+ public function error($args) {
2429+ print "Error caught in DiagnosticHandler: " . $args->getDescription() . "\n";
2430+ }
2431+}
2432+
2433+function test(Zorba $aZorba, $query)
2434+{
2435+ $diagnosticHandler = new MyDiagnosticHandler();
2436+ $xquery = $aZorba->compileQuery($query, $diagnosticHandler);
2437+ try {
2438+ print $xquery->execute();
2439+ } catch (Exception $e) {
2440+ print "Caught error: " . $e;
2441+ exit();
2442+ }
2443+ $xquery->destroy();
2444 return;
2445 }
2446
2447-
2448 $store = InMemoryStore::getInstance();
2449 $zorba = Zorba::getInstance($store);
2450
2451-print "Running: XQuery execute - Get Iterator and print info from its items\n";
2452-test($zorba);
2453-print "Success";
2454+print "Running: Compile query string using JSONiq \n";
2455+
2456+$query = <<<'eoquery'
2457+ let $sats:=jn:json-doc("@phpPath@/tests/satellites.json")('satellites')
2458+ return {
2459+ 'visible' : [
2460+ for $sat in jn:keys($sats)
2461+ where $sats($sat)('visible')
2462+ return $sat
2463+ ],
2464+ 'invisible' : [
2465+ for $sat in jn:keys($sats)
2466+ where not($sats($sat)('visible'))
2467+ return $sat
2468+ ]
2469+ }
2470+eoquery;
2471+
2472+test($zorba, $query);
2473+print "Success\n";
2474
2475 $zorba->shutdown();
2476 InMemoryStore::shutdown($store);
2477
2478-?>
2479\ No newline at end of file
2480+?>
2481
2482=== modified file 'swig/php/tests/test11.php'
2483--- swig/php/tests/test11.php 2013-02-07 17:24:36 +0000
2484+++ swig/php/tests/test11.php 2013-03-27 00:40:33 +0000
2485@@ -1,6 +1,6 @@
2486 <?
2487 /*
2488- * Copyright 2006-2012 The FLWOR Foundation.
2489+ * Copyright 2006-2013 The FLWOR Foundation.
2490 *
2491 * Licensed under the Apache License, Version 2.0 (the "License");
2492 * you may not use this file except in compliance with the License.
2493@@ -15,34 +15,45 @@
2494 * limitations under the License.
2495 */
2496
2497-require '@phpPath@/Zorba/zorba_api_wrapper.php';
2498+require 'zorba_api_wrapper.php';
2499
2500-class MyDiagnosticHandler(DiagnosticHandler handler) {
2501- funtion error(self, *args) {
2502- print "Error args: ", args;
2503+class MyDiagnosticHandler extends DiagnosticHandler {
2504+ public function error($args) {
2505+ print "Error caught in DiagnosticHandler: " . $args->getDescription() . "\n";
2506 }
2507 }
2508
2509 function test(Zorba $aZorba)
2510 {
2511- diagnosticHandler = MyDiagnosticHandler()
2512+ $diagnosticHandler = new MyDiagnosticHandler();
2513 try {
2514- xquery = zorba.compileQuery("1 div 0", diagnosticHandler);
2515- print xquery.execute()
2516- } catch (Exception e) {
2517- print "Caught error: ";
2518+ $itemFactory = $aZorba->getItemFactory();
2519+ print "Creating JSON Item null: ". $itemFactory->createJSONNull()->serialize() . "\n";
2520+ print "Creating JSON Item number: ". $itemFactory->createJSONNumber("5")->serialize() . "\n";
2521+ $sv = new StringVector(4);
2522+ $sv->set(0, "Hello");
2523+ $sv->set(1, "Zorba");
2524+ $sv->set(2, "Hello");
2525+ $sv->set(3, "Zorba");
2526+ print "Creating JSON Item array: ". $itemFactory->createJSONArray($sv)->serialize() . "\n";
2527+ print "Success";
2528+ } catch (ZorbaException $e) {
2529+ print "Caught unexpected Zorba error: " . $e->getDescription() . "\n" ;
2530+ exit();
2531+ } catch (Exception $e) {
2532+ print "Caught error: " . $e . "\n";
2533+ exit();
2534 }
2535- return
2536+ return;
2537 }
2538
2539 $store = InMemoryStore::getInstance();
2540 $zorba = Zorba::getInstance($store);
2541
2542-print "Running: Compile query string using Diagnostic Handler"
2543+print "Running: Compile query string using Diagnostic Handler\n";
2544 test($zorba);
2545-print "Success";
2546
2547 $zorba->shutdown();
2548 InMemoryStore::shutdown($store);
2549
2550-?>
2551\ No newline at end of file
2552+?>
2553
2554=== removed file 'swig/php/tests/test12.php'
2555--- swig/php/tests/test12.php 2012-03-27 00:56:11 +0000
2556+++ swig/php/tests/test12.php 1970-01-01 00:00:00 +0000
2557@@ -1,52 +0,0 @@
2558-<?
2559-/*
2560- * Copyright 2006-2012 The FLWOR Foundation.
2561- *
2562- * Licensed under the Apache License, Version 2.0 (the "License");
2563- * you may not use this file except in compliance with the License.
2564- * You may obtain a copy of the License at
2565- *
2566- * http://www.apache.org/licenses/LICENSE-2.0
2567- *
2568- * Unless required by applicable law or agreed to in writing, software
2569- * distributed under the License is distributed on an "AS IS" BASIS,
2570- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2571- * See the License for the specific language governing permissions and
2572- * limitations under the License.
2573- */
2574-
2575-//require '@phpPath@/Zorba/zorba_api_wrapper.php';
2576-require 'C:/dev/zapi/build/swig/php/Zorba/zorba_api_wrapper.php';
2577-
2578-class MyDiagnosticHandler(zorba_api.DiagnosticHandler):
2579- def error(self, *args):
2580- print "Error args: ", args
2581-
2582-def test(zorba):
2583- #Read and write result
2584- print 'Executing: compilerHints.xq'
2585- f = open('compilerHints.xq', 'r')
2586- lines = f.read()
2587- f.close()
2588- diagnosticHandler = MyDiagnosticHandler()
2589- compilerHints = zorba_api.CompilerHints()
2590- compilerHints.setOptimizationLevel(1)
2591- xquery = zorba.compileQuery(lines, compilerHints, diagnosticHandler)
2592-
2593- result = xquery.execute()
2594- print result
2595- return
2596-
2597-
2598-store = zorba_api.InMemoryStore_getInstance()
2599-zorba = zorba_api.Zorba_getInstance(store)
2600-
2601-print "Running: CompileQuery string + Dignostinc handler + CompilerHint - with optimization 1"
2602-test(zorba)
2603-print "Success"
2604-
2605-
2606-zorba.shutdown()
2607-zorba_api.InMemoryStore_shutdown(store)
2608-
2609-?>
2610\ No newline at end of file
2611
2612=== removed file 'swig/php/tests/test13.php'
2613--- swig/php/tests/test13.php 2012-03-27 00:56:11 +0000
2614+++ swig/php/tests/test13.php 1970-01-01 00:00:00 +0000
2615@@ -1,53 +0,0 @@
2616-<?
2617-/*
2618- * Copyright 2006-2012 The FLWOR Foundation.
2619- *
2620- * Licensed under the Apache License, Version 2.0 (the "License");
2621- * you may not use this file except in compliance with the License.
2622- * You may obtain a copy of the License at
2623- *
2624- * http://www.apache.org/licenses/LICENSE-2.0
2625- *
2626- * Unless required by applicable law or agreed to in writing, software
2627- * distributed under the License is distributed on an "AS IS" BASIS,
2628- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2629- * See the License for the specific language governing permissions and
2630- * limitations under the License.
2631- */
2632-
2633-//require '@phpPath@/Zorba/zorba_api_wrapper.php';
2634-require 'C:/dev/zapi/build/swig/php/Zorba/zorba_api_wrapper.php';
2635-
2636-class MyDiagnosticHandler(zorba_api.DiagnosticHandler):
2637- def error(self, *args):
2638- print "Error args: ", args
2639-
2640-def test(zorba):
2641- #Read and write result
2642- print 'Executing: compilerHints.xq'
2643- f = open('compilerHints.xq', 'r')
2644- lines = f.read()
2645- f.close()
2646- diagnosticHandler = MyDiagnosticHandler()
2647- compilerHints = zorba_api.CompilerHints()
2648- compilerHints.setLibModule(True)
2649- compilerHints.setOptimizationLevel(0)
2650- xquery = zorba.compileQuery(lines, compilerHints, diagnosticHandler)
2651-
2652- result = xquery.execute()
2653- print result
2654- return
2655-
2656-
2657-store = zorba_api.InMemoryStore_getInstance()
2658-zorba = zorba_api.Zorba_getInstance(store)
2659-
2660-print "Running: CompileQuery string + Dignostinc handler + CompilerHint - with optimization 0 - setLibModule(True)"
2661-test(zorba)
2662-print "Success"
2663-
2664-
2665-zorba.shutdown()
2666-zorba_api.InMemoryStore_shutdown(store)
2667-
2668-?>
2669\ No newline at end of file
2670
2671=== removed file 'swig/php/tests/test14.php'
2672--- swig/php/tests/test14.php 2012-03-27 00:56:11 +0000
2673+++ swig/php/tests/test14.php 1970-01-01 00:00:00 +0000
2674@@ -1,53 +0,0 @@
2675-<?
2676-/*
2677- * Copyright 2006-2012 The FLWOR Foundation.
2678- *
2679- * Licensed under the Apache License, Version 2.0 (the "License");
2680- * you may not use this file except in compliance with the License.
2681- * You may obtain a copy of the License at
2682- *
2683- * http://www.apache.org/licenses/LICENSE-2.0
2684- *
2685- * Unless required by applicable law or agreed to in writing, software
2686- * distributed under the License is distributed on an "AS IS" BASIS,
2687- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2688- * See the License for the specific language governing permissions and
2689- * limitations under the License.
2690- */
2691-
2692-//require '@phpPath@/Zorba/zorba_api_wrapper.php';
2693-require 'C:/dev/zapi/build/swig/php/Zorba/zorba_api_wrapper.php';
2694-
2695-class MyDiagnosticHandler(zorba_api.DiagnosticHandler):
2696- def error(self, *args):
2697- print "Error args: ", args
2698-
2699-def test(zorba):
2700- #Read and write result
2701- print 'Executing: compilerHints.xq'
2702- f = open('compilerHints.xq', 'r')
2703- lines = f.read()
2704- f.close()
2705- diagnosticHandler = MyDiagnosticHandler()
2706- compilerHints = zorba_api.CompilerHints()
2707- compilerHints.setLibModule(True)
2708- compilerHints.setOptimizationLevel(1)
2709- xquery = zorba.compileQuery(lines, compilerHints, diagnosticHandler)
2710-
2711- result = xquery.execute()
2712- print result
2713- return
2714-
2715-
2716-store = zorba_api.InMemoryStore_getInstance()
2717-zorba = zorba_api.Zorba_getInstance(store)
2718-
2719-print "Running: CompileQuery string + Dignostinc handler + CompilerHint - with optimization 1 - setLibModule(True)"
2720-test(zorba)
2721-print "Success"
2722-
2723-
2724-zorba.shutdown()
2725-zorba_api.InMemoryStore_shutdown(store)
2726-
2727-?>
2728\ No newline at end of file
2729
2730=== removed file 'swig/php/tests/zorba_api.php'
2731--- swig/php/tests/zorba_api.php 2012-03-27 00:56:11 +0000
2732+++ swig/php/tests/zorba_api.php 1970-01-01 00:00:00 +0000
2733@@ -1,178 +0,0 @@
2734-<?php
2735-/*
2736- * Copyright 2006-2012 The FLWOR Foundation.
2737- *
2738- * Licensed under the Apache License, Version 2.0 (the "License");
2739- * you may not use this file except in compliance with the License.
2740- * You may obtain a copy of the License at
2741- *
2742- * http://www.apache.org/licenses/LICENSE-2.0
2743- *
2744- * Unless required by applicable law or agreed to in writing, software
2745- * distributed under the License is distributed on an "AS IS" BASIS,
2746- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2747- * See the License for the specific language governing permissions and
2748- * limitations under the License.
2749- */
2750-
2751-// Try to load our extension if it's not already loaded.
2752-if (!extension_loaded("zorba_api")) {
2753- if (strtolower(substr(PHP_OS, 0, 3)) === 'win') {
2754- if (!dl('zorba_api.dll')) return;
2755- } else {
2756- // PHP_SHLIB_SUFFIX is available as of PHP 4.3.0, for older PHP assume 'so'.
2757- // It gives 'dylib' on MacOS X which is for libraries, modules are 'so'.
2758- if (PHP_SHLIB_SUFFIX === 'PHP_SHLIB_SUFFIX' || PHP_SHLIB_SUFFIX === 'dylib') {
2759- if (!dl('zorba_api.so')) return;
2760- } else {
2761- if (!dl('zorba_api.'.PHP_SHLIB_SUFFIX)) return;
2762- }
2763- }
2764-}
2765-
2766-class Item {
2767- public $_cPtr=null;
2768-
2769- static function createEmptyItem() {
2770- $r=Item_createEmptyItem();
2771- return is_resource($r) ? new Item($r) : $r;
2772- }
2773-
2774- function getStringValue() {
2775- return Item_getStringValue($this->_cPtr);
2776- }
2777-
2778- function __construct() {
2779- $this->_cPtr=new_Item();
2780- }
2781-}
2782-
2783-class Iterator {
2784- public $_cPtr=null;
2785-
2786- function open() {
2787- Iterator_open($this->_cPtr);
2788- }
2789-
2790- function next($arg1) {
2791- return Iterator_next($this->_cPtr,$arg1);
2792- }
2793-
2794- function close() {
2795- Iterator_close($this->_cPtr);
2796- }
2797-
2798- function destroy() {
2799- Iterator_destroy($this->_cPtr);
2800- }
2801-
2802- function __construct($cPtr) {
2803- $this->_cPtr=$cPtr;
2804- }
2805-
2806- public function __destruct() {
2807- $this->destroy();
2808- }
2809-}
2810-
2811-class XQuery {
2812- public $_cPtr=null;
2813-
2814- function execute() {
2815- return XQuery_execute($this->_cPtr);
2816- }
2817-
2818- function isUpdateQuery() {
2819- return XQuery_isUpdateQuery($this->_cPtr);
2820- }
2821-
2822- function applyUpdates() {
2823- XQuery_applyUpdates($this->_cPtr);
2824- }
2825-
2826- function destroy() {
2827- XQuery_destroy($this->_cPtr);
2828- }
2829-
2830- function iterator() {
2831- $r=XQuery_iterator($this->_cPtr);
2832- return is_resource($r) ? new Iterator($r) : $r;
2833- }
2834-
2835- function __construct($cPtr) {
2836- $this->_cPtr=$cPtr;
2837- }
2838-
2839- function __destruct() {
2840- $this->destroy();
2841- }
2842-}
2843-
2844-class Store {
2845- //public $_cPtr=null;
2846-
2847- //function __construct() {
2848- // $this->_cPtr=new_Store();
2849- //}
2850-}
2851-
2852-class InMemoryStore extends Store {
2853- public $_cPtr=null;
2854-
2855- static function getInstance() {
2856- $r=InMemoryStore_getInstance();
2857- return is_resource($r) ? new InMemoryStore($r) : $r;
2858- }
2859-
2860- static function shutdown($arg1) {
2861- InMemoryStore_shutdown($arg1);
2862- }
2863-
2864- private function __construct($cPtr) {
2865- $this->_cPtr=$cPtr;
2866- }
2867-}
2868-
2869-class XmlDataManager {
2870- public $_cPtr=null;
2871-
2872- function loadDocument($aName,$aContent) {
2873- XmlDataManager_loadDocument($this->_cPtr,$aName,$aContent);
2874- }
2875-
2876- function deleteDocument($aName) {
2877- return XmlDataManager_deleteDocument($this->_cPtr,$aName);
2878- }
2879-
2880- function __construct($cPtr) {
2881- $this->_cPtr=$cPtr;
2882- }
2883-}
2884-
2885-class Zorba {
2886- public $_cPtr=null;
2887-
2888- static function getInstance($arg1) {
2889- $r=Zorba_getInstance($arg1->_cPtr);
2890- return is_resource($r) ? new Zorba($r) : $r;
2891- }
2892-
2893- function compileQuery($aStr) {
2894- $r=Zorba_compileQuery($this->_cPtr,$aStr);
2895- return is_resource($r) ? new XQuery($r) : $r;
2896- }
2897-
2898- function getXmlDataManager() {
2899- $r=Zorba_getXmlDataManager($this->_cPtr);
2900- return is_resource($r) ? new XmlDataManager($r) : $r;
2901- }
2902-
2903- function shutdown() {
2904- Zorba_shutdown($this->_cPtr);
2905- }
2906-
2907- private function __construct($cPtr) {
2908- $this->_cPtr=$cPtr;
2909- }
2910-}
2911-?>
2912
2913=== modified file 'swig/php/zorba_api.i'
2914--- swig/php/zorba_api.i 2013-02-07 17:24:36 +0000
2915+++ swig/php/zorba_api.i 2013-03-27 00:40:33 +0000
2916@@ -13,6 +13,9 @@
2917 * See the License for the specific language governing permissions and
2918 * limitations under the License.
2919 */
2920+
2921+%rename (IteratorImpl) Iterator;
2922+
2923 %begin %{
2924 #include <iostream>
2925
2926@@ -36,8 +39,13 @@
2927 %{
2928 #include "zend_exceptions.h"
2929 %}
2930+
2931+TSRMLS_FETCH();
2932+
2933 %include ../zorba_api.i
2934+
2935 %{
2936+
2937 #define SWIG_exception(code, msg) { mt_zend_throw_exception(0, msg, code TSRMLS_CC); }
2938
2939 ZEND_API zval * mt_zend_throw_exception(zend_class_entry *exception_ce, const char *message, long code TSRMLS_DC);
2940
2941=== removed file 'swig/php/zorba_api_wrapper.php'
2942--- swig/php/zorba_api_wrapper.php 2013-02-07 17:24:36 +0000
2943+++ swig/php/zorba_api_wrapper.php 1970-01-01 00:00:00 +0000
2944@@ -1,1215 +0,0 @@
2945-<?php
2946-//Try to load the extension if it's not already loaded.
2947-if(!extension_loaded('zorba_api')) {
2948- $zorbaExtNotLoaded = "Zorba extension couldn't loaded";
2949- if(function_exists('dl')) {
2950- if(strtolower(substr(PHP_OS, 0, 3)) === 'win') {
2951- if(!dl('zorba_api.dll')) {
2952- throw new Exception($zorbaExtNotLoaded);
2953- }
2954- } else {
2955- $suffix = "so";
2956- if(PHP_SHLIB_SUFFIX === 'PHP_SHLIB_SUFFIX' || PHP_SHLIB_SUFFIX === 'dylib') {
2957- $suffix = PHP_SHLIB_SUFFIX;
2958- }
2959- if(!dl('zorba_api.'.$suffix)) {
2960- if(!dl('libzorba_api.'.$suffix)) {
2961- throw new Exception($zorbaExtNotLoaded);
2962- }
2963- }
2964- }
2965- } else {
2966- throw new Exception($zorbaExtNotLoaded);
2967- }
2968-}
2969-
2970-class DynamicContext{
2971- public $_cPtr=null;
2972-
2973- public function __set($var, $value) {
2974- $r = DynamicContext___set($this->_cPtr, $var, $value);
2975- return $r;
2976-
2977- }
2978-
2979- public function __isset($var) {
2980- $r = DynamicContext___isset($this->_cPtr, $var);
2981- return $r;
2982-
2983- }
2984-
2985- public function __get($var) {
2986- $r = DynamicContext___get($this->_cPtr, $var);
2987- return $r;
2988-
2989- }
2990-
2991- public function setVariable($aNamespace, $aLocalname, $arg3) {
2992- $r = DynamicContext_setVariable($this->_cPtr, $aNamespace, $aLocalname, $arg3);
2993- return $r;
2994-
2995- }
2996-
2997- public function setContextItem($arg1) {
2998- $r = DynamicContext_setContextItem($this->_cPtr, $arg1);
2999- return $r;
3000-
3001- }
3002-
3003- public function __construct($ptr) {
3004- $this->_cPtr = $ptr;
3005- }
3006-
3007-}
3008-
3009-class Item{
3010- public $_cPtr=null;
3011-
3012- public function __set($var, $value) {
3013- $r = Item___set($this->_cPtr, $var, $value);
3014- return $r;
3015-
3016- }
3017-
3018- public function __isset($var) {
3019- $r = Item___isset($this->_cPtr, $var);
3020- return $r;
3021-
3022- }
3023-
3024- public function __get($var) {
3025- $r = Item___get($this->_cPtr, $var);
3026- return $r;
3027-
3028- }
3029-
3030- static public function createEmptyItem() {
3031- $r = Item_createEmptyItem();
3032- return is_resource($r) ? new Item($r) : $r;
3033-
3034- }
3035-
3036- public function getStringValue() {
3037- $r = Item_getStringValue($this->_cPtr);
3038- return $r;
3039-
3040- }
3041-
3042- public function serialize() {
3043- $r = Item_serialize($this->_cPtr);
3044- return $r;
3045-
3046- }
3047-
3048- public function getAtomizationValue() {
3049- $r = Item_getAtomizationValue($this->_cPtr);
3050- return is_resource($r) ? new IteratorImpl($r) : $r;
3051-
3052- }
3053-
3054- public function getAttributes() {
3055- $r = Item_getAttributes($this->_cPtr);
3056- return is_resource($r) ? new IteratorImpl($r) : $r;
3057-
3058- }
3059-
3060- public function getBooleanValue() {
3061- $r = Item_getBooleanValue($this->_cPtr);
3062- return $r;
3063-
3064- }
3065-
3066- public function getChildren() {
3067- $r = Item_getChildren($this->_cPtr);
3068- return is_resource($r) ? new IteratorImpl($r) : $r;
3069-
3070- }
3071-
3072- public function getEBV() {
3073- $r = Item_getEBV($this->_cPtr);
3074- return is_resource($r) ? new Item($r) : $r;
3075-
3076- }
3077-
3078- public function getIntValue() {
3079- $r = Item_getIntValue($this->_cPtr);
3080- return $r;
3081-
3082- }
3083-
3084- public function getLocalName() {
3085- $r = Item_getLocalName($this->_cPtr);
3086- return $r;
3087-
3088- }
3089-
3090- public function getNamespace() {
3091- $r = Item_getNamespace($this->_cPtr);
3092- return $r;
3093-
3094- }
3095-
3096- public function getNodeName($aNodeName) {
3097- $r = Item_getNodeName($this->_cPtr, $aNodeName);
3098- return $r;
3099-
3100- }
3101-
3102- public function getPrefix() {
3103- $r = Item_getPrefix($this->_cPtr);
3104- return $r;
3105-
3106- }
3107-
3108- public function getType() {
3109- $r = Item_getType($this->_cPtr);
3110- return is_resource($r) ? new Item($r) : $r;
3111-
3112- }
3113-
3114- public function getUnsignedIntValue() {
3115- $r = Item_getUnsignedIntValue($this->_cPtr);
3116- return $r;
3117-
3118- }
3119-
3120- public function getNodeKind() {
3121- $r = Item_getNodeKind($this->_cPtr);
3122- return $r;
3123-
3124- }
3125-
3126- public function isAtomic() {
3127- $r = Item_isAtomic($this->_cPtr);
3128- return $r;
3129-
3130- }
3131-
3132- public function isNaN() {
3133- $r = Item_isNaN($this->_cPtr);
3134- return $r;
3135-
3136- }
3137-
3138- public function isNode() {
3139- $r = Item_isNode($this->_cPtr);
3140- return $r;
3141-
3142- }
3143-
3144- public function isNull() {
3145- $r = Item_isNull($this->_cPtr);
3146- return $r;
3147-
3148- }
3149-
3150- public function isPosOrNegInf() {
3151- $r = Item_isPosOrNegInf($this->_cPtr);
3152- return $r;
3153-
3154- }
3155-
3156- public function __construct($ptr) {
3157- $this->_cPtr = $ptr;
3158- }
3159-
3160-}
3161-
3162-class IteratorImpl{
3163- public $_cPtr=null;
3164-
3165- public function __set($var, $value) {
3166- $r = Iterator___set($this->_cPtr, $var, $value);
3167- return $r;
3168-
3169- }
3170-
3171- public function __isset($var) {
3172- $r = Iterator___isset($this->_cPtr, $var);
3173- return $r;
3174-
3175- }
3176-
3177- public function __get($var) {
3178- $r = Iterator___get($this->_cPtr, $var);
3179- return $r;
3180-
3181- }
3182-
3183- public function open() {
3184- $r = Iterator_open($this->_cPtr);
3185- return $r;
3186-
3187- }
3188-
3189- public function next($arg1) {
3190- $r = Iterator_next($this->_cPtr, $arg1);
3191- return $r;
3192-
3193- }
3194-
3195- public function close() {
3196- $r = Iterator_close($this->_cPtr);
3197- return $r;
3198-
3199- }
3200-
3201- public function destroy() {
3202- $r = Iterator_destroy($this->_cPtr);
3203- return $r;
3204-
3205- }
3206-
3207- public function __construct($ptr) {
3208- $this->_cPtr = $ptr;
3209- }
3210-
3211-}
3212-
3213-class XQuery{
3214- public $_cPtr=null;
3215-
3216- public function __set($var, $value) {
3217- $r = XQuery___set($this->_cPtr, $var, $value);
3218- return $r;
3219-
3220- }
3221-
3222- public function __isset($var) {
3223- $r = XQuery___isset($this->_cPtr, $var);
3224- return $r;
3225-
3226- }
3227-
3228- public function __get($var) {
3229- $r = XQuery___get($this->_cPtr, $var);
3230- return $r;
3231-
3232- }
3233-
3234- public function execute() {
3235- $r = XQuery_execute($this->_cPtr);
3236- return $r;
3237-
3238- }
3239-
3240- public function printPlanAsXML() {
3241- $r = XQuery_printPlanAsXML($this->_cPtr);
3242- return $r;
3243-
3244- }
3245-
3246- public function printPlanAsDOT() {
3247- $r = XQuery_printPlanAsDOT($this->_cPtr);
3248- return $r;
3249-
3250- }
3251-
3252- public function compile($aQuery, $aStaticContext=null) {
3253- switch(func_num_args()) {
3254- case 1: $r = XQuery_compile($this->_cPtr, $aQuery);break;
3255- case 2: $r = XQuery_compile($this->_cPtr, $aQuery, $aStaticContext);break;
3256- default: $r = XQuery_compile($this->_cPtr, $aQuery, $aStaticContext);
3257- }
3258- return $r;
3259-
3260- }
3261-
3262- public function destroy() {
3263- $r = XQuery_destroy($this->_cPtr);
3264- return $r;
3265-
3266- }
3267-
3268- public function iterator() {
3269- $r = XQuery_iterator($this->_cPtr);
3270- return is_resource($r) ? new IteratorImpl($r) : $r;
3271-
3272- }
3273-
3274- public function getDynamicContext() {
3275- $r = XQuery_getDynamicContext($this->_cPtr);
3276- return is_resource($r) ? new DynamicContext($r) : $r;
3277-
3278- }
3279-
3280- public function __construct($ptr) {
3281- $this->_cPtr = $ptr;
3282- }
3283-
3284-}
3285-
3286-class Store{
3287- public $_cPtr=null;
3288-
3289- public function __set($var, $value) {
3290- $r = Store___set($this->_cPtr, $var, $value);
3291- return $r;
3292-
3293- }
3294-
3295- public function __isset($var) {
3296- $r = Store___isset($this->_cPtr, $var);
3297- return $r;
3298-
3299- }
3300-
3301- public function __get($var) {
3302- $r = Store___get($this->_cPtr, $var);
3303- return $r;
3304-
3305- }
3306-
3307- public function __construct($ptr) {
3308- $this->_cPtr = $ptr;
3309- }
3310-
3311-}
3312-
3313-class InMemoryStore extends Store{
3314- public $_cPtr=null;
3315-
3316- static public function getInstance() {
3317- $r = InMemoryStore_getInstance();
3318- return is_resource($r) ? new InMemoryStore($r) : $r;
3319-
3320- }
3321-
3322- static public function shutdown($arg1) {
3323- $r = InMemoryStore_shutdown($arg1);
3324- return $r;
3325-
3326- }
3327-
3328-}
3329-
3330-class DocumentManager{
3331- public $_cPtr=null;
3332-
3333- public function __set($var, $value) {
3334- $r = DocumentManager___set($this->_cPtr, $var, $value);
3335- return $r;
3336-
3337- }
3338-
3339- public function __isset($var) {
3340- $r = DocumentManager___isset($this->_cPtr, $var);
3341- return $r;
3342-
3343- }
3344-
3345- public function __get($var) {
3346- $r = DocumentManager___get($this->_cPtr, $var);
3347- return $r;
3348-
3349- }
3350-
3351- public function put($aName, $aDoc) {
3352- $r = DocumentManager_put($this->_cPtr, $aName, $aDoc);
3353- return $r;
3354-
3355- }
3356-
3357- public function remove($aName) {
3358- $r = DocumentManager_remove($this->_cPtr, $aName);
3359- return $r;
3360-
3361- }
3362-
3363- public function document($aName) {
3364- $r = DocumentManager_document($this->_cPtr, $aName);
3365- return is_resource($r) ? new Item($r) : $r;
3366-
3367- }
3368-
3369- public function isAvailableDocument($aName) {
3370- $r = DocumentManager_isAvailableDocument($this->_cPtr, $aName);
3371- return $r;
3372-
3373- }
3374-
3375- public function __construct($ptr) {
3376- $this->_cPtr = $ptr;
3377- }
3378-
3379-}
3380-
3381-class XmlDataManager{
3382- public $_cPtr=null;
3383-
3384- public function __set($var, $value) {
3385- $r = XmlDataManager___set($this->_cPtr, $var, $value);
3386- return $r;
3387-
3388- }
3389-
3390- public function __isset($var) {
3391- $r = XmlDataManager___isset($this->_cPtr, $var);
3392- return $r;
3393-
3394- }
3395-
3396- public function __get($var) {
3397- $r = XmlDataManager___get($this->_cPtr, $var);
3398- return $r;
3399-
3400- }
3401-
3402- public function getDocumentManager() {
3403- $r = XmlDataManager_getDocumentManager($this->_cPtr);
3404- return is_resource($r) ? new DocumentManager($r) : $r;
3405-
3406- }
3407-
3408- public function parseXML($aDoc) {
3409- $r = XmlDataManager_parseXML($this->_cPtr, $aDoc);
3410- return is_resource($r) ? new IteratorImpl($r) : $r;
3411-
3412- }
3413-
3414- public function __construct($ptr) {
3415- $this->_cPtr = $ptr;
3416- }
3417-
3418-}
3419-
3420-class ZorbaException{
3421- public $_cPtr=null;
3422-
3423- public function __set($var, $value) {
3424- $r = ZorbaException___set($this->_cPtr, $var, $value);
3425- return $r;
3426-
3427- }
3428-
3429- public function __isset($var) {
3430- $r = ZorbaException___isset($this->_cPtr, $var);
3431- return $r;
3432-
3433- }
3434-
3435- public function __get($var) {
3436- $r = ZorbaException___get($this->_cPtr, $var);
3437- return $r;
3438-
3439- }
3440-
3441- public function __construct($ptr) {
3442- $this->_cPtr = $ptr;
3443- }
3444-
3445- public function getDescription() {
3446- $r = ZorbaException_getDescription($this->_cPtr);
3447- return $r;
3448-
3449- }
3450-
3451- public function getErrorCode() {
3452- $r = ZorbaException_getErrorCode($this->_cPtr);
3453- return $r;
3454-
3455- }
3456-
3457- public function getFileLineNumber() {
3458- $r = ZorbaException_getFileLineNumber($this->_cPtr);
3459- return $r;
3460-
3461- }
3462-
3463- public function getFileName() {
3464- $r = ZorbaException_getFileName($this->_cPtr);
3465- return $r;
3466-
3467- }
3468-
3469- static public function getErrorCodeAsString($aErrorCode) {
3470- $r = ZorbaException_getErrorCodeAsString($aErrorCode);
3471- return $r;
3472-
3473- }
3474-
3475-}
3476-
3477-class XQueryException extends ZorbaException{
3478- public $_cPtr=null;
3479-
3480- public function getColumnBegin() {
3481- $r = XQueryException_getColumnBegin($this->_cPtr);
3482- return $r;
3483-
3484- }
3485-
3486- public function getLineBegin() {
3487- $r = XQueryException_getLineBegin($this->_cPtr);
3488- return $r;
3489-
3490- }
3491-
3492- public function getQueryURI() {
3493- $r = XQueryException_getQueryURI($this->_cPtr);
3494- return $r;
3495-
3496- }
3497-
3498-}
3499-
3500-class CompilerHints{
3501- public $_cPtr=null;
3502-
3503- public function __set($var, $value) {
3504- $r = CompilerHints___set($this->_cPtr, $var, $value);
3505- return $r;
3506-
3507- }
3508-
3509- public function __isset($var) {
3510- $r = CompilerHints___isset($this->_cPtr, $var);
3511- return $r;
3512-
3513- }
3514-
3515- public function __get($var) {
3516- $r = CompilerHints___get($this->_cPtr, $var);
3517- return $r;
3518-
3519- }
3520-
3521- public function getLibModule() {
3522- $r = CompilerHints_getLibModule($this->_cPtr);
3523- return $r;
3524-
3525- }
3526-
3527- public function setLibModule($aLibModule) {
3528- $r = CompilerHints_setLibModule($this->_cPtr, $aLibModule);
3529- return $r;
3530-
3531- }
3532-
3533- public function getOptimizationLevel() {
3534- $r = CompilerHints_getOptimizationLevel($this->_cPtr);
3535- return $r;
3536-
3537- }
3538-
3539- public function setOptimizationLevel($aOptLevel) {
3540- $r = CompilerHints_setOptimizationLevel($this->_cPtr, $aOptLevel);
3541- return $r;
3542-
3543- }
3544-
3545- public function __construct($ptr) {
3546- $this->_cPtr = $ptr;
3547- }
3548-
3549-}
3550-
3551-class StaticContext{
3552- public $_cPtr=null;
3553-
3554- public function __set($var, $value) {
3555- $r = StaticContext___set($this->_cPtr, $var, $value);
3556- return $r;
3557-
3558- }
3559-
3560- public function __isset($var) {
3561- $r = StaticContext___isset($this->_cPtr, $var);
3562- return $r;
3563-
3564- }
3565-
3566- public function __get($var) {
3567- $r = StaticContext___get($this->_cPtr, $var);
3568- return $r;
3569-
3570- }
3571-
3572- public function __construct($ptr) {
3573- $this->_cPtr = $ptr;
3574- }
3575-
3576- public function addColation($aURI) {
3577- $r = StaticContext_addColation($this->_cPtr, $aURI);
3578- return $r;
3579-
3580- }
3581-
3582- public function addNamespace($aPrefix, $aURI) {
3583- $r = StaticContext_addNamespace($this->_cPtr, $aPrefix, $aURI);
3584- return $r;
3585-
3586- }
3587-
3588- public function addReference() {
3589- $r = StaticContext_addReference($this->_cPtr);
3590- return $r;
3591-
3592- }
3593-
3594- public function containsFunction($aFnNameUri, $aFnNameLocal, $arity) {
3595- $r = StaticContext_containsFunction($this->_cPtr, $aFnNameUri, $aFnNameLocal, $arity);
3596- return $r;
3597-
3598- }
3599-
3600- public function createChildContext() {
3601- $r = StaticContext_createChildContext($this->_cPtr);
3602- return is_resource($r) ? new StaticContext($r) : $r;
3603-
3604- }
3605-
3606- public function declareOption($aQName, $aOptionVal) {
3607- $r = StaticContext_declareOption($this->_cPtr, $aQName, $aOptionVal);
3608- return $r;
3609-
3610- }
3611-
3612- public function disableFunction($aQName, $arity) {
3613- $r = StaticContext_disableFunction($this->_cPtr, $aQName, $arity);
3614- return $r;
3615-
3616- }
3617-
3618- public function free() {
3619- $r = StaticContext_free($this->_cPtr);
3620- return $r;
3621-
3622- }
3623-
3624- public function getBaseURI() {
3625- $r = StaticContext_getBaseURI($this->_cPtr);
3626- return $r;
3627-
3628- }
3629-
3630- public function getBoundarySpacePolicy() {
3631- $r = StaticContext_getBoundarySpacePolicy($this->_cPtr);
3632- return $r;
3633-
3634- }
3635-
3636- public function getConstructionMode() {
3637- $r = StaticContext_getConstructionMode($this->_cPtr);
3638- return $r;
3639-
3640- }
3641-
3642- public function getCopyNamespacesMode($aPreserve, $aInherit) {
3643- $r = StaticContext_getCopyNamespacesMode($this->_cPtr, $aPreserve, $aInherit);
3644- return $r;
3645-
3646- }
3647-
3648- public function getDefaultCollation() {
3649- $r = StaticContext_getDefaultCollation($this->_cPtr);
3650- return $r;
3651-
3652- }
3653-
3654- public function getDefaultElementAndTypeNamespace() {
3655- $r = StaticContext_getDefaultElementAndTypeNamespace($this->_cPtr);
3656- return $r;
3657-
3658- }
3659-
3660- public function getDefaultFunctionNamespace() {
3661- $r = StaticContext_getDefaultFunctionNamespace($this->_cPtr);
3662- return $r;
3663-
3664- }
3665-
3666- public function getDefaultOrderForEmptySequences() {
3667- $r = StaticContext_getDefaultOrderForEmptySequences($this->_cPtr);
3668- return $r;
3669-
3670- }
3671-
3672- public function getNamespaceURIByPrefix($aPrefix) {
3673- $r = StaticContext_getNamespaceURIByPrefix($this->_cPtr, $aPrefix);
3674- return $r;
3675-
3676- }
3677-
3678- public function getOption($aQName, $aOptionValue) {
3679- $r = StaticContext_getOption($this->_cPtr, $aQName, $aOptionValue);
3680- return $r;
3681-
3682- }
3683-
3684- public function getOrderingMode() {
3685- $r = StaticContext_getOrderingMode($this->_cPtr);
3686- return $r;
3687-
3688- }
3689-
3690- public function getRefCount() {
3691- $r = StaticContext_getRefCount($this->_cPtr);
3692- return $r;
3693-
3694- }
3695-
3696- public function getRevalidationMode() {
3697- $r = StaticContext_getRevalidationMode($this->_cPtr);
3698- return $r;
3699-
3700- }
3701-
3702- public function getXPath1_0CompatibMode() {
3703- $r = StaticContext_getXPath1_0CompatibMode($this->_cPtr);
3704- return $r;
3705-
3706- }
3707-
3708- public function loadProlog($aProlog, $hints) {
3709- $r = StaticContext_loadProlog($this->_cPtr, $aProlog, $hints);
3710- return $r;
3711-
3712- }
3713-
3714- public function removeReference() {
3715- $r = StaticContext_removeReference($this->_cPtr);
3716- return $r;
3717-
3718- }
3719-
3720- public function resetTraceStream() {
3721- $r = StaticContext_resetTraceStream($this->_cPtr);
3722- return $r;
3723-
3724- }
3725-
3726- public function setBaseURI($aBaseURI) {
3727- $r = StaticContext_setBaseURI($this->_cPtr, $aBaseURI);
3728- return $r;
3729-
3730- }
3731-
3732- public function setBoundarySpacePolicy($aMode) {
3733- $r = StaticContext_setBoundarySpacePolicy($this->_cPtr, $aMode);
3734- return $r;
3735-
3736- }
3737-
3738- public function setConstructionMode($aMode) {
3739- $r = StaticContext_setConstructionMode($this->_cPtr, $aMode);
3740- return $r;
3741-
3742- }
3743-
3744- public function setCopyNamespacesMode($aPreserve, $aInherit) {
3745- $r = StaticContext_setCopyNamespacesMode($this->_cPtr, $aPreserve, $aInherit);
3746- return $r;
3747-
3748- }
3749-
3750- public function setDefaultCollation($aURI) {
3751- $r = StaticContext_setDefaultCollation($this->_cPtr, $aURI);
3752- return $r;
3753-
3754- }
3755-
3756- public function setDefaultElementAndTypeNamespace($aURI) {
3757- $r = StaticContext_setDefaultElementAndTypeNamespace($this->_cPtr, $aURI);
3758- return $r;
3759-
3760- }
3761-
3762- public function setDefaultFunctionNamespace($aURI) {
3763- $r = StaticContext_setDefaultFunctionNamespace($this->_cPtr, $aURI);
3764- return $r;
3765-
3766- }
3767-
3768- public function setDefaultOrderForEmptySequences($aMode) {
3769- $r = StaticContext_setDefaultOrderForEmptySequences($this->_cPtr, $aMode);
3770- return $r;
3771-
3772- }
3773-
3774- public function setOrderingMode($aMode) {
3775- $r = StaticContext_setOrderingMode($this->_cPtr, $aMode);
3776- return $r;
3777-
3778- }
3779-
3780- public function setRevalidationMode($aMode) {
3781- $r = StaticContext_setRevalidationMode($this->_cPtr, $aMode);
3782- return $r;
3783-
3784- }
3785-
3786- public function setXPath1_0CompatibMode($aMode) {
3787- $r = StaticContext_setXPath1_0CompatibMode($this->_cPtr, $aMode);
3788- return $r;
3789-
3790- }
3791-
3792- public function destroy() {
3793- $r = StaticContext_destroy($this->_cPtr);
3794- return $r;
3795-
3796- }
3797-
3798-}
3799-
3800-class Zorba{
3801- public $_cPtr=null;
3802-
3803- public function __set($var, $value) {
3804- $r = Zorba___set($this->_cPtr, $var, $value);
3805- return $r;
3806-
3807- }
3808-
3809- public function __isset($var) {
3810- $r = Zorba___isset($this->_cPtr, $var);
3811- return $r;
3812-
3813- }
3814-
3815- public function __get($var) {
3816- $r = Zorba___get($this->_cPtr, $var);
3817- return $r;
3818-
3819- }
3820-
3821- static public function getInstance($arg1) {
3822- $r = Zorba_getInstance($arg1);
3823- return is_resource($r) ? new Zorba($r) : $r;
3824-
3825- }
3826-
3827- public function createStaticContext() {
3828- $r = Zorba_createStaticContext($this->_cPtr);
3829- return is_resource($r) ? new StaticContext($r) : $r;
3830-
3831- }
3832-
3833- public function createQuery() {
3834- $r = Zorba_createQuery($this->_cPtr);
3835- return is_resource($r) ? new XQuery($r) : $r;
3836-
3837- }
3838-
3839- public function compileQuery($aStr, $aStaticContext=null) {
3840- switch(func_num_args()) {
3841- case 1: $r = Zorba_compileQuery($this->_cPtr, $aStr);break;
3842- case 2: $r = Zorba_compileQuery($this->_cPtr, $aStr, $aStaticContext);break;
3843- default: $r = Zorba_compileQuery($this->_cPtr, $aStr, $aStaticContext);
3844- }
3845- return is_resource($r) ? new XQuery($r) : $r;
3846-
3847- }
3848-
3849- public function getItemFactory() {
3850- $r = Zorba_getItemFactory($this->_cPtr);
3851- return is_resource($r) ? new ItemFactory($r) : $r;
3852-
3853- }
3854-
3855- public function getXmlDataManager() {
3856- $r = Zorba_getXmlDataManager($this->_cPtr);
3857- return is_resource($r) ? new XmlDataManager($r) : $r;
3858-
3859- }
3860-
3861- public function shutdown() {
3862- $r = Zorba_shutdown($this->_cPtr);
3863- return $r;
3864-
3865- }
3866-
3867- public function __construct($ptr) {
3868- $this->_cPtr = $ptr;
3869- }
3870-
3871-}
3872-
3873-class ItemFactory{
3874- public $_cPtr=null;
3875-
3876- public function __set($var, $value) {
3877- $r = ItemFactory___set($this->_cPtr, $var, $value);
3878- return $r;
3879-
3880- }
3881-
3882- public function __isset($var) {
3883- $r = ItemFactory___isset($this->_cPtr, $var);
3884- return $r;
3885-
3886- }
3887-
3888- public function __get($var) {
3889- $r = ItemFactory___get($this->_cPtr, $var);
3890- return $r;
3891-
3892- }
3893-
3894- public function __construct($ptr) {
3895- $this->_cPtr = $ptr;
3896- }
3897-
3898- public function createAnyURI($aURI) {
3899- $r = ItemFactory_createAnyURI($this->_cPtr, $aURI);
3900- return is_resource($r) ? new Item($r) : $r;
3901-
3902- }
3903-
3904- public function createAttributeNode($aParent, $aNodeName, $aTypeName, $aTypedValue) {
3905- $r = ItemFactory_createAttributeNode($this->_cPtr, $aParent, $aNodeName, $aTypeName, $aTypedValue);
3906- return is_resource($r) ? new Item($r) : $r;
3907-
3908- }
3909-
3910- public function createBase64Binary($aBinData_or_aStream, $aLength=null) {
3911- switch(func_num_args()) {
3912- case 1: $r = ItemFactory_createBase64Binary($this->_cPtr, $aBinData_or_aStream);break;
3913- case 2: $r = ItemFactory_createBase64Binary($this->_cPtr, $aBinData_or_aStream, $aLength);break;
3914- default: $r = ItemFactory_createBase64Binary($this->_cPtr, $aBinData_or_aStream, $aLength);
3915- }
3916- return is_resource($r) ? new Item($r) : $r;
3917-
3918- }
3919-
3920- public function createBoolean($aValue) {
3921- $r = ItemFactory_createBoolean($this->_cPtr, $aValue);
3922- return is_resource($r) ? new Item($r) : $r;
3923-
3924- }
3925-
3926- public function createByte($aByte) {
3927- $r = ItemFactory_createByte($this->_cPtr, $aByte);
3928- return is_resource($r) ? new Item($r) : $r;
3929-
3930- }
3931-
3932- public function createDate($aDate_or_aYear, $aMonth=null, $aDay=null) {
3933- switch(func_num_args()) {
3934- case 1: $r = ItemFactory_createDate($this->_cPtr, $aDate_or_aYear);break;
3935- case 2: $r = ItemFactory_createDate($this->_cPtr, $aDate_or_aYear, $aMonth);break;
3936- case 3: $r = ItemFactory_createDate($this->_cPtr, $aDate_or_aYear, $aMonth, $aDay);break;
3937- default: $r = ItemFactory_createDate($this->_cPtr, $aDate_or_aYear, $aMonth, $aDay);
3938- }
3939- return is_resource($r) ? new Item($r) : $r;
3940-
3941- }
3942-
3943- public function createDateTime($aDateTimeValue_or_aYear, $aMonth=null, $aDay=null, $aHour=null, $aMinute=null, $aSecond=null, $aTimeZone_hours=null) {
3944- switch(func_num_args()) {
3945- case 1: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear);break;
3946- case 2: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear, $aMonth);break;
3947- case 3: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear, $aMonth, $aDay);break;
3948- case 4: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear, $aMonth, $aDay, $aHour);break;
3949- case 5: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear, $aMonth, $aDay, $aHour, $aMinute);break;
3950- case 6: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear, $aMonth, $aDay, $aHour, $aMinute, $aSecond);break;
3951- case 7: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear, $aMonth, $aDay, $aHour, $aMinute, $aSecond, $aTimeZone_hours);break;
3952- default: $r = ItemFactory_createDateTime($this->_cPtr, $aDateTimeValue_or_aYear, $aMonth, $aDay, $aHour, $aMinute, $aSecond, $aTimeZone_hours);
3953- }
3954- return is_resource($r) ? new Item($r) : $r;
3955-
3956- }
3957-
3958- public function createDecimal($aValue) {
3959- $r = ItemFactory_createDecimal($this->_cPtr, $aValue);
3960- return is_resource($r) ? new Item($r) : $r;
3961-
3962- }
3963-
3964- public function createDecimalFromDouble($aValue) {
3965- $r = ItemFactory_createDecimalFromDouble($this->_cPtr, $aValue);
3966- return is_resource($r) ? new Item($r) : $r;
3967-
3968- }
3969-
3970- public function createDecimalFromLong($aValue) {
3971- $r = ItemFactory_createDecimalFromLong($this->_cPtr, $aValue);
3972- return is_resource($r) ? new Item($r) : $r;
3973-
3974- }
3975-
3976- public function createDouble($aValue) {
3977- $r = ItemFactory_createDouble($this->_cPtr, $aValue);
3978- return is_resource($r) ? new Item($r) : $r;
3979-
3980- }
3981-
3982- public function createDuration($aValue_or_aYear, $aMonths=null, $aDays=null, $aHours=null, $aMinutes=null, $aSeconds=null) {
3983- switch(func_num_args()) {
3984- case 1: $r = ItemFactory_createDuration($this->_cPtr, $aValue_or_aYear);break;
3985- case 2: $r = ItemFactory_createDuration($this->_cPtr, $aValue_or_aYear, $aMonths);break;
3986- case 3: $r = ItemFactory_createDuration($this->_cPtr, $aValue_or_aYear, $aMonths, $aDays);break;
3987- case 4: $r = ItemFactory_createDuration($this->_cPtr, $aValue_or_aYear, $aMonths, $aDays, $aHours);break;
3988- case 5: $r = ItemFactory_createDuration($this->_cPtr, $aValue_or_aYear, $aMonths, $aDays, $aHours, $aMinutes);break;
3989- case 6: $r = ItemFactory_createDuration($this->_cPtr, $aValue_or_aYear, $aMonths, $aDays, $aHours, $aMinutes, $aSeconds);break;
3990- default: $r = ItemFactory_createDuration($this->_cPtr, $aValue_or_aYear, $aMonths, $aDays, $aHours, $aMinutes, $aSeconds);
3991- }
3992- return is_resource($r) ? new Item($r) : $r;
3993-
3994- }
3995-
3996- public function createFloat($aValue) {
3997- $r = ItemFactory_createFloat($this->_cPtr, $aValue);
3998- return is_resource($r) ? new Item($r) : $r;
3999-
4000- }
4001-
4002- public function createGDay($aValue_or_aDay) {
4003- $r = ItemFactory_createGDay($this->_cPtr, $aValue_or_aDay);
4004- return is_resource($r) ? new Item($r) : $r;
4005-
4006- }
4007-
4008- public function createGMonth($aValue_or_aMonth) {
4009- $r = ItemFactory_createGMonth($this->_cPtr, $aValue_or_aMonth);
4010- return is_resource($r) ? new Item($r) : $r;
4011-
4012- }
4013-
4014- public function createGMonthDay($aValue_or_aMonth, $aDay=null) {
4015- switch(func_num_args()) {
4016- case 1: $r = ItemFactory_createGMonthDay($this->_cPtr, $aValue_or_aMonth);break;
4017- case 2: $r = ItemFactory_createGMonthDay($this->_cPtr, $aValue_or_aMonth, $aDay);break;
4018- default: $r = ItemFactory_createGMonthDay($this->_cPtr, $aValue_or_aMonth, $aDay);
4019- }
4020- return is_resource($r) ? new Item($r) : $r;
4021-
4022- }
4023-
4024- public function createGYear($aYear_or_aValue) {
4025- $r = ItemFactory_createGYear($this->_cPtr, $aYear_or_aValue);
4026- return is_resource($r) ? new Item($r) : $r;
4027-
4028- }
4029-
4030- public function createGYearMonth($aValue_or_aYear, $aMonth=null) {
4031- switch(func_num_args()) {
4032- case 1: $r = ItemFactory_createGYearMonth($this->_cPtr, $aValue_or_aYear);break;
4033- case 2: $r = ItemFactory_createGYearMonth($this->_cPtr, $aValue_or_aYear, $aMonth);break;
4034- default: $r = ItemFactory_createGYearMonth($this->_cPtr, $aValue_or_aYear, $aMonth);
4035- }
4036- return is_resource($r) ? new Item($r) : $r;
4037-
4038- }
4039-
4040- public function createHexBinary($aHexData, $aSize) {
4041- $r = ItemFactory_createHexBinary($this->_cPtr, $aHexData, $aSize);
4042- return is_resource($r) ? new Item($r) : $r;
4043-
4044- }
4045-
4046- public function createInt($aInt) {
4047- $r = ItemFactory_createInt($this->_cPtr, $aInt);
4048- return is_resource($r) ? new Item($r) : $r;
4049-
4050- }
4051-
4052- public function createInteger($aInteger) {
4053- $r = ItemFactory_createInteger($this->_cPtr, (string)$aInteger);
4054- return is_resource($r) ? new Item($r) : $r;
4055-
4056- }
4057-
4058- public function createLong($aLong) {
4059- $r = ItemFactory_createLong($this->_cPtr, $aLong);
4060- return is_resource($r) ? new Item($r) : $r;
4061-
4062- }
4063-
4064- public function createNCName($aValue) {
4065- $r = ItemFactory_createNCName($this->_cPtr, $aValue);
4066- return is_resource($r) ? new Item($r) : $r;
4067-
4068- }
4069-
4070- public function createNegativeInteger($aValue) {
4071- $r = ItemFactory_createNegativeInteger($this->_cPtr, $aValue);
4072- return is_resource($r) ? new Item($r) : $r;
4073-
4074- }
4075-
4076- public function createNonNegativeInteger($aValue) {
4077- $r = ItemFactory_createNonNegativeInteger($this->_cPtr, $aValue);
4078- return is_resource($r) ? new Item($r) : $r;
4079-
4080- }
4081-
4082- public function createNonPositiveInteger($aValue) {
4083- $r = ItemFactory_createNonPositiveInteger($this->_cPtr, $aValue);
4084- return is_resource($r) ? new Item($r) : $r;
4085-
4086- }
4087-
4088- public function createPositiveInteger($aValue) {
4089- $r = ItemFactory_createPositiveInteger($this->_cPtr, $aValue);
4090- return is_resource($r) ? new Item($r) : $r;
4091-
4092- }
4093-
4094- public function createQName($aNamespace_or_aQNameString, $aPrefix_or_aLocalname=null, $aLocalname=null) {
4095- switch(func_num_args()) {
4096- case 1: $r = ItemFactory_createQName($this->_cPtr, $aNamespace_or_aQNameString);break;
4097- case 2: $r = ItemFactory_createQName($this->_cPtr, $aNamespace_or_aQNameString, $aPrefix_or_aLocalname);break;
4098- case 3: $r = ItemFactory_createQName($this->_cPtr, $aNamespace_or_aQNameString, $aPrefix_or_aLocalname, $aLocalname);break;
4099- default: $r = ItemFactory_createQName($this->_cPtr, $aNamespace_or_aQNameString, $aPrefix_or_aLocalname, $aLocalname);
4100- }
4101- return is_resource($r) ? new Item($r) : $r;
4102-
4103- }
4104-
4105- public function createShort($aShort) {
4106- $r = ItemFactory_createShort($this->_cPtr, $aShort);
4107- return is_resource($r) ? new Item($r) : $r;
4108-
4109- }
4110-
4111- public function createString($aString) {
4112- $r = ItemFactory_createString($this->_cPtr, $aString);
4113- return is_resource($r) ? new Item($r) : $r;
4114-
4115- }
4116-
4117- public function createTextNode($parent, $content) {
4118- $r = ItemFactory_createTextNode($this->_cPtr, $parent, $content);
4119- return is_resource($r) ? new Item($r) : $r;
4120-
4121- }
4122-
4123- public function createTime($aHour_or_aValue, $aMinute=null, $aSecond=null, $aTimeZone_hours=null) {
4124- switch(func_num_args()) {
4125- case 1: $r = ItemFactory_createTime($this->_cPtr, $aHour_or_aValue);break;
4126- case 2: $r = ItemFactory_createTime($this->_cPtr, $aHour_or_aValue, $aMinute);break;
4127- case 3: $r = ItemFactory_createTime($this->_cPtr, $aHour_or_aValue, $aMinute, $aSecond);break;
4128- case 4: $r = ItemFactory_createTime($this->_cPtr, $aHour_or_aValue, $aMinute, $aSecond, $aTimeZone_hours);break;
4129- default: $r = ItemFactory_createTime($this->_cPtr, $aHour_or_aValue, $aMinute, $aSecond, $aTimeZone_hours);
4130- }
4131- return is_resource($r) ? new Item($r) : $r;
4132-
4133- }
4134-
4135- public function createUnsignedByte($aValue) {
4136- $r = ItemFactory_createUnsignedByte($this->_cPtr, $aValue);
4137- return is_resource($r) ? new Item($r) : $r;
4138-
4139- }
4140-
4141- public function createUnsignedInt($aValue) {
4142- $r = ItemFactory_createUnsignedInt($this->_cPtr, $aValue);
4143- return is_resource($r) ? new Item($r) : $r;
4144-
4145- }
4146-
4147- public function createUnsignedLong($aValue) {
4148- $r = ItemFactory_createUnsignedLong($this->_cPtr, $aValue);
4149- return is_resource($r) ? new Item($r) : $r;
4150-
4151- }
4152-
4153- public function createUnsignedShort($aValue) {
4154- $r = ItemFactory_createUnsignedShort($this->_cPtr, $aValue);
4155- return is_resource($r) ? new Item($r) : $r;
4156-
4157- }
4158-
4159-}
4160
4161=== modified file 'swig/python/tests/CMakeLists.txt'
4162--- swig/python/tests/CMakeLists.txt 2013-02-07 17:24:36 +0000
4163+++ swig/python/tests/CMakeLists.txt 2013-03-27 00:40:33 +0000
4164@@ -14,65 +14,66 @@
4165
4166 SET(pythonPath ${CMAKE_BINARY_DIR}/swig/python)
4167
4168-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/books.xml.in ${CMAKE_CURRENT_BINARY_DIR}/books.xml COPYONLY)
4169-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/compilerHints.xq.in ${CMAKE_CURRENT_BINARY_DIR}/compilerHints.xq COPYONLY)
4170+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/books.xml ${CMAKE_CURRENT_BINARY_DIR}/books.xml COPYONLY)
4171+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/compilerHints.xq ${CMAKE_CURRENT_BINARY_DIR}/compilerHints.xq COPYONLY)
4172
4173-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test01.py.in ${CMAKE_CURRENT_BINARY_DIR}/test01.py)
4174+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test01.py ${CMAKE_CURRENT_BINARY_DIR}/test01.py)
4175 ADD_TEST("python_test01" ${PYTHON_EXECUTABLE} test01.py)
4176 SET_TESTS_PROPERTIES("python_test01" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
4177
4178-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test02.py.in ${CMAKE_CURRENT_BINARY_DIR}/test02.py)
4179+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test02.py ${CMAKE_CURRENT_BINARY_DIR}/test02.py)
4180 ADD_TEST("python_test02" ${PYTHON_EXECUTABLE} test02.py)
4181 SET_TESTS_PROPERTIES("python_test02" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
4182
4183-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test03.py.in ${CMAKE_CURRENT_BINARY_DIR}/test03.py)
4184+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test03.py ${CMAKE_CURRENT_BINARY_DIR}/test03.py)
4185 ADD_TEST("python_test03" ${PYTHON_EXECUTABLE} test03.py)
4186 SET_TESTS_PROPERTIES("python_test03" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
4187
4188-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test04.py.in ${CMAKE_CURRENT_BINARY_DIR}/test04.py)
4189+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test04.py ${CMAKE_CURRENT_BINARY_DIR}/test04.py)
4190 ADD_TEST("python_test04" ${PYTHON_EXECUTABLE} test04.py)
4191-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test04.xq.in ${CMAKE_CURRENT_BINARY_DIR}/test04.xq COPYONLY)
4192+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test04.xq ${CMAKE_CURRENT_BINARY_DIR}/test04.xq COPYONLY)
4193 SET_TESTS_PROPERTIES("python_test04" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
4194
4195-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test05.py.in ${CMAKE_CURRENT_BINARY_DIR}/test05.py)
4196+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test05.py ${CMAKE_CURRENT_BINARY_DIR}/test05.py)
4197 ADD_TEST("python_test05" ${PYTHON_EXECUTABLE} test05.py)
4198-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test05.xq.in ${CMAKE_CURRENT_BINARY_DIR}/test05.xq COPYONLY)
4199+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test05.xq ${CMAKE_CURRENT_BINARY_DIR}/test05.xq COPYONLY)
4200 SET_TESTS_PROPERTIES("python_test05" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
4201
4202-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test06.py.in ${CMAKE_CURRENT_BINARY_DIR}/test06.py)
4203+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test06.py ${CMAKE_CURRENT_BINARY_DIR}/test06.py)
4204 ADD_TEST("python_test06" ${PYTHON_EXECUTABLE} test06.py)
4205-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test06.xq.in ${CMAKE_CURRENT_BINARY_DIR}/test06.xq COPYONLY)
4206+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test06.xq ${CMAKE_CURRENT_BINARY_DIR}/test06.xq COPYONLY)
4207 SET_TESTS_PROPERTIES("python_test06" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
4208
4209-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test07.1.py.in ${CMAKE_CURRENT_BINARY_DIR}/test07.1.py)
4210+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test07.1.py ${CMAKE_CURRENT_BINARY_DIR}/test07.1.py)
4211 ADD_TEST("python_test07.1" ${PYTHON_EXECUTABLE} test07.1.py)
4212-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test07.2.py.in ${CMAKE_CURRENT_BINARY_DIR}/test07.2.py)
4213+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test07.2.py ${CMAKE_CURRENT_BINARY_DIR}/test07.2.py)
4214 ADD_TEST("python_test07.2" ${PYTHON_EXECUTABLE} test07.2.py)
4215 SET_TESTS_PROPERTIES("python_test07.1" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
4216 SET_TESTS_PROPERTIES("python_test07.2" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
4217
4218-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test08.py.in ${CMAKE_CURRENT_BINARY_DIR}/test08.py)
4219+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test08.py ${CMAKE_CURRENT_BINARY_DIR}/test08.py)
4220 ADD_TEST("python_test08" ${PYTHON_EXECUTABLE} test08.py)
4221 SET_TESTS_PROPERTIES("python_test08" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
4222
4223
4224-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test10.py.in ${CMAKE_CURRENT_BINARY_DIR}/test10.py)
4225+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test10.py ${CMAKE_CURRENT_BINARY_DIR}/test10.py)
4226 ADD_TEST("python_test10" ${PYTHON_EXECUTABLE} test10.py)
4227 SET_TESTS_PROPERTIES("python_test10" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
4228
4229-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test11.py.in ${CMAKE_CURRENT_BINARY_DIR}/test11.py)
4230+CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test11.py ${CMAKE_CURRENT_BINARY_DIR}/test11.py)
4231 ADD_TEST("python_test11" ${PYTHON_EXECUTABLE} test11.py)
4232 SET_TESTS_PROPERTIES("python_test11" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
4233
4234-#CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test12.py.in ${CMAKE_CURRENT_BINARY_DIR}/test12.py)
4235-#ADD_TEST("python_test12" ${PYTHON_EXECUTABLE} test12.py)
4236-#SET_TESTS_PROPERTIES("python_test12" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
4237-
4238-#CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test13.py.in ${CMAKE_CURRENT_BINARY_DIR}/test13.py)
4239-#ADD_TEST("python_test13" ${PYTHON_EXECUTABLE} test13.py)
4240-#SET_TESTS_PROPERTIES("python_test13" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
4241-
4242-#CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test14.py.in ${CMAKE_CURRENT_BINARY_DIR}/test14.py)
4243+# CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/satellites.json ${CMAKE_CURRENT_BINARY_DIR}/satellites.json COPYONLY)
4244+# CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test12.py ${CMAKE_CURRENT_BINARY_DIR}/test12.py)
4245+# ADD_TEST("python_test12" ${PYTHON_EXECUTABLE} test12.py)
4246+# SET_TESTS_PROPERTIES("python_test12" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
4247+
4248+# CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test13.py ${CMAKE_CURRENT_BINARY_DIR}/test13.py)
4249+# ADD_TEST("python_test13" ${PYTHON_EXECUTABLE} test13.py)
4250+# SET_TESTS_PROPERTIES("python_test13" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
4251+
4252+#CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/test14.py ${CMAKE_CURRENT_BINARY_DIR}/test14.py)
4253 #ADD_TEST("python_test14" ${PYTHON_EXECUTABLE} test14.py)
4254 #SET_TESTS_PROPERTIES("python_test14" PROPERTIES PASS_REGULAR_EXPRESSION "Success")
4255
4256
4257=== added file 'swig/python/tests/books.xml'
4258--- swig/python/tests/books.xml 1970-01-01 00:00:00 +0000
4259+++ swig/python/tests/books.xml 2013-03-27 00:40:33 +0000
4260@@ -0,0 +1,11 @@
4261+<?xml version="1.0" encoding="UTF-8" ?>
4262+<books>
4263+ <book>
4264+ <title>Book 1</title>
4265+ <author>Author 1</author>
4266+ </book>
4267+ <book featured="YES">
4268+ <title>Book 2</title>
4269+ <author>Author 2</author>
4270+ </book>
4271+</books>
4272
4273=== removed file 'swig/python/tests/books.xml.in'
4274--- swig/python/tests/books.xml.in 2013-02-07 17:24:36 +0000
4275+++ swig/python/tests/books.xml.in 1970-01-01 00:00:00 +0000
4276@@ -1,11 +0,0 @@
4277-<?xml version="1.0" encoding="UTF-8" ?>
4278-<books>
4279- <book>
4280- <title>Book 1</title>
4281- <author>Author 1</author>
4282- </book>
4283- <book featured="YES">
4284- <title>Book 2</title>
4285- <author>Author 2</author>
4286- </book>
4287-</books>
4288
4289=== added file 'swig/python/tests/compilerHints.xq'
4290--- swig/python/tests/compilerHints.xq 1970-01-01 00:00:00 +0000
4291+++ swig/python/tests/compilerHints.xq 2013-03-27 00:40:33 +0000
4292@@ -0,0 +1,4 @@
4293+for tumbling window $w in (2, 4, 6, 8, 10, 12, 14)
4294+ start at $s when fn:true()
4295+ only end at $e when $e - $s eq 2
4296+return avg($w)
4297
4298=== removed file 'swig/python/tests/compilerHints.xq.in'
4299--- swig/python/tests/compilerHints.xq.in 2013-02-07 17:24:36 +0000
4300+++ swig/python/tests/compilerHints.xq.in 1970-01-01 00:00:00 +0000
4301@@ -1,4 +0,0 @@
4302-for tumbling window $w in (2, 4, 6, 8, 10, 12, 14)
4303- start at $s when fn:true()
4304- only end at $e when $e - $s eq 2
4305-return avg($w)
4306
4307=== added file 'swig/python/tests/satellites.json'
4308--- swig/python/tests/satellites.json 1970-01-01 00:00:00 +0000
4309+++ swig/python/tests/satellites.json 2013-03-27 00:40:33 +0000
4310@@ -0,0 +1,17 @@
4311+{
4312+ "creator" : "Satellites plugin version 0.6.4",
4313+ "satellites" : {
4314+ "AAU CUBESAT" : {
4315+ "tle1" : "1 27846U 03031G 10322.04074654 .00000056 00000-0 45693-4 0 8768",
4316+ "visible" : false
4317+ },
4318+ "AJISAI (EGS)" : {
4319+ "tle1" : "1 16908U 86061A 10321.84797408 -.00000083 00000-0 10000-3 0 3696",
4320+ "visible" : true
4321+ },
4322+ "AKARI (ASTRO-F)" : {
4323+ "tle1" : "1 28939U 06005A 10321.96319841 .00000176 00000-0 48808-4 0 4294",
4324+ "visible" : true
4325+ }
4326+ }
4327+}
4328
4329=== added file 'swig/python/tests/test01.py'
4330--- swig/python/tests/test01.py 1970-01-01 00:00:00 +0000
4331+++ swig/python/tests/test01.py 2013-03-27 00:40:33 +0000
4332@@ -0,0 +1,26 @@
4333+# Copyright 2006-2011 The FLWOR Foundation.
4334+#
4335+# Licensed under the Apache License, Version 2.0 (the "License");
4336+# you may not use this file except in compliance with the License.
4337+# You may obtain a copy of the License at
4338+#
4339+# http://www.apache.org/licenses/LICENSE-2.0
4340+#
4341+# Unless required by applicable law or agreed to in writing, software
4342+# distributed under the License is distributed on an "AS IS" BASIS,
4343+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4344+# See the License for the specific language governing permissions and
4345+# limitations under the License.
4346+
4347+import sys
4348+sys.path.insert(0, '@pythonPath@')
4349+import zorba_api
4350+
4351+print "Running: Get zorba instance and shutdown"
4352+
4353+store = zorba_api.InMemoryStore_getInstance()
4354+zorba = zorba_api.Zorba_getInstance(store)
4355+zorba.shutdown()
4356+zorba_api.InMemoryStore_shutdown(store)
4357+
4358+print "Success"
4359
4360=== removed file 'swig/python/tests/test01.py.in'
4361--- swig/python/tests/test01.py.in 2013-02-07 17:24:36 +0000
4362+++ swig/python/tests/test01.py.in 1970-01-01 00:00:00 +0000
4363@@ -1,26 +0,0 @@
4364-# Copyright 2006-2011 The FLWOR Foundation.
4365-#
4366-# Licensed under the Apache License, Version 2.0 (the "License");
4367-# you may not use this file except in compliance with the License.
4368-# You may obtain a copy of the License at
4369-#
4370-# http://www.apache.org/licenses/LICENSE-2.0
4371-#
4372-# Unless required by applicable law or agreed to in writing, software
4373-# distributed under the License is distributed on an "AS IS" BASIS,
4374-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4375-# See the License for the specific language governing permissions and
4376-# limitations under the License.
4377-
4378-import sys
4379-sys.path.insert(0, '@pythonPath@')
4380-import zorba_api
4381-
4382-print "Running: Get zorba instance and shutdown"
4383-
4384-store = zorba_api.InMemoryStore_getInstance()
4385-zorba = zorba_api.Zorba_getInstance(store)
4386-zorba.shutdown()
4387-zorba_api.InMemoryStore_shutdown(store)
4388-
4389-print "Success"
4390
4391=== added file 'swig/python/tests/test02.py'
4392--- swig/python/tests/test02.py 1970-01-01 00:00:00 +0000
4393+++ swig/python/tests/test02.py 2013-03-27 00:40:33 +0000
4394@@ -0,0 +1,41 @@
4395+# Copyright 2006-2011 The FLWOR Foundation.
4396+#
4397+# Licensed under the Apache License, Version 2.0 (the "License");
4398+# you may not use this file except in compliance with the License.
4399+# You may obtain a copy of the License at
4400+#
4401+# http://www.apache.org/licenses/LICENSE-2.0
4402+#
4403+# Unless required by applicable law or agreed to in writing, software
4404+# distributed under the License is distributed on an "AS IS" BASIS,
4405+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4406+# See the License for the specific language governing permissions and
4407+# limitations under the License.
4408+
4409+import sys
4410+sys.path.insert(0, '@pythonPath@')
4411+import zorba_api
4412+
4413+
4414+def test(zorba):
4415+ xquery = zorba.compileQuery("(1,2,3,4,5)")
4416+ iter = xquery.iterator()
4417+ iter.open()
4418+ item = zorba_api.Item_createEmptyItem()
4419+ while iter.next(item):
4420+ print item.getStringValue()
4421+ iter.close()
4422+ iter.destroy()
4423+ return
4424+
4425+
4426+store = zorba_api.InMemoryStore_getInstance()
4427+zorba = zorba_api.Zorba_getInstance(store)
4428+
4429+print "Running: Compile query string"
4430+test(zorba)
4431+print "Success"
4432+
4433+zorba.shutdown()
4434+zorba_api.InMemoryStore_shutdown(store)
4435+
4436
4437=== removed file 'swig/python/tests/test02.py.in'
4438--- swig/python/tests/test02.py.in 2013-02-07 17:24:36 +0000
4439+++ swig/python/tests/test02.py.in 1970-01-01 00:00:00 +0000
4440@@ -1,41 +0,0 @@
4441-# Copyright 2006-2011 The FLWOR Foundation.
4442-#
4443-# Licensed under the Apache License, Version 2.0 (the "License");
4444-# you may not use this file except in compliance with the License.
4445-# You may obtain a copy of the License at
4446-#
4447-# http://www.apache.org/licenses/LICENSE-2.0
4448-#
4449-# Unless required by applicable law or agreed to in writing, software
4450-# distributed under the License is distributed on an "AS IS" BASIS,
4451-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4452-# See the License for the specific language governing permissions and
4453-# limitations under the License.
4454-
4455-import sys
4456-sys.path.insert(0, '@pythonPath@')
4457-import zorba_api
4458-
4459-
4460-def test(zorba):
4461- xquery = zorba.compileQuery("(1,2,3,4,5)")
4462- iter = xquery.iterator()
4463- iter.open()
4464- item = zorba_api.Item_createEmptyItem()
4465- while iter.next(item):
4466- print item.getStringValue()
4467- iter.close()
4468- iter.destroy()
4469- return
4470-
4471-
4472-store = zorba_api.InMemoryStore_getInstance()
4473-zorba = zorba_api.Zorba_getInstance(store)
4474-
4475-print "Running: Compile query string"
4476-test(zorba)
4477-print "Success"
4478-
4479-zorba.shutdown()
4480-zorba_api.InMemoryStore_shutdown(store)
4481-
4482
4483=== added file 'swig/python/tests/test03.py'
4484--- swig/python/tests/test03.py 1970-01-01 00:00:00 +0000
4485+++ swig/python/tests/test03.py 2013-03-27 00:40:33 +0000
4486@@ -0,0 +1,43 @@
4487+# Copyright 2006-2011 The FLWOR Foundation.
4488+#
4489+# Licensed under the Apache License, Version 2.0 (the "License");
4490+# you may not use this file except in compliance with the License.
4491+# You may obtain a copy of the License at
4492+#
4493+# http://www.apache.org/licenses/LICENSE-2.0
4494+#
4495+# Unless required by applicable law or agreed to in writing, software
4496+# distributed under the License is distributed on an "AS IS" BASIS,
4497+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4498+# See the License for the specific language governing permissions and
4499+# limitations under the License.
4500+
4501+import sys
4502+sys.path.insert(0, '@pythonPath@')
4503+import zorba_api
4504+
4505+class MyDiagnosticHandler(zorba_api.DiagnosticHandler):
4506+ def error(self, *args):
4507+ print "Error args: ", args
4508+
4509+def test(zorba):
4510+ diagnosticHandler = MyDiagnosticHandler()
4511+ try:
4512+ print "Compiling 1 div 0"
4513+ xquery = zorba.compileQuery("1 div 0", diagnosticHandler)
4514+ print xquery.execute()
4515+ except Exception, e:
4516+ print "Caught error: ", e
4517+ return
4518+
4519+
4520+store = zorba_api.InMemoryStore_getInstance()
4521+zorba = zorba_api.Zorba_getInstance(store)
4522+
4523+print "Running: Compile query string using Diagnostic Handler"
4524+test(zorba)
4525+print "Success"
4526+
4527+
4528+zorba.shutdown()
4529+zorba_api.InMemoryStore_shutdown(store)
4530
4531=== removed file 'swig/python/tests/test03.py.in'
4532--- swig/python/tests/test03.py.in 2013-02-07 17:24:36 +0000
4533+++ swig/python/tests/test03.py.in 1970-01-01 00:00:00 +0000
4534@@ -1,43 +0,0 @@
4535-# Copyright 2006-2011 The FLWOR Foundation.
4536-#
4537-# Licensed under the Apache License, Version 2.0 (the "License");
4538-# you may not use this file except in compliance with the License.
4539-# You may obtain a copy of the License at
4540-#
4541-# http://www.apache.org/licenses/LICENSE-2.0
4542-#
4543-# Unless required by applicable law or agreed to in writing, software
4544-# distributed under the License is distributed on an "AS IS" BASIS,
4545-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4546-# See the License for the specific language governing permissions and
4547-# limitations under the License.
4548-
4549-import sys
4550-sys.path.insert(0, '@pythonPath@')
4551-import zorba_api
4552-
4553-class MyDiagnosticHandler(zorba_api.DiagnosticHandler):
4554- def error(self, *args):
4555- print "Error args: ", args
4556-
4557-def test(zorba):
4558- diagnosticHandler = MyDiagnosticHandler()
4559- try:
4560- print "Compiling 1 div 0"
4561- xquery = zorba.compileQuery("1 div 0", diagnosticHandler)
4562- print xquery.execute()
4563- except Exception, e:
4564- print "Cought error: ", e
4565- return
4566-
4567-
4568-store = zorba_api.InMemoryStore_getInstance()
4569-zorba = zorba_api.Zorba_getInstance(store)
4570-
4571-print "Running: Compile query string using Diagnostic Handler"
4572-test(zorba)
4573-print "Success"
4574-
4575-
4576-zorba.shutdown()
4577-zorba_api.InMemoryStore_shutdown(store)
4578
4579=== added file 'swig/python/tests/test04.py'
4580--- swig/python/tests/test04.py 1970-01-01 00:00:00 +0000
4581+++ swig/python/tests/test04.py 2013-03-27 00:40:33 +0000
4582@@ -0,0 +1,42 @@
4583+# Copyright 2006-2011 The FLWOR Foundation.
4584+#
4585+# Licensed under the Apache License, Version 2.0 (the "License");
4586+# you may not use this file except in compliance with the License.
4587+# You may obtain a copy of the License at
4588+#
4589+# http://www.apache.org/licenses/LICENSE-2.0
4590+#
4591+# Unless required by applicable law or agreed to in writing, software
4592+# distributed under the License is distributed on an "AS IS" BASIS,
4593+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4594+# See the License for the specific language governing permissions and
4595+# limitations under the License.
4596+
4597+import sys
4598+sys.path.insert(0, '@pythonPath@')
4599+import zorba_api
4600+
4601+
4602+def test(zorba):
4603+ #Read and write result
4604+ print 'Executing: test04.xq'
4605+ f = open('test04.xq', 'r')
4606+ lines = f.read()
4607+ f.close()
4608+ xquery = zorba.compileQuery(lines)
4609+ result = xquery.execute()
4610+ print result
4611+ return
4612+
4613+
4614+store = zorba_api.InMemoryStore_getInstance()
4615+zorba = zorba_api.Zorba_getInstance(store)
4616+
4617+print "Running: XQuery execute"
4618+test(zorba)
4619+print "Success"
4620+
4621+
4622+zorba.shutdown()
4623+zorba_api.InMemoryStore_shutdown(store)
4624+
4625
4626=== removed file 'swig/python/tests/test04.py.in'
4627--- swig/python/tests/test04.py.in 2013-02-07 17:24:36 +0000
4628+++ swig/python/tests/test04.py.in 1970-01-01 00:00:00 +0000
4629@@ -1,42 +0,0 @@
4630-# Copyright 2006-2011 The FLWOR Foundation.
4631-#
4632-# Licensed under the Apache License, Version 2.0 (the "License");
4633-# you may not use this file except in compliance with the License.
4634-# You may obtain a copy of the License at
4635-#
4636-# http://www.apache.org/licenses/LICENSE-2.0
4637-#
4638-# Unless required by applicable law or agreed to in writing, software
4639-# distributed under the License is distributed on an "AS IS" BASIS,
4640-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4641-# See the License for the specific language governing permissions and
4642-# limitations under the License.
4643-
4644-import sys
4645-sys.path.insert(0, '@pythonPath@')
4646-import zorba_api
4647-
4648-
4649-def test(zorba):
4650- #Read and write result
4651- print 'Executing: test04.xq'
4652- f = open('test04.xq', 'r')
4653- lines = f.read()
4654- f.close()
4655- xquery = zorba.compileQuery(lines)
4656- result = xquery.execute()
4657- print result
4658- return
4659-
4660-
4661-store = zorba_api.InMemoryStore_getInstance()
4662-zorba = zorba_api.Zorba_getInstance(store)
4663-
4664-print "Running: XQuery execute"
4665-test(zorba)
4666-print "Success"
4667-
4668-
4669-zorba.shutdown()
4670-zorba_api.InMemoryStore_shutdown(store)
4671-
4672
4673=== added file 'swig/python/tests/test04.xq'
4674--- swig/python/tests/test04.xq 1970-01-01 00:00:00 +0000
4675+++ swig/python/tests/test04.xq 2013-03-27 00:40:33 +0000
4676@@ -0,0 +1,4 @@
4677+for tumbling window $w in (2, 4, 6, 8, 10, 12, 14)
4678+ start at $s when fn:true()
4679+ only end at $e when $e - $s eq 2
4680+return avg($w)
4681
4682=== removed file 'swig/python/tests/test04.xq.in'
4683--- swig/python/tests/test04.xq.in 2013-02-07 17:24:36 +0000
4684+++ swig/python/tests/test04.xq.in 1970-01-01 00:00:00 +0000
4685@@ -1,4 +0,0 @@
4686-for tumbling window $w in (2, 4, 6, 8, 10, 12, 14)
4687- start at $s when fn:true()
4688- only end at $e when $e - $s eq 2
4689-return avg($w)
4690
4691=== added file 'swig/python/tests/test05.py'
4692--- swig/python/tests/test05.py 1970-01-01 00:00:00 +0000
4693+++ swig/python/tests/test05.py 2013-03-27 00:40:33 +0000
4694@@ -0,0 +1,42 @@
4695+# Copyright 2006-2011 The FLWOR Foundation.
4696+#
4697+# Licensed under the Apache License, Version 2.0 (the "License");
4698+# you may not use this file except in compliance with the License.
4699+# You may obtain a copy of the License at
4700+#
4701+# http://www.apache.org/licenses/LICENSE-2.0
4702+#
4703+# Unless required by applicable law or agreed to in writing, software
4704+# distributed under the License is distributed on an "AS IS" BASIS,
4705+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4706+# See the License for the specific language governing permissions and
4707+# limitations under the License.
4708+
4709+import sys
4710+sys.path.insert(0, '@pythonPath@')
4711+import zorba_api
4712+
4713+
4714+def test(zorba):
4715+ #Read and write result
4716+ print 'Executing: test05.xq'
4717+ f = open('test05.xq', 'r')
4718+ lines = f.read()
4719+ f.close()
4720+ xquery = zorba.compileQuery(lines)
4721+ result = xquery.printPlanAsXML()
4722+ print result
4723+ return
4724+
4725+
4726+store = zorba_api.InMemoryStore_getInstance()
4727+zorba = zorba_api.Zorba_getInstance(store)
4728+
4729+print "Running: XQuery execute - printPlanAsXML"
4730+test(zorba)
4731+print "Success"
4732+
4733+
4734+zorba.shutdown()
4735+zorba_api.InMemoryStore_shutdown(store)
4736+
4737
4738=== removed file 'swig/python/tests/test05.py.in'
4739--- swig/python/tests/test05.py.in 2013-02-07 17:24:36 +0000
4740+++ swig/python/tests/test05.py.in 1970-01-01 00:00:00 +0000
4741@@ -1,42 +0,0 @@
4742-# Copyright 2006-2011 The FLWOR Foundation.
4743-#
4744-# Licensed under the Apache License, Version 2.0 (the "License");
4745-# you may not use this file except in compliance with the License.
4746-# You may obtain a copy of the License at
4747-#
4748-# http://www.apache.org/licenses/LICENSE-2.0
4749-#
4750-# Unless required by applicable law or agreed to in writing, software
4751-# distributed under the License is distributed on an "AS IS" BASIS,
4752-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4753-# See the License for the specific language governing permissions and
4754-# limitations under the License.
4755-
4756-import sys
4757-sys.path.insert(0, '@pythonPath@')
4758-import zorba_api
4759-
4760-
4761-def test(zorba):
4762- #Read and write result
4763- print 'Executing: test05.xq'
4764- f = open('test05.xq', 'r')
4765- lines = f.read()
4766- f.close()
4767- xquery = zorba.compileQuery(lines)
4768- result = xquery.printPlanAsXML()
4769- print result
4770- return
4771-
4772-
4773-store = zorba_api.InMemoryStore_getInstance()
4774-zorba = zorba_api.Zorba_getInstance(store)
4775-
4776-print "Running: XQuery execute - printPlanAsXML"
4777-test(zorba)
4778-print "Success"
4779-
4780-
4781-zorba.shutdown()
4782-zorba_api.InMemoryStore_shutdown(store)
4783-
4784
4785=== added file 'swig/python/tests/test05.xq'
4786--- swig/python/tests/test05.xq 1970-01-01 00:00:00 +0000
4787+++ swig/python/tests/test05.xq 2013-03-27 00:40:33 +0000
4788@@ -0,0 +1,7 @@
4789+for $x in (5,6,7,1,2,3,4)
4790+where $x < 4
4791+for $y in (4,9,6,8,2)
4792+let $z := $x * $y
4793+where $z > 20
4794+return
4795+<value x="{$x}" y="{$y}">{$z}</value>
4796\ No newline at end of file
4797
4798=== removed file 'swig/python/tests/test05.xq.in'
4799--- swig/python/tests/test05.xq.in 2013-02-07 17:24:36 +0000
4800+++ swig/python/tests/test05.xq.in 1970-01-01 00:00:00 +0000
4801@@ -1,7 +0,0 @@
4802-for $x in (5,6,7,1,2,3,4)
4803-where $x < 4
4804-for $y in (4,9,6,8,2)
4805-let $z := $x * $y
4806-where $z > 20
4807-return
4808-<value x="{$x}" y="{$y}">{$z}</value>
4809\ No newline at end of file
4810
4811=== added file 'swig/python/tests/test06.py'
4812--- swig/python/tests/test06.py 1970-01-01 00:00:00 +0000
4813+++ swig/python/tests/test06.py 2013-03-27 00:40:33 +0000
4814@@ -0,0 +1,42 @@
4815+# Copyright 2006-2011 The FLWOR Foundation.
4816+#
4817+# Licensed under the Apache License, Version 2.0 (the "License");
4818+# you may not use this file except in compliance with the License.
4819+# You may obtain a copy of the License at
4820+#
4821+# http://www.apache.org/licenses/LICENSE-2.0
4822+#
4823+# Unless required by applicable law or agreed to in writing, software
4824+# distributed under the License is distributed on an "AS IS" BASIS,
4825+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4826+# See the License for the specific language governing permissions and
4827+# limitations under the License.
4828+
4829+import sys
4830+sys.path.insert(0, '@pythonPath@')
4831+import zorba_api
4832+
4833+
4834+def test(zorba):
4835+ #Read and write result
4836+ print 'Executing: test06.xq'
4837+ f = open('test06.xq', 'r')
4838+ lines = f.read()
4839+ f.close()
4840+ xquery = zorba.compileQuery(lines)
4841+ result = xquery.printPlanAsDOT()
4842+ print result
4843+ return
4844+
4845+
4846+store = zorba_api.InMemoryStore_getInstance()
4847+zorba = zorba_api.Zorba_getInstance(store)
4848+
4849+print "Running: XQuery execute - printPlanAsXML"
4850+test(zorba)
4851+print "Success"
4852+
4853+
4854+zorba.shutdown()
4855+zorba_api.InMemoryStore_shutdown(store)
4856+
4857
4858=== removed file 'swig/python/tests/test06.py.in'
4859--- swig/python/tests/test06.py.in 2013-02-07 17:24:36 +0000
4860+++ swig/python/tests/test06.py.in 1970-01-01 00:00:00 +0000
4861@@ -1,42 +0,0 @@
4862-# Copyright 2006-2011 The FLWOR Foundation.
4863-#
4864-# Licensed under the Apache License, Version 2.0 (the "License");
4865-# you may not use this file except in compliance with the License.
4866-# You may obtain a copy of the License at
4867-#
4868-# http://www.apache.org/licenses/LICENSE-2.0
4869-#
4870-# Unless required by applicable law or agreed to in writing, software
4871-# distributed under the License is distributed on an "AS IS" BASIS,
4872-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4873-# See the License for the specific language governing permissions and
4874-# limitations under the License.
4875-
4876-import sys
4877-sys.path.insert(0, '@pythonPath@')
4878-import zorba_api
4879-
4880-
4881-def test(zorba):
4882- #Read and write result
4883- print 'Executing: test06.xq'
4884- f = open('test06.xq', 'r')
4885- lines = f.read()
4886- f.close()
4887- xquery = zorba.compileQuery(lines)
4888- result = xquery.printPlanAsDOT()
4889- print result
4890- return
4891-
4892-
4893-store = zorba_api.InMemoryStore_getInstance()
4894-zorba = zorba_api.Zorba_getInstance(store)
4895-
4896-print "Running: XQuery execute - printPlanAsXML"
4897-test(zorba)
4898-print "Success"
4899-
4900-
4901-zorba.shutdown()
4902-zorba_api.InMemoryStore_shutdown(store)
4903-
4904
4905=== added file 'swig/python/tests/test06.xq'
4906--- swig/python/tests/test06.xq 1970-01-01 00:00:00 +0000
4907+++ swig/python/tests/test06.xq 2013-03-27 00:40:33 +0000
4908@@ -0,0 +1,7 @@
4909+for $x in (5,6,7,1,2,3,4)
4910+where $x < 4
4911+for $y in (4,9,6,8,2)
4912+let $z := $x * $y
4913+where $z > 20
4914+return
4915+<value x="{$x}" y="{$y}">{$z}</value>
4916\ No newline at end of file
4917
4918=== removed file 'swig/python/tests/test06.xq.in'
4919--- swig/python/tests/test06.xq.in 2013-02-07 17:24:36 +0000
4920+++ swig/python/tests/test06.xq.in 1970-01-01 00:00:00 +0000
4921@@ -1,7 +0,0 @@
4922-for $x in (5,6,7,1,2,3,4)
4923-where $x < 4
4924-for $y in (4,9,6,8,2)
4925-let $z := $x * $y
4926-where $z > 20
4927-return
4928-<value x="{$x}" y="{$y}">{$z}</value>
4929\ No newline at end of file
4930
4931=== added file 'swig/python/tests/test07.1.py'
4932--- swig/python/tests/test07.1.py 1970-01-01 00:00:00 +0000
4933+++ swig/python/tests/test07.1.py 2013-03-27 00:40:33 +0000
4934@@ -0,0 +1,54 @@
4935+# Copyright 2006-2011 The FLWOR Foundation.
4936+#
4937+# Licensed under the Apache License, Version 2.0 (the "License");
4938+# you may not use this file except in compliance with the License.
4939+# You may obtain a copy of the License at
4940+#
4941+# http://www.apache.org/licenses/LICENSE-2.0
4942+#
4943+# Unless required by applicable law or agreed to in writing, software
4944+# distributed under the License is distributed on an "AS IS" BASIS,
4945+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4946+# See the License for the specific language governing permissions and
4947+# limitations under the License.
4948+
4949+import sys
4950+sys.path.insert(0, '@pythonPath@')
4951+import zorba_api
4952+
4953+
4954+def test(zorba):
4955+ f = open('books.xml', 'r')
4956+ lines = f.read()
4957+ f.close()
4958+
4959+ dataManager = zorba.getXmlDataManager()
4960+ docIter = dataManager.parseXML(lines)
4961+ docIter.open();
4962+
4963+ doc = zorba_api.Item_createEmptyItem()
4964+ docIter.next(doc)
4965+
4966+ docIter.close()
4967+ docIter.destroy()
4968+
4969+ docManager = dataManager.getDocumentManager()
4970+ docManager.put("my_fake_books.xml", doc)
4971+ xquery = zorba.compileQuery("doc('my_fake_books.xml')")
4972+
4973+ result = xquery.execute()
4974+ print result
4975+
4976+ return
4977+
4978+store = zorba_api.InMemoryStore_getInstance()
4979+zorba = zorba_api.Zorba_getInstance(store)
4980+
4981+print "Running: XQuery execute - parsing XML"
4982+test(zorba)
4983+print "Success"
4984+
4985+
4986+zorba.shutdown()
4987+zorba_api.InMemoryStore_shutdown(store)
4988+
4989
4990=== removed file 'swig/python/tests/test07.1.py.in'
4991--- swig/python/tests/test07.1.py.in 2013-02-07 17:24:36 +0000
4992+++ swig/python/tests/test07.1.py.in 1970-01-01 00:00:00 +0000
4993@@ -1,54 +0,0 @@
4994-# Copyright 2006-2011 The FLWOR Foundation.
4995-#
4996-# Licensed under the Apache License, Version 2.0 (the "License");
4997-# you may not use this file except in compliance with the License.
4998-# You may obtain a copy of the License at
4999-#
5000-# http://www.apache.org/licenses/LICENSE-2.0
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches