You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(368) |
Dec
(40) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(742) |
Feb
(67) |
Mar
(38) |
Apr
(54) |
May
(13) |
Jun
(89) |
Jul
(24) |
Aug
(170) |
Sep
(147) |
Oct
(47) |
Nov
(81) |
Dec
(75) |
2007 |
Jan
(50) |
Feb
(80) |
Mar
(29) |
Apr
(27) |
May
(12) |
Jun
(26) |
Jul
(43) |
Aug
(115) |
Sep
(41) |
Oct
(54) |
Nov
(137) |
Dec
(18) |
2008 |
Jan
(115) |
Feb
(57) |
Mar
(46) |
Apr
(64) |
May
(7) |
Jun
(6) |
Jul
(31) |
Aug
(77) |
Sep
(16) |
Oct
(28) |
Nov
(17) |
Dec
(13) |
2009 |
Jan
(41) |
Feb
(4) |
Mar
(9) |
Apr
(8) |
May
(16) |
Jun
(30) |
Jul
(6) |
Aug
(5) |
Sep
(16) |
Oct
(16) |
Nov
(8) |
Dec
(4) |
2010 |
Jan
(17) |
Feb
(20) |
Mar
(62) |
Apr
(15) |
May
(6) |
Jun
(2) |
Jul
|
Aug
(4) |
Sep
|
Oct
(6) |
Nov
|
Dec
(2) |
2011 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
(3) |
Jun
(20) |
Jul
(32) |
Aug
(17) |
Sep
(13) |
Oct
(1) |
Nov
(20) |
Dec
(2) |
2012 |
Jan
(3) |
Feb
|
Mar
(1) |
Apr
(1) |
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
(1) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Jens T. <sh...@ta...> - 2016-05-10 12:02:52
|
This is the correct XQuery script: let $html := fn:unparsed-text("utf8_1024.html") let $doc := xqilla:parse-html($html) for $x in $doc/html/head/meta return $x |
From: Jens T. <sh...@ta...> - 2016-05-10 11:59:15
|
Example: The attached XML file and this XQuery script triggers the issue in XQilla 2.3.3: let $html := fn:unparsed-text("utf8_1024.html") for $x in $doc/html/head/meta return $x Greetings |
From: Jens T. <sh...@ta...> - 2016-05-10 11:35:48
|
Hello, XPath2Utils::readSource has an issue reading files including multi-byte characters. If a multi-byte character is read in several steps (because of buffer limit) then subsequent reads are incorrect. Then an exception about not correct multi-byte character encoding is thrown. The following patch will correct this behavior: --- XPath2Utils-2.3.3.cpp 2015-05-18 10:39:00.000000000 +0200 +++ XPath2Utils.cpp 2016-05-10 12:59:22.462962100 +0200 @@ -348,5 +348,6 @@ if(nRead == 0 && nCount == 0) break; nRead += nOffset; + nOffset = 0; } while(nRead > 0); } Greetings |
From: Vladimir L. <vlo...@op...> - 2016-02-13 02:44:29
|
Hi, I have XQilla 2.3.2 release. When I call XPath functions doc() or collection() they always return one node with empty value does not matter what is XML document defined by URI path. Regards, Vladimir. |
From: Vladimir L. <vlo...@op...> - 2015-07-27 19:56:17
|
Hi, I am trying to switch XQilla 2.2.3, Xerces 3.1.0 built with Visual Studio 2008 to XQilla 2.3.2, Xerces 3.1.2 built with Visual Studio 2013. The new version of XQilla 2.3.2 resoled two problems. 1. Compilation errors with Visual Studio 2013 2. Crush inside XQilla binaries when it built with Visual Studio 2013 But it has a regression compare to XQilla 2.2.3. It requires that namespace "xs" has to be defined if you use any of XPath functions. The problem can be reproduced with http://xqilla.sourceforge.net/docs/dom3-api/dom-resolver_8cpp-example.html sample. I have to add resolver->addNamespaceBinding(X("xs"), X("http://www.w3.org/2001/XMLSchema")); in order to Create a parsed expression : "//*[local-name() = 'AuthenticateUserResult']" Is it right way to dial with the regression problem? Does somebody know other regressions with switching XQilla 2.2.3 -> XQilla 2.3.2? Thank you in advance, Vladimir. |
From: John S. <jo...@sn...> - 2015-02-03 12:58:39
|
Hi Lauren, How are you doing? I've added you as an admin for the XQilla project, as you only seemed to have read access before. Hopefully that will help you access Mercurial, but it's been ages since I used it and I don't remember enough to help you more. I seem to remember the Sourceforge site had good docs on how to access everything if you haven't looked there already. As an admin of the project you should also be able to open a support ticket with Sourceforge to get a real person there to help you get access. John On 02/02/15 16:22, Lauren Foutz wrote: > I have not checked anything in since before the move to Mercurial, and > now I am having trouble cloning the repository. I have tried the > following and gotten the following errors: > > $ hg clone ssh://lau...@hg.../p/xqilla/xqilla xqilla-repo > remote: Host key verification failed. > abort: no suitable response from remote hg! > > Event attempting an anonymous clone is failing: > $ hg clone http://hg.code.sf.net/p/xqilla/xqilla xqilla-repo > abort: HTTP Error 500: Internal Server Error > > Can anyone tell me what I am doing wrong? > > Thanks > > Lauren Foutz > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming. The Go Parallel Website, > sponsored by Intel and developed in partnership with Slashdot Media, is your > hub for all things parallel software development, from weekly thought > leadership blogs to news, videos, case studies, tutorials and more. Take a > look and join the conversation now. http://goparallel.sourceforge.net/ > _______________________________________________ > XQilla-devel mailing list > XQi...@li... > https://lists.sourceforge.net/lists/listinfo/xqilla-devel |
From: Lauren F. <lau...@or...> - 2015-02-02 16:23:10
|
I have not checked anything in since before the move to Mercurial, and now I am having trouble cloning the repository. I have tried the following and gotten the following errors: $ hg clone ssh://lau...@hg.../p/xqilla/xqilla xqilla-repo remote: Host key verification failed. abort: no suitable response from remote hg! Event attempting an anonymous clone is failing: $ hg clone http://hg.code.sf.net/p/xqilla/xqilla xqilla-repo abort: HTTP Error 500: Internal Server Error Can anyone tell me what I am doing wrong? Thanks Lauren Foutz |
From: Lin S. <lin...@ho...> - 2013-04-24 21:40:23
|
Hello all, I have the following code that process a DOMNode object (m_pNode). If the type of m_pNode is DOMElement, it works fine; when its type is DOMDocument, I get the root of the document by calling getDocumentElement(), and then use the element for creating DOMXPathNSResolver and DOMXPathResult. " DOMXPathException" happens on creating DOMXPathResult; Here is some information about the property of the document, and the query or XPath: Return value of m_pNode->getNodeName(): #document Return value of m_pNode->getDocumentElement()->getNodeName(): request Query: node() | @* Exception to be caught: DOMXPathException: code = 51; msg = expression has incorrect syntax or contains XPath features not supported by the XML Schema XPath subset INodeList * findNodes_v3(DOMNode *m_pNode, char *query){ if(m_pNode == 0) { std::cout << " 1). m_pNode is null ***** " << std::endl; return 0; } DOMDocument *pDoc = 0; DOMNode *tmpNode = m_pNode; DOMNode::NodeType type = m_pNode->getNodeType(); try { //============ for doc ============================ if(m_pNode->getNodeType() == DOMNode::DOCUMENT_NODE) { pDoc = (DOMDocument*)m_pNode; tmpNode = pDoc->getDocumentElement(); } //============ for Node ================== else { pDoc = m_pNode->getOwnerDocument(); if(pDoc == 0) { std::cout << " 2). doc = null ***** " << std::endl; return 0; } } AutoRelease<DOMXPathNSResolver> resolver(pDoc->createNSResolver(tmpNode)); DOMXPathResult *result = pDoc->evaluate(XString(__CLS_STR2PTR_A(Query)), tmpNode, resolver, DOMXPathResult::ORDERED_NODE_SNAPSHOT_TYPE, 0); .....<more code > .... return a-list-of-found-node; } catch (const DOMXPathException E) { std::cout << " DOMXPathException: code = " << E.code << "; msg = " << XMLString::transcode(E.msg) << " ******" << std::endl; return 0; } catch (const DOMException& E) { std::cout << " DOMException: code = " << E.code << "; msg = " << XMLString::transcode(E.msg) << " ******" << std::endl; return 0; }} Appreciate any suggestions and advice, Thank you, Ray |
From: SourceForge.net <no...@so...> - 2013-03-18 10:44:58
|
Bugs item #3608373, was opened at 2013-03-18 03:44 Message generated for change (Tracker Item Submitted) made by mrthoughtful You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=782848&aid=3608373&group_id=152021 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: mrthoughtful (mrthoughtful) Assigned to: Nobody/Anonymous (nobody) Summary: fn:functions mis-ordering elements. Initial Comment: This is the xml document that I'm testing against. <c>B<i>C</i>X</c> (//*/text())[2] returns "C" which appears to be what other engines return. However, fn:concat('[',(//*/text())[2],']') returns "[X]" which is unexpected (and inconsistent). Similarly, I tested fn:substring-before(), fn:substring-after(), and others with the same results. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=782848&aid=3608373&group_id=152021 |
From: SourceForge.net <no...@so...> - 2012-07-13 13:44:59
|
Bugs item #3543529, was opened at 2012-07-13 06:44 Message generated for change (Tracker Item Submitted) made by lauren_foutz You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=782848&aid=3543529&group_id=152021 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Lauren Foutz (lauren_foutz) Assigned to: Nobody/Anonymous (nobody) Summary: Crashes on any query when complied with VS2010 in Debug mode Initial Comment: I can confirm a bug in 2.3.0, that was originally reported in bug "Building with Microsoft VS 2010 needs std::allocator change - ID: 2981950", in which xqilla crashes when executing any query when xqilla is complied in VS2010 in Debug mode. The issue is that the standard library object, vector, is not allocated properly when initialized, which results the debug code in the standard library catching corrupted pointer errors when attempting to add items to the vector. Apparently the singleton optimization in the allocation code does not play well with the newer visual studio libraries. Included is a patch that fixes the problem by removing the singleton optimization when compiled with visual studio. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=782848&aid=3543529&group_id=152021 |
From: Lauren F. <lau...@or...> - 2012-07-11 21:10:50
|
I can confirm a bug in 2.3.0, that was originally reported in bug "Building with Microsoft VS 2010 needs std::allocator change - ID: 2981950", in which xqilla crashes when executing any query when xqilla is complied in VS2010 in Debug mode. The issue is that the standard library object, vector, is not allocated properly when initialized, which results the debug code in the standard library catching corrupted pointer errors when attempting to add items to the vector. Apparently the singleton optimization in the allocation code does not play well with the newer visual studio libraries. If this patch looks good, could someone please commit it to the xqilla tree? It has been forever since I worked with the development tree. Lauren Foutz |
From: SourceForge.net <no...@so...> - 2012-04-17 22:42:17
|
Bugs item #3518942, was opened at 2012-04-17 15:42 Message generated for change (Tracker Item Submitted) made by justinlitd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=782848&aid=3518942&group_id=152021 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: justinli (justinlitd) Assigned to: Nobody/Anonymous (nobody) Summary: Particular query fails Initial Comment: declare namespace ex = "http://www.example.com/"; declare function local:userFunction() { document-node(element(local:ncname)) };1 It's an xqts case. The expect result is 1. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=782848&aid=3518942&group_id=152021 |
From: SourceForge.net <no...@so...> - 2012-03-29 21:31:36
|
Bugs item #3512977, was opened at 2012-03-29 14:31 Message generated for change (Tracker Item Submitted) made by justinlitd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=782848&aid=3512977&group_id=152021 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: justinli (justinlitd) Assigned to: Nobody/Anonymous (nobody) Summary: fn:abs returns wrong data type Initial Comment: fn:abs(xs:integer(-4)) instance of xs:integer returns false which should be true. However, fn:abs(xs:integer(-4)) instance of xs:decimal returns true. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=782848&aid=3512977&group_id=152021 |
From: John S. <jo...@sn...> - 2012-01-30 10:44:25
|
Hi Sam, XQilla doesn't have any built in collections - you need to implement an instance of the URIResolver interface in order to define your own collections. http://xqilla.sourceforge.net/docs/simple-api/classURIResolver.html What were you hoping to be able to do using a collection? John On 24/01/12 03:22, sk...@we... wrote: > Hello, > > I am a newbie in using xqilla. > After reading the few example and played with xqilla a bit after > installing that on my centos machine. > But I can't find any example on how to program using collection for > xqilla. I would really need it to search through a pool of xml data, > sometimes they are in a directory and sometimes they are in a database. > Could someone me to some code that show how I can do both? I would > really appreciate that! > > thanks > > Sam |
From: <sk...@we...> - 2012-01-24 03:49:19
|
<html><body><span style="font-family:Verdana; color:#000000; font-size:10pt;"><div>Hello,</div><div><br></div><div>I am a newbie in using xqilla.</div><div>After reading the few example and played with xqilla a bit after installing that on my centos machine.</div><div>But I can't find any example on how to program using collection for xqilla. I would really need it to search through a pool of xml data, sometimes they are in a directory and sometimes they are in a database. Could someone me to some code that show how I can do both? I would really appreciate that!</div><div><br></div><div>thanks<br><br>Sam<br></div></span></body></html> |
From: SourceForge.net <no...@so...> - 2012-01-11 12:46:39
|
Bugs item #3472388, was opened at 2012-01-11 04:46 Message generated for change (Tracker Item Submitted) made by realrunc You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=782848&aid=3472388&group_id=152021 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Arkady Udinctsev (realrunc) Assigned to: Nobody/Anonymous (nobody) Summary: Stack overflow on execute fn functions Initial Comment: In last release 2.3 many functions in fn namespace have been written in FnModule.hpp (FnModule.xq) by xquery. And many of them are recursive, for example the sum. During execution for each iteration of a call there is creation AtomizeResult, OccurrenceMatchesResult, in call stack like so ... SequenceType::OccurrenceMatchesResult::next(DynamicContext * context=0x05e57a50) ResultImpl::nextOrTail(Result & tail={...}, DynamicContext * context=0x05e57a50) ResultImpl::next(DynamicContext * context=0x05e57a50) AtomizeResult::next(DynamicContext * context=0x05e57a50) SequenceType::OccurrenceMatchesResult::next(DynamicContext * context=0x05e57a50) ResultImpl::nextOrTail(Result & tail={...}, DynamicContext * context=0x05e57a50) ResultImpl::next(DynamicContext * context=0x05e57a50) AtomizeResult::next(DynamicContext * context=0x05e57a50) SequenceType::OccurrenceMatchesResult::next(DynamicContext * context=0x05e57a50) ResultImpl::nextOrTail(Result & tail={...}, DynamicContext * context=0x05e57a50) ResultImpl::next(DynamicContext * context=0x05e57a50) AtomizeResult::next(DynamicContext * context=0x05e57a50) SequenceType::OccurrenceMatchesResult::next(DynamicContext * context=0x05e57a50) ResultImpl::nextOrTail(Result & tail={...}, DynamicContext * context=0x05e57a50) ResultImpl::next(DynamicContext * context=0x05e57a50) AtomizeResult::next(DynamicContext * context=0x05e57a50) SequenceType::OccurrenceMatchesResult::next(DynamicContext * context=0x05e57a50) ResultImpl::nextOrTail(Result & tail={...}, DynamicContext * context=0x05e57a50) ... The quantity of repeated calls of functions depends on the size of argument. At achievement of some threshold occurs stack overflow. Example: sum(1 to 100000) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=782848&aid=3472388&group_id=152021 |
From: SourceForge.net <no...@so...> - 2011-12-29 23:40:47
|
Bugs item #3467165, was opened at 2011-12-29 15:40 Message generated for change (Tracker Item Submitted) made by justinlitd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=782848&aid=3467165&group_id=152021 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: justinli (justinlitd) Assigned to: Nobody/Anonymous (nobody) Summary: xs:float(" NaN ") ends up with an syntax error Initial Comment: Both xs:float(" NaN ") and xs:double(" NaN ") end up with an syntax error. It supposes to ignore the leading and trailing spaces. I fixed it by duplicate the value and trim it in ItemFactoryImpl.cpp and compare the trimmed version of value with NaN_string. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=782848&aid=3467165&group_id=152021 |
From: SourceForge.net <no...@so...> - 2011-12-27 23:53:39
|
Bugs item #3466165, was opened at 2011-12-27 15:53 Message generated for change (Tracker Item Submitted) made by justinlitd You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=782848&aid=3466165&group_id=152021 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: justinli (justinlitd) Assigned to: Nobody/Anonymous (nobody) Summary: cast as float returns wrong result Initial Comment: xs:decimal(12678967.543233) cast as xs:float It should return 1.2678968e7 rather than 1.2678967543233e7. I looked at Numeric.cpp and ATFloatOrDerivedImpl.cpp. It just check limits of an input value rather than convert it. In standard, it says: value space of float consists of the values m × 2^e, where m is an integer whose absolute value is less than 2^24, and e is an integer between -149 and 104, inclusive. And 12678967.543133 can not be represented by float accurately. Nonetheless a round value should be returned for it. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=782848&aid=3466165&group_id=152021 |
From: John S. <joh...@ma...> - 2011-11-16 02:25:31
|
details: http://xqilla.hg.sourceforge.net/hgweb/xqilla/xqilla/rev/6468e5681607 branch: xqilla_2_3 changeset: 1676:6468e5681607 user: John Snelson <joh...@ma...> date: Wed Nov 16 02:24:54 2011 +0000 description: Added tag xqilla_2_3_0 for changeset dbe214f5d780 diffstat: .hgtags | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diffs (8 lines): diff -r dbe214f5d780 -r 6468e5681607 .hgtags --- a/.hgtags Wed Sep 21 18:36:45 2011 -0700 +++ b/.hgtags Wed Nov 16 02:24:54 2011 +0000 @@ -3,3 +3,4 @@ b05575026a06b0b5d62dd1b98f160aa3f7b3d7b5 xqilla_2_2_3 b6653f624abe07bc57854318acfd6773873d99b4 xqilla_2_2_2 33b91804cb3b9d9c67ac0d3670df55304d1507e2 xqilla_2_2_4 +dbe214f5d780e6e647698affe3008f85d80ec007 xqilla_2_3_0 |
From: John S. <joh...@ma...> - 2011-11-16 02:24:21
|
details: http://xqilla.hg.sourceforge.net/hgweb/xqilla/xqilla/rev/595a4ecbd9c0 branch: changeset: 1675:595a4ecbd9c0 user: John Snelson <joh...@ma...> date: Wed Nov 16 02:18:51 2011 +0000 description: Implemented XQuery 3.0 switch expressions. diffstat: Makefile.am | 1 + Makefile.in | 34 +- include/Makefile.am | 1 + include/Makefile.in | 1 + include/xqilla/ast/ASTNode.hpp | 1 + include/xqilla/ast/XQSwitch.hpp | 72 + include/xqilla/optimizer/ASTToXML.hpp | 1 + include/xqilla/optimizer/ASTVisitor.hpp | 2 + include/xqilla/schema/SequenceType.hpp | 1 + src/ast/XQSwitch.cpp | 190 + src/functions/FunctionDistinctValues.cpp | 2 +- src/functions/XQillaModule.hpp | 226 +- src/functions/XQillaModule.xq | 194 +- src/items/AnyAtomicType.cpp | 2 + src/lexer/XQLexer.cpp | 9997 +++++++++++++------------- src/lexer/XQLexer.hpp | 2 + src/lexer/XQLexer.l | 7 + src/optimizer/ASTCopier.cpp | 21 + src/optimizer/ASTReleaser.cpp | 24 + src/optimizer/ASTToXML.cpp | 38 +- src/optimizer/ASTVisitor.cpp | 19 + src/optimizer/QueryPathTreeGenerator.cpp | 20 + src/parser/XQParser.cpp | 10558 ++++++++++++++-------------- src/parser/XQParser.hpp | 698 +- src/parser/XQParser.y | 46 +- src/schema/SequenceType.cpp | 1 + 26 files changed, 11368 insertions(+), 10791 deletions(-) diffs (truncated from 28118 to 500 lines): diff -r 844ccbe82aec -r 595a4ecbd9c0 Makefile.am --- a/Makefile.am Wed Nov 16 02:18:50 2011 +0000 +++ b/Makefile.am Wed Nov 16 02:18:51 2011 +0000 @@ -78,6 +78,7 @@ src/ast/XQQuantified.cpp \ src/ast/XQValidate.cpp \ src/ast/XQTypeswitch.cpp \ +src/ast/XQSwitch.cpp \ src/ast/ConvertFunctionArg.cpp \ src/ast/XQDocumentOrder.cpp \ src/ast/XQPredicate.cpp \ diff -r 844ccbe82aec -r 595a4ecbd9c0 Makefile.in --- a/Makefile.in Wed Nov 16 02:18:50 2011 +0000 +++ b/Makefile.in Wed Nov 16 02:18:51 2011 +0000 @@ -107,18 +107,19 @@ XQFunctionDeref.lo XQPartialApply.lo XQFunctionRef.lo \ XQGlobalVariable.lo XQTypeAlias.lo XQRewriteRule.lo \ XQOrderingChange.lo XQQuantified.lo XQValidate.lo \ - XQTypeswitch.lo ConvertFunctionArg.lo XQDocumentOrder.lo \ - XQPredicate.lo XQReturn.lo XQTupleConstructor.lo \ - XQTupleMember.lo TupleNode.lo ContextTuple.lo ForTuple.lo \ - LetTuple.lo WhereTuple.lo CountTuple.lo OrderByTuple.lo \ - XQNamespaceBinding.lo XQCallTemplate.lo XQApplyTemplates.lo \ - ASTDebugHook.lo DebugHookDecorator.lo TupleDebugHook.lo \ - InputParser.lo InteractiveDebugger.lo StackFrame.lo \ - ContentSequenceFilter.lo EventGenerator.lo EventSerializer.lo \ - NoInheritFilter.lo NSFixupFilter.lo QueryPathTreeFilter.lo \ - FTContains.lo FTWords.lo FTOr.lo FTAnd.lo FTMildnot.lo \ - FTUnaryNot.lo DefaultTokenizer.lo DefaultTokenStore.lo \ - FTOrder.lo FTDistance.lo FTScope.lo FTContent.lo FTWindow.lo \ + XQTypeswitch.lo XQSwitch.lo ConvertFunctionArg.lo \ + XQDocumentOrder.lo XQPredicate.lo XQReturn.lo \ + XQTupleConstructor.lo XQTupleMember.lo TupleNode.lo \ + ContextTuple.lo ForTuple.lo LetTuple.lo WhereTuple.lo \ + CountTuple.lo OrderByTuple.lo XQNamespaceBinding.lo \ + XQCallTemplate.lo XQApplyTemplates.lo ASTDebugHook.lo \ + DebugHookDecorator.lo TupleDebugHook.lo InputParser.lo \ + InteractiveDebugger.lo StackFrame.lo ContentSequenceFilter.lo \ + EventGenerator.lo EventSerializer.lo NoInheritFilter.lo \ + NSFixupFilter.lo QueryPathTreeFilter.lo FTContains.lo \ + FTWords.lo FTOr.lo FTAnd.lo FTMildnot.lo FTUnaryNot.lo \ + DefaultTokenizer.lo DefaultTokenStore.lo FTOrder.lo \ + FTDistance.lo FTScope.lo FTContent.lo FTWindow.lo \ XQillaBuilderImpl.lo XQillaDocumentImpl.lo \ XQillaExpressionImpl.lo XQillaNSResolverImpl.lo \ XQillaXMLGrammarPoolImpl.lo XPathDocumentImpl.lo \ @@ -549,6 +550,7 @@ src/ast/XQQuantified.cpp \ src/ast/XQValidate.cpp \ src/ast/XQTypeswitch.cpp \ +src/ast/XQSwitch.cpp \ src/ast/ConvertFunctionArg.cpp \ src/ast/XQDocumentOrder.cpp \ src/ast/XQPredicate.cpp \ @@ -1490,6 +1492,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XQRewriteRule.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XQSequence.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XQStep.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XQSwitch.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XQTextConstructor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XQTreatAs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/XQTupleConstructor.Plo@am__quote@ @@ -2302,6 +2305,13 @@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XQTypeswitch.lo `test -f 'src/ast/XQTypeswitch.cpp' || echo '$(srcdir)/'`src/ast/XQTypeswitch.cpp +XQSwitch.lo: src/ast/XQSwitch.cpp +@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT XQSwitch.lo -MD -MP -MF $(DEPDIR)/XQSwitch.Tpo -c -o XQSwitch.lo `test -f 'src/ast/XQSwitch.cpp' || echo '$(srcdir)/'`src/ast/XQSwitch.cpp +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/XQSwitch.Tpo $(DEPDIR)/XQSwitch.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='src/ast/XQSwitch.cpp' object='XQSwitch.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o XQSwitch.lo `test -f 'src/ast/XQSwitch.cpp' || echo '$(srcdir)/'`src/ast/XQSwitch.cpp + ConvertFunctionArg.lo: src/ast/ConvertFunctionArg.cpp @am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT ConvertFunctionArg.lo -MD -MP -MF $(DEPDIR)/ConvertFunctionArg.Tpo -c -o ConvertFunctionArg.lo `test -f 'src/ast/ConvertFunctionArg.cpp' || echo '$(srcdir)/'`src/ast/ConvertFunctionArg.cpp @am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/ConvertFunctionArg.Tpo $(DEPDIR)/ConvertFunctionArg.Plo diff -r 844ccbe82aec -r 595a4ecbd9c0 include/Makefile.am --- a/include/Makefile.am Wed Nov 16 02:18:50 2011 +0000 +++ b/include/Makefile.am Wed Nov 16 02:18:51 2011 +0000 @@ -45,6 +45,7 @@ xqilla/ast/XQOrderingChange.hpp \ xqilla/ast/XQQuantified.hpp \ xqilla/ast/XQTypeswitch.hpp \ +xqilla/ast/XQSwitch.hpp \ xqilla/ast/XQValidate.hpp \ xqilla/ast/XQAtomize.hpp \ xqilla/ast/XQEffectiveBooleanValue.hpp \ diff -r 844ccbe82aec -r 595a4ecbd9c0 include/Makefile.in --- a/include/Makefile.in Wed Nov 16 02:18:50 2011 +0000 +++ b/include/Makefile.in Wed Nov 16 02:18:51 2011 +0000 @@ -261,6 +261,7 @@ xqilla/ast/XQOrderingChange.hpp \ xqilla/ast/XQQuantified.hpp \ xqilla/ast/XQTypeswitch.hpp \ +xqilla/ast/XQSwitch.hpp \ xqilla/ast/XQValidate.hpp \ xqilla/ast/XQAtomize.hpp \ xqilla/ast/XQEffectiveBooleanValue.hpp \ diff -r 844ccbe82aec -r 595a4ecbd9c0 include/xqilla/ast/ASTNode.hpp --- a/include/xqilla/ast/ASTNode.hpp Wed Nov 16 02:18:50 2011 +0000 +++ b/include/xqilla/ast/ASTNode.hpp Wed Nov 16 02:18:51 2011 +0000 @@ -59,6 +59,7 @@ DOM_CONSTRUCTOR, QUANTIFIED, TYPESWITCH, + SWITCH, VALIDATE, FUNCTION_CALL, USER_FUNCTION, diff -r 844ccbe82aec -r 595a4ecbd9c0 include/xqilla/ast/XQSwitch.hpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/include/xqilla/ast/XQSwitch.hpp Wed Nov 16 02:18:51 2011 +0000 @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2010, 2011, + * John Snelson. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef XQSWITCH_HPP +#define XQSWITCH_HPP + +#include <xqilla/ast/ASTNodeImpl.hpp> + +class XQILLA_API XQSwitch : public ASTNodeImpl +{ +public: + class Case : public LocationInfo + { + public: + Case(XPath2MemoryManager *mm); + + void staticResolution(StaticContext* context); + void staticTyping(StaticContext* context, StaticAnalysis &src); + + VectorOfASTNodes &getValues() { return values_; } + + ASTNode *getExpression() const { return expr_; } + void setExpression(ASTNode *expr) { expr_ = expr; } + + private: + VectorOfASTNodes values_; + ASTNode *expr_; + }; + + typedef std::vector<Case*, XQillaAllocator<Case*> > Cases; + + XQSwitch(ASTNode *expr, XPath2MemoryManager *mm); + + virtual ASTNode *staticResolution(StaticContext *context); + virtual ASTNode *staticTypingImpl(StaticContext *context); + + virtual Result createResult(DynamicContext* context, int flags=0) const; + virtual EventGenerator::Ptr generateEvents(EventHandler *events, DynamicContext *context, + bool preserveNS, bool preserveType) const; + virtual PendingUpdateList createUpdateList(DynamicContext *context) const; + + const ASTNode *chooseCase(DynamicContext *context) const; + + ASTNode *getExpression() const { return expr_; } + void setExpression(ASTNode *expr) { expr_ = expr; } + + Cases &getCases() { return cases_; } + + ASTNode *getDefault() const { return default_; } + void setDefault(ASTNode *expr) { default_ = expr; } + +private: + ASTNode *expr_; + Cases cases_; + ASTNode *default_; +}; + +#endif diff -r 844ccbe82aec -r 595a4ecbd9c0 include/xqilla/optimizer/ASTToXML.hpp --- a/include/xqilla/optimizer/ASTToXML.hpp Wed Nov 16 02:18:50 2011 +0000 +++ b/include/xqilla/optimizer/ASTToXML.hpp Wed Nov 16 02:18:51 2011 +0000 @@ -67,6 +67,7 @@ virtual ASTNode *optimizeCastAs(XQCastAs *item); virtual ASTNode *optimizeFunctionCoercion(XQFunctionCoercion *item); virtual ASTNode *optimizeTypeswitch(XQTypeswitch *item); + virtual ASTNode *optimizeSwitch(XQSwitch *item); virtual ASTNode *optimizePartialApply(XQPartialApply *item); virtual ASTNode *optimizeFunctionRef(XQFunctionRef *item); virtual ASTNode *optimizeFunctionConversion(XQFunctionConversion *item); diff -r 844ccbe82aec -r 595a4ecbd9c0 include/xqilla/optimizer/ASTVisitor.hpp --- a/include/xqilla/optimizer/ASTVisitor.hpp Wed Nov 16 02:18:50 2011 +0000 +++ b/include/xqilla/optimizer/ASTVisitor.hpp Wed Nov 16 02:18:51 2011 +0000 @@ -46,6 +46,7 @@ #include <xqilla/ast/XQGlobalVariable.hpp> #include <xqilla/ast/XQRewriteRule.hpp> #include <xqilla/ast/XQTypeswitch.hpp> +#include <xqilla/ast/XQSwitch.hpp> #include <xqilla/ast/XQValidate.hpp> #include <xqilla/ast/XQOrderingChange.hpp> #include <xqilla/ast/XQAtomize.hpp> @@ -132,6 +133,7 @@ virtual ASTNode *optimizeTupleMember(XQTupleMember *item); \ virtual ASTNode *optimizeQuantified(XQQuantified *item); \ virtual ASTNode *optimizeTypeswitch(XQTypeswitch *item); \ + virtual ASTNode *optimizeSwitch(XQSwitch *item); \ virtual ASTNode *optimizeValidate(XQValidate *item); \ virtual ASTNode *optimizeFunctionCall(XQFunctionCall *item); \ virtual ASTNode *optimizeDOMConstructor(XQDOMConstructor *item); \ diff -r 844ccbe82aec -r 595a4ecbd9c0 include/xqilla/schema/SequenceType.hpp --- a/include/xqilla/schema/SequenceType.hpp Wed Nov 16 02:18:50 2011 +0000 +++ b/include/xqilla/schema/SequenceType.hpp Wed Nov 16 02:18:51 2011 +0000 @@ -207,6 +207,7 @@ public: static const SequenceType ANY_ATOMIC_TYPE; static const SequenceType ITEM_STAR; + static const SequenceType ITEM_QUESTION; /** * Number of occurrences of the ItemType. diff -r 844ccbe82aec -r 595a4ecbd9c0 src/ast/XQSwitch.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ast/XQSwitch.cpp Wed Nov 16 02:18:51 2011 +0000 @@ -0,0 +1,190 @@ +/* + * Copyright (c) 2010, 201, + * John Snelson. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include <xqilla/ast/XQSwitch.hpp> +#include <xqilla/ast/StaticAnalysis.hpp> +#include <xqilla/ast/XQAtomize.hpp> +#include <xqilla/ast/XQTreatAs.hpp> +#include <xqilla/utils/XPath2NSUtils.hpp> +#include <xqilla/context/DynamicContext.hpp> +#include <xqilla/update/PendingUpdateList.hpp> +#include <xqilla/runtime/ClosureResult.hpp> + +XQSwitch::XQSwitch(ASTNode *expr, XPath2MemoryManager *mm) + : ASTNodeImpl(SWITCH, mm), + expr_(expr), + cases_(XQillaAllocator<Case*>(mm)), + default_(0) +{ +} + +ASTNode* XQSwitch::staticResolution(StaticContext *context) +{ + XPath2MemoryManager *mm = context->getMemoryManager(); + + // Statically resolve the test expression + expr_ = new (mm) XQAtomize(expr_, mm); + expr_->setLocationInfo(this); + expr_ = new (mm) XQTreatAs(expr_, (SequenceType*)&SequenceType::ITEM_QUESTION, mm); + expr_->setLocationInfo(this); + expr_ = expr_->staticResolution(context); + + // Call static resolution on the clauses + for(Cases::iterator it = cases_.begin(); it != cases_.end(); ++it) { + (*it)->staticResolution(context); + } + + default_ = default_->staticResolution(context); + + return this; +} + +ASTNode *XQSwitch::staticTypingImpl(StaticContext *context) +{ + _src.clear(); + + // Statically resolve the test expression + const StaticAnalysis &exprSrc = expr_->getStaticAnalysis(); + + // Call static resolution on the clauses + _src.add(exprSrc); + + _src.add(default_->getStaticAnalysis()); + _src.getStaticType() = default_->getStaticAnalysis().getStaticType(); + _src.setProperties(default_->getStaticAnalysis().getProperties()); + + Cases::iterator it; + for(it = cases_.begin(); it != cases_.end(); ++it) { + (*it)->staticTyping(context, _src); + } + + return this; + + // TBD Constant folding - jpcs + // XPath2MemoryManager *mm = context->getMemoryManager(); + + // if(!exprSrc.isUsed()) { + // bool found = false; + // Cases newCases = Cases(XQillaAllocator<Case*>(mm)); + // for(it = cases_.begin(); it != cases_.end(); ++it) { + // Case *newCase = new (mm) Case(mm); + // for(VectorOfASTNodes::iterator v = (*it)->getValues().begin(); v != (*it)->getValues().end(); ++v) { + // } + + // SequenceType::TypeMatch match = (*it)->getSequenceType()->matches(sType); + // if(found || match.type == SequenceType::NEVER || match.cardinality == SequenceType::NEVER) { + // // It never matches + // (*it)->getExpression()->release(); + // mm->deallocate(*it); + // } + // else if(match.type == SequenceType::ALWAYS && + // match.cardinality == SequenceType::ALWAYS) { + // // It always matches, so set this clause as the + // // default clause and remove all clauses after it + // default_->getExpression()->release(); + // mm->deallocate(default_); + // default_ = *it; + // found = true; + // } + // else { + // newCases.push_back(*it); + // } + // } + + // if(newCases.size() == cases_->size()) { + // // No change + // return this; + // } + + // *cases_ = newCases; + // } + + // // Call static resolution on the new clauses + // _src.clear(); + // _src.add(exprSrc); + + // default_->staticTyping(expr_->getStaticAnalysis(), context, _src); + + // for(it = cases_->begin(); it != cases_->end(); ++it) { + // (*it)->staticTyping(expr_->getStaticAnalysis(), context, _src); + // } + + // return this; +} + +XQSwitch::Case::Case(XPath2MemoryManager *mm) + : values_(XQillaAllocator<ASTNode*>(mm)), + expr_(0) +{ +} + +void XQSwitch::Case::staticResolution(StaticContext* context) +{ + XPath2MemoryManager *mm = context->getMemoryManager(); + + for(VectorOfASTNodes::iterator i = values_.begin(); i != values_.end(); ++i) { + (*i) = new (mm) XQAtomize((*i), mm); + (*i)->setLocationInfo(this); + (*i) = new (mm) XQTreatAs((*i), (SequenceType*)&SequenceType::ITEM_QUESTION, mm); + (*i)->setLocationInfo(this); + (*i) = (*i)->staticResolution(context); + } + + expr_ = expr_->staticResolution(context); +} + +void XQSwitch::Case::staticTyping(StaticContext* context, StaticAnalysis &src) +{ + for(VectorOfASTNodes::iterator i = values_.begin(); i != values_.end(); ++i) { + src.add((*i)->getStaticAnalysis()); + } + src.getStaticType().typeUnion(expr_->getStaticAnalysis().getStaticType()); + src.setProperties(src.getProperties() & expr_->getStaticAnalysis().getProperties()); + src.add(expr_->getStaticAnalysis()); +} + +const ASTNode *XQSwitch::chooseCase(DynamicContext *context) const +{ + AnyAtomicType::Ptr value = (AnyAtomicType*)expr_->createResult(context)->next(context).get(); + + for(Cases::const_iterator it = cases_.begin(); it != cases_.end(); ++it) { + for(VectorOfASTNodes::const_iterator v = (*it)->getValues().begin(); v != (*it)->getValues().end(); ++v) { + AnyAtomicType::Ptr item = (AnyAtomicType*)(*v)->createResult(context)->next(context).get(); + if((value.isNull() && item.isNull()) || value->compare(item, 0, context) == 0) + return (*it)->getExpression(); + } + } + + return default_; +} + +EventGenerator::Ptr XQSwitch::generateEvents(EventHandler *events, DynamicContext *context, + bool preserveNS, bool preserveType) const +{ + return new ClosureEventGenerator(chooseCase(context), context, preserveNS, preserveType); +} + +PendingUpdateList XQSwitch::createUpdateList(DynamicContext *context) const +{ + return chooseCase(context)->createUpdateList(context); +} + +Result XQSwitch::createResult(DynamicContext *context, int flags) const +{ + return chooseCase(context)->createResult(context); +} + diff -r 844ccbe82aec -r 595a4ecbd9c0 src/functions/FunctionDistinctValues.cpp --- a/src/functions/FunctionDistinctValues.cpp Wed Nov 16 02:18:50 2011 +0000 +++ b/src/functions/FunctionDistinctValues.cpp Wed Nov 16 02:18:51 2011 +0000 @@ -124,7 +124,7 @@ default: break; } - assert(false); + // They are both null return 0; } diff -r 844ccbe82aec -r 595a4ecbd9c0 src/functions/XQillaModule.hpp --- a/src/functions/XQillaModule.hpp Wed Nov 16 02:18:50 2011 +0000 +++ b/src/functions/XQillaModule.hpp Wed Nov 16 02:18:51 2011 +0000 @@ -12,145 +12,150 @@ static const DelayedModule::Decl xqilla_declarations[] = { { - DelayedModule::Decl::FUNCTION, "parse-json", 1, false, 8, 1, + DelayedModule::Decl::FUNCTION, "parse-json", 1, false, 25, 1, "declare function xqilla:parse-json($json as xs:string)\n" " as element()?\n" "{\n" " let $res := xqilla:parseValue(xqilla:tokenize($json))\n" " return\n" - " if(exists(remove($res,1))) then xqilla:parseError($res[2])\n" - " else element json {\n" - " $res[1]/@*,\n" - " $res[1]/node()\n" - " }\n" + " if(empty(tail($res))) then head($res)\n" + " else xqilla:parseError($res[2])\n" "}" }, { - DelayedModule::Decl::FUNCTION, "parseValue", 1, true, 20, 1, + DelayedModule::Decl::FUNCTION, "parseValue", 1, true, 34, 1, "declare %private function xqilla:parseValue($tokens as element(token)*)\n" "{\n" - " let $token := $tokens[1]\n" - " let $tokens := remove($tokens,1)\n" + " let $token := head($tokens)\n" + " let $tokens := tail($tokens)\n" " return\n" - " if($token/@t = \"lbrace\") then (\n" + " switch($token/@t)\n" + " case \"lbrace\" return\n" " let $res := xqilla:parseObject($tokens)\n" - " let $tokens := remove($res,1)\n" + " let $tokens := tail($res)\n" " return (\n" - " element res {\n" + " element json {\n" " attribute type { \"object\" },\n" - " $res[1]/node()\n" + " head($res)/node()\n" " },\n" " $tokens\n" " )\n" - " ) else if ($token/@t = \"lsquare\") then (\n" + " case \"lsquare\" return\n" " let $res := xqilla:parseArray($tokens)\n" - " let $tokens := remove($res,1)\n" + " let $tokens := tail($res)\n" " return (\n" - " element res {\n" + " element json {\n" " attribute type { \"array\" },\n" - " $res[1]/node()\n" + " head($res)/node()\n" " },\n" " $tokens\n" " )\n" - " ) else if ($token/@t = \"number\") then (\n" - " element res {\n" + " case \"number\" return (\n" + " element json {\n" " attribute type { \"number\" },\n" " text { $token }\n" |
From: John S. <joh...@ma...> - 2011-11-16 02:24:21
|
details: http://xqilla.hg.sourceforge.net/hgweb/xqilla/xqilla/rev/844ccbe82aec branch: changeset: 1674:844ccbe82aec user: John Snelson <joh...@ma...> date: Wed Nov 16 02:18:50 2011 +0000 description: Remove unneeded repeat of static typing phases. diffstat: src/simple-api/XQQuery.cpp | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-) diffs (14 lines): diff -r 826d4396730d -r 844ccbe82aec src/simple-api/XQQuery.cpp --- a/src/simple-api/XQQuery.cpp Wed Nov 16 02:18:49 2011 +0000 +++ b/src/simple-api/XQQuery.cpp Wed Nov 16 02:18:50 2011 +0000 @@ -488,10 +488,6 @@ // Run staticTyping on the user defined functions, // which calculates a better type for them for(i = m_userDefFns.begin(); i != m_userDefFns.end(); ++i) { - for(j = m_userDefFns.begin(); j != m_userDefFns.end(); ++j) { - (*j)->resetStaticTypingOnce(); - } - (*i)->staticTypingOnce(m_context, styper); } |
From: John S. <joh...@ma...> - 2011-11-16 02:24:20
|
details: http://xqilla.hg.sourceforge.net/hgweb/xqilla/xqilla/rev/826d4396730d branch: changeset: 1673:826d4396730d user: John Snelson <joh...@ma...> date: Wed Nov 16 02:18:49 2011 +0000 description: Optimize collation lookup. diffstat: src/context/impl/XQContextImpl.cpp | 35 ++++++++++++++++------------------- 1 files changed, 16 insertions(+), 19 deletions(-) diffs (48 lines): diff -r cf6ea365bac8 -r 826d4396730d src/context/impl/XQContextImpl.cpp --- a/src/context/impl/XQContextImpl.cpp Wed Nov 16 02:18:49 2011 +0000 +++ b/src/context/impl/XQContextImpl.cpp Wed Nov 16 02:18:49 2011 +0000 @@ -677,28 +677,25 @@ Collation* XQContextImpl::getCollation(const XMLCh* URI, const LocationInfo *location) const { - if(!XMLUri::isValidURI(false, URI)) - { - const XMLCh* baseURI=getBaseURI(); - if(baseURI && *baseURI) - { - try - { - XMLUri base(baseURI, getMemoryManager()); - XMLUri full(&base, URI, getMemoryManager()); - URI = getMemoryManager()->getPooledString(full.getUriText()); - } - catch(XMLException &e) - { - //if can't build, assume it's because there was an invalid base URI, so use the original URI - } - } - } - for(std::vector<Collation*, XQillaAllocator<Collation*> >::const_iterator it= _collations.begin(); it!=_collations.end(); ++it) + std::vector<Collation*, XQillaAllocator<Collation*> >::const_iterator it = _collations.begin(); + for(; it!=_collations.end(); ++it) if(XPath2Utils::equals((*it)->getCollationName(), URI)) return (*it); + + const XMLCh* baseURI=getBaseURI(); + if(baseURI && *baseURI) { + try { + XMLUri base(baseURI, getMemoryManager()); + XMLUri full(&base, URI, getMemoryManager()); + URI = getMemoryManager()->getPooledString(full.getUriText()); + + for(it = _collations.begin(); it!=_collations.end(); ++it) + if(XPath2Utils::equals((*it)->getCollationName(), URI)) + return (*it); + } catch(XMLException &e) {} + } + const XMLCh* msg = XPath2Utils::concatStrings(X("The requested collation ('"), URI, X("') is not defined [err:FOCH0002]"), getMemoryManager()); - XQThrow3(ContextException, X("XQContextImpl::getCollation"), msg, location); return NULL; } |
From: John S. <joh...@ma...> - 2011-11-16 02:24:20
|
details: http://xqilla.hg.sourceforge.net/hgweb/xqilla/xqilla/rev/cf6ea365bac8 branch: changeset: 1672:cf6ea365bac8 user: John Snelson <joh...@ma...> date: Wed Nov 16 02:18:49 2011 +0000 description: Don't look up the default collation when constructing a TupleImpl. diffstat: src/ast/ContextTuple.cpp | 2 +- src/functions/FunctionDistinctValues.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletions(-) diffs (23 lines): diff -r ef8811760e8b -r cf6ea365bac8 src/ast/ContextTuple.cpp --- a/src/ast/ContextTuple.cpp Wed Nov 16 02:18:48 2011 +0000 +++ b/src/ast/ContextTuple.cpp Wed Nov 16 02:18:49 2011 +0000 @@ -62,7 +62,7 @@ virtual void createTuple(DynamicContext *context, size_t capacity, TupleImpl::Ptr &result) const { - result = new TupleImpl(capacity, context->getDefaultCollation(this), context); + result = new TupleImpl(capacity, 0, context); } private: diff -r ef8811760e8b -r cf6ea365bac8 src/functions/FunctionDistinctValues.cpp --- a/src/functions/FunctionDistinctValues.cpp Wed Nov 16 02:18:48 2011 +0000 +++ b/src/functions/FunctionDistinctValues.cpp Wed Nov 16 02:18:49 2011 +0000 @@ -89,6 +89,7 @@ // Items are comparable switch(atype) { case AnyAtomicType::STRING: + if(collation == 0) collation = context->getDefaultCollation(0); return collation->compare(a->asString(context), b->asString(context)); case AnyAtomicType::DOUBLE: return ((const Numeric *)a)->compare((const Numeric *)b.get(), context); |
From: John S. <joh...@ma...> - 2011-11-16 02:24:20
|
details: http://xqilla.hg.sourceforge.net/hgweb/xqilla/xqilla/rev/ef8811760e8b branch: changeset: 1671:ef8811760e8b user: John Snelson <joh...@ma...> date: Wed Nov 16 02:18:48 2011 +0000 description: Don't pointlessly check a QName constructed from its parts. diffstat: src/context/impl/ItemFactoryImpl.cpp | 29 +++-------------------------- 1 files changed, 3 insertions(+), 26 deletions(-) diffs (46 lines): diff -r 4f7337f4cc86 -r ef8811760e8b src/context/impl/ItemFactoryImpl.cpp --- a/src/context/impl/ItemFactoryImpl.cpp Wed Nov 16 02:18:47 2011 +0000 +++ b/src/context/impl/ItemFactoryImpl.cpp Wed Nov 16 02:18:48 2011 +0000 @@ -73,14 +73,8 @@ const XMLCh* name, const DynamicContext* context ) { - return createQNameOrDerived( - SchemaSymbols::fgURI_SCHEMAFORSCHEMA, - SchemaSymbols::fgDT_QNAME, - uri, - prefix, - name, - context - ); + return new ATQNameOrDerivedImpl(SchemaSymbols::fgURI_SCHEMAFORSCHEMA, SchemaSymbols::fgDT_QNAME, + uri, prefix, name, context); } ATDoubleOrDerived::Ptr ItemFactoryImpl::createDouble(double value, const DynamicContext* context) @@ -453,24 +447,7 @@ const XMLCh* name, const DynamicContext* context) { - ATQNameOrDerivedImpl* tmp = new ATQNameOrDerivedImpl(typeURI, typeName, uri, prefix, name, context); - - const DatatypeFactory* dtf_anyURI = datatypeLookup_->getAnyURIFactory(); - if(dtf_anyURI->checkInstance(uri, context->getMemoryManager())) { - const DatatypeFactory* dtf_NCName = datatypeLookup_->getStringFactory(); - if (dtf_NCName->checkInstance(SchemaSymbols::fgURI_SCHEMAFORSCHEMA, SchemaSymbols::fgDT_NCNAME, name, context->getMemoryManager())) { - return tmp; - } else { - // this call will obviously fail, but it is better for error reporting, - // since we actually get the XMLException's error message - return (const ATQNameOrDerived::Ptr )dtf_NCName-> - createInstance(SchemaSymbols::fgURI_SCHEMAFORSCHEMA, SchemaSymbols::fgDT_NCNAME, name, context); - } - } else { - // this call will obviously fail, but it is better for error reporting, - // since we actually get the XMLException's error message - return (const ATQNameOrDerived::Ptr )dtf_anyURI->createInstance(uri, context); - } + return new ATQNameOrDerivedImpl(typeURI, typeName, uri, prefix, name, context); } |
From: John S. <joh...@ma...> - 2011-11-16 02:24:19
|
details: http://xqilla.hg.sourceforge.net/hgweb/xqilla/xqilla/rev/4f7337f4cc86 branch: changeset: 1670:4f7337f4cc86 user: John Snelson <joh...@ma...> date: Wed Nov 16 02:18:47 2011 +0000 description: Removed unneeded optimization from PartialEvaluator. diffstat: include/xqilla/optimizer/PartialEvaluator.hpp | 1 - src/optimizer/PartialEvaluator.cpp | 49 --------------------------- 2 files changed, 0 insertions(+), 50 deletions(-) diffs (81 lines): diff -r cc18fcb65019 -r 4f7337f4cc86 include/xqilla/optimizer/PartialEvaluator.hpp --- a/include/xqilla/optimizer/PartialEvaluator.hpp Wed Nov 16 02:18:46 2011 +0000 +++ b/include/xqilla/optimizer/PartialEvaluator.hpp Wed Nov 16 02:18:47 2011 +0000 @@ -52,7 +52,6 @@ virtual ASTNode *optimizeInlineFunction(XQInlineFunction *item); virtual ASTNode *optimizeFunction(XQFunction *item); virtual ASTNode *optimizeTypeswitch(XQTypeswitch *item); - virtual ASTNode *optimizeTreatAs(XQTreatAs *item); bool checkSizeLimit(const ASTNode *oldAST, const ASTNode *newAST); diff -r cc18fcb65019 -r 4f7337f4cc86 src/optimizer/PartialEvaluator.cpp --- a/src/optimizer/PartialEvaluator.cpp Wed Nov 16 02:18:46 2011 +0000 +++ b/src/optimizer/PartialEvaluator.cpp Wed Nov 16 02:18:47 2011 +0000 @@ -1093,40 +1093,10 @@ } } -static inline FunctionSignature *findSignature(ASTNode *expr) -{ - FunctionSignature *signature = 0; - - switch(expr->getType()) { - case ASTNode::INLINE_FUNCTION: { - signature = ((XQInlineFunction*)expr)->getItemType()->getFunctionSignature(); - break; - } - case ASTNode::FUNCTION_COERCION: { - XQFunctionCoercion *coercion = (XQFunctionCoercion*)expr; - if(coercion->getFuncConvert()->getType() == ASTNode::INLINE_FUNCTION) - signature = ((XQInlineFunction*)coercion->getFuncConvert())->getItemType()->getFunctionSignature(); - break; - } - default: break; - } - - return signature; -} - ASTNode *PartialEvaluator::optimizeFunctionCoercion(XQFunctionCoercion *item) { ASTVisitor::optimizeFunctionCoercion(item); - FunctionSignature *signature = findSignature(item->getExpression()); - if(signature && item->getSequenceType()->getItemType()->matches(signature)) { - ASTNode *result = item->getExpression(); - item->setExpression(0); - sizeLimit_ += ASTCounter().count(item); - item->release(); - return result; - } - if(item->getExpression()->getType() != ASTNode::INLINE_FUNCTION || functionInlineLimit_ <= 0) return item; @@ -1150,25 +1120,6 @@ } } -ASTNode *PartialEvaluator::optimizeTreatAs(XQTreatAs *item) -{ - ASTVisitor::optimizeTreatAs(item); - - const ItemType *itemType = item->getSequenceType()->getItemType(); - if(!itemType) return item; - - FunctionSignature *signature = findSignature(item->getExpression()); - if(signature && itemType->matches(signature)) { - ASTNode *result = item->getExpression(); - item->setExpression(0); - sizeLimit_ += ASTCounter().count(item); - item->release(); - return result; - } - - return item; -} - //////////////////////////////////////////////////////////////////////////////////////////////////// // // Inline variables |