<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to bugs</title><link>https://sourceforge.net/p/mxquery/bugs/</link><description>Recent changes to bugs</description><atom:link href="https://sourceforge.net/p/mxquery/bugs/feed.rss" rel="self"/><language>en</language><lastBuildDate>Tue, 15 May 2012 12:18:31 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/mxquery/bugs/feed.rss" rel="self" type="application/rss+xml"/><item><title>error executing query</title><link>https://sourceforge.net/p/mxquery/bugs/17/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Hi, i was executing this query:&lt;/p&gt;
&lt;p&gt;declare variable $doc external;&lt;/p&gt;
&lt;p&gt;declare function local:yyyymmdd-to-date &lt;br /&gt;
( $dateString as xs:string? )  as xs:dateTime? {&lt;/p&gt;
&lt;p&gt;if (empty($dateString))&lt;br /&gt;
then ()&lt;br /&gt;
else if (not(matches($dateString,&lt;br /&gt;
'^\D*(\d{4})\D*(\d{2})\D*(\d{2})\D*(\d{2})\D*(\d{2})\D*(\d{2})\D*$')))&lt;br /&gt;
then error(xs:QName('local:Invalid_Date_Format'))&lt;br /&gt;
else fn:dateTime(xs:date(replace($dateString,&lt;br /&gt;
'^\D*(\d{4})\D*(\d{2})\D*(\d{2})\D*(\d{2})\D*(\d{2})\D*(\d{2})\D*$',&lt;br /&gt;
'$1-$2-$3')),xs:time(replace($dateString,&lt;br /&gt;
'^\D*(\d{4})\D*(\d{2})\D*(\d{2})\D*(\d{2})\D*(\d{2})\D*(\d{2})\D*$',&lt;br /&gt;
'$4:$5:$6')))&lt;br /&gt;
} ;&lt;/p&gt;
&lt;p&gt;declare function local:getLastDate () as xs:dateTime? {&lt;br /&gt;
for $x in $doc//sample[@counter=0]   &lt;br /&gt;
return local:yyyymmdd-to-date($x/date)&lt;br /&gt;
};&lt;/p&gt;
&lt;p&gt;declare function local:getDateDiffInMinutes ($date1 as xs:dateTime?, $date2 as xs:dateTime?) as xs:int? {&lt;br /&gt;
if ($date1 &amp;gt;= $date2) &lt;br /&gt;
then fn:hours-from-duration($date1 - $date2) * 60 +&lt;br /&gt;
fn:minutes-from-duration($date1 - $date2)&lt;/p&gt;
&lt;p&gt;else fn:hours-from-duration($date2 - $date1) * 60 +&lt;br /&gt;
fn:minutes-from-duration($date2 - $date1)&lt;/p&gt;
&lt;p&gt;};&lt;/p&gt;
&lt;p&gt;for $d in distinct-values($doc//queue/@queuename)&lt;br /&gt;
let $items := $doc//queue[@queuename=$d]&lt;br /&gt;
order by $d&lt;br /&gt;
return &amp;lt;queue queuename="{$d}"&amp;gt;{&lt;br /&gt;
for $i in $items&lt;br /&gt;
where  local:getDateDiffInMinutes(local:getLastDate (), local:yyyymmdd-to-date($i/..//sample/date)) &amp;lt; 2    (: error is here :)&lt;br /&gt;
order by $i//numcallsinqueue&lt;br /&gt;
return $i//numcallsinqueue&lt;br /&gt;
}&amp;lt;/queue&amp;gt;&lt;/p&gt;
&lt;p&gt;And this error retourned:&lt;/p&gt;
&lt;p&gt;javax.xml.xquery.XQQueryException: ch.ethz.mxquery.exceptions.DynamicException: parent not working here - please report&lt;br /&gt;
at ch.ethz.mxquery.xqj.MXQueryXQForwardSequence.next(MXQueryXQForwardSequence.java:255)&lt;br /&gt;
at ch.ethz.mxquery.xqj.MXQueryXQDataFactory.createSequence(MXQueryXQDataFactory.java:428)&lt;br /&gt;
at XQJExample.main(XQJExample.java:115)&lt;/p&gt;
&lt;p&gt;in attachment the xml that has been loaded into $doc.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Tue, 15 May 2012 12:18:31 -0000</pubDate><guid>https://sourceforge.net13c6da675b724cefc29307f79afad1a2cc1e1e1d</guid></item><item><title>NPE in DocOrderCompare - suggested fix</title><link>https://sourceforge.net/p/mxquery/bugs/16/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Executing the following query with MXQuery SVN snapshot dated 2012-04-04 yields a NPE:&lt;/p&gt;
&lt;p&gt;for tumbling window $w in $input &lt;br /&gt;
start when true()&lt;br /&gt;
end when true()&lt;br /&gt;
return $w/(for $i in //random return $i)&lt;/p&gt;
&lt;p&gt;"$input" is a sequence of "&amp;lt;random/&amp;gt;" elements. I'm aware that the query could be easily re-formulated, but we require this syntax for certain application-specific reasons.&lt;/p&gt;
&lt;p&gt;The following modification to ch.ethz.mxquery.iterators.DocOrderCompare seems to fix the issue:&lt;/p&gt;
&lt;p&gt;public class DocOrderCompare implements Comparator {&lt;/p&gt;
&lt;p&gt;public int compare(Object o1, Object o2) throws MXQueryException {&lt;br /&gt;
Identifier i0 = ((DocOrderObject)o1).getIdentifier();&lt;br /&gt;
Identifier i1 = ((DocOrderObject)o2).getIdentifier();&lt;/p&gt;
&lt;p&gt;/* start fix */&lt;br /&gt;
if(i0 == null || i1 == null)&lt;br /&gt;
return 0;&lt;br /&gt;
/* end fix */&lt;/p&gt;
&lt;p&gt;int c = i0.getStore().compare(i1.getStore());&lt;br /&gt;
if(c == 0){&lt;br /&gt;
int i = i1.compare(i0);&lt;br /&gt;
if(i==0)&lt;br /&gt;
return 0;&lt;br /&gt;
else if(i==1)&lt;br /&gt;
return 1;&lt;br /&gt;
else&lt;br /&gt;
return -1;&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
return c;&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">W.Hummer</dc:creator><pubDate>Sun, 29 Apr 2012 23:00:28 -0000</pubDate><guid>https://sourceforge.net6e6f274d7245f63e6e847a3f8b99d07bea30d708</guid></item><item><title>Very good article post.Really thank you! Really Cool.</title><link>https://sourceforge.net/p/mxquery/bugs/15/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Very good article post.Really thank you! Really Cool.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Mon, 26 Mar 2012 11:09:26 -0000</pubDate><guid>https://sourceforge.netf60d031a3c7ed6d0e7b5d55bc8bb9c0b9daca04a</guid></item><item><title>aPcmaR Appreciate you sharing, great article post. Fantastic</title><link>https://sourceforge.net/p/mxquery/bugs/14/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;aPcmaR Appreciate you sharing, great article post. Fantastic.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Fri, 23 Mar 2012 05:16:08 -0000</pubDate><guid>https://sourceforge.net1a154c5e2ecc14cd52e40d60b3337526d190c37b</guid></item><item><title>NPE after catch22 problem</title><link>https://sourceforge.net/p/mxquery/bugs/13/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;I am trying to run the following code:&lt;/p&gt;
&lt;p&gt;01: XQDataSource xqDS = new MXQueryXQDataSource();&lt;br /&gt;
02: XQConnection xqConn = xqDS.getConnection();&lt;br /&gt;
03: XQPreparedExpression xqPExpr = xqConn.prepareExpression(new FileInputStream(new File(xqInputPath)));&lt;br /&gt;
04: xqPExpr.bindDocument(new QName("xPRSXMLInput"),new FileInputStream(xmlInputPath), null, null); &lt;/p&gt;
&lt;p&gt;This fails in 04 with a NPE, see stacktrace:&lt;/p&gt;
&lt;p&gt;Exception in thread "main" java.lang.NullPointerException&lt;br /&gt;
at ch.ethz.mxquery.iterators.VariableIterator.firstInit(VariableIterator.java:96)&lt;br /&gt;
at ch.ethz.mxquery.iterators.VariableIterator.setResettable(VariableIterator.java:170)&lt;br /&gt;
at ch.ethz.mxquery.model.Iterator.setResettable(Iterator.java:217)&lt;br /&gt;
at ch.ethz.mxquery.model.Iterator.setResettable(Iterator.java:217)&lt;br /&gt;
at ch.ethz.mxquery.model.Iterator.setResettable(Iterator.java:217)&lt;br /&gt;
at ch.ethz.mxquery.iterators.FFLWORIterator.setResettable(FFLWORIterator.java:335)&lt;br /&gt;
at ch.ethz.mxquery.iterators.FFLWORIterator.&amp;lt;init&amp;gt;(FFLWORIterator.java:61)&lt;br /&gt;
at ch.ethz.mxquery.iterators.FFLWORIterator.copy(FFLWORIterator.java:451)&lt;br /&gt;
at ch.ethz.mxquery.iterators.FFLWORIterator.copy(FFLWORIterator.java:436)&lt;br /&gt;
at ch.ethz.mxquery.model.Iterator.copy(Iterator.java:593)&lt;br /&gt;
at ch.ethz.mxquery.bindings.WindowBuffer.copy(WindowBuffer.java:438)&lt;br /&gt;
at ch.ethz.mxquery.bindings.WindowSequenceIterator.copy(WindowSequenceIterator.java:369)&lt;br /&gt;
at ch.ethz.mxquery.model.Iterator.copy(Iterator.java:603)&lt;br /&gt;
at ch.ethz.mxquery.model.VariableHolder.copy(VariableHolder.java:190)&lt;br /&gt;
at ch.ethz.mxquery.contextConfig.Context.copy(Context.java:1529)&lt;br /&gt;
at ch.ethz.mxquery.query.impl.PreparedStatementImpl.copy(PreparedStatementImpl.java:155)&lt;br /&gt;
at ch.ethz.mxquery.xqj.MXQueryXQPreparedExpression.&amp;lt;init&amp;gt;(MXQueryXQPreparedExpression.java:52)&lt;br /&gt;
at ch.ethz.mxquery.xqj.MXQueryXQConnection.prepareExpression(MXQueryXQConnection.java:175)&lt;br /&gt;
at ch.ethz.mxquery.xqj.MXQueryXQConnection.prepareExpression(MXQueryXQConnection.java:151)&lt;br /&gt;
at ch.ethz.mxquery.xqj.MXQueryXQConnection.prepareExpression(MXQueryXQConnection.java:125)&lt;br /&gt;
at ch.ethz.mxquery.xqj.MXQueryXQConnection.prepareExpression(MXQueryXQConnection.java:118)&lt;br /&gt;
at myValidator.main(myValidator.java:57)&lt;/p&gt;
&lt;p&gt;xqInputPath points to an xquery file that holds this snippet:&lt;/p&gt;
&lt;p&gt;declare variable $xPRSXMLInput as document-node(element(*, xs:untyped)) external;&lt;br /&gt;
declare variable $rootelement_first := $xPRSXMLInput/prin:OfferExtraction;&lt;/p&gt;
&lt;p&gt;What is happening here is that I am basing a variable (rootelement_first ) on an external variable (perfectly legit), however mxquery tries to interpret that before I have a chance to set it. Tested with mxquery-0.6.0 on Java 1.6.0_21. Reproduceable. &lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Thu, 24 Mar 2011 17:04:42 -0000</pubDate><guid>https://sourceforge.net59094759bd5d1ae19b39b82507698a011ae76f3d</guid></item><item><title>Module importation doesn't work</title><link>https://sourceforge.net/p/mxquery/bugs/12/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Hello,&lt;br /&gt;
I think that module importation is broken. When importing a library module that defines functions, the query parser apparently doesn't import the target namespace, and consequently fails to register the imported functions into the main modules's context.&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;p&gt;(: module libmod.xq :)&lt;br /&gt;
module namespace libmod = "libmod" ;&lt;/p&gt;
&lt;p&gt;declare function libmod:hello() as element() {&lt;br /&gt;
&amp;lt;hello&amp;gt;world&amp;lt;/hello&amp;gt;&lt;br /&gt;
} ;&lt;/p&gt;
&lt;p&gt;(: module mainmod.xq :)&lt;br /&gt;
import module namespace libmod = "libmod" at "libmod.xquery" ;&lt;/p&gt;
&lt;p&gt;libmod:hello() &lt;/p&gt;
&lt;p&gt;Trying to run mainmod.xq fails, complaining that the libmod prefix is in an unallocated namespace.&lt;/p&gt;
&lt;p&gt;Any help would be greatly appreciated :-)&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Sun, 18 Apr 2010 12:15:39 -0000</pubDate><guid>https://sourceforge.net8e7e866c03017978fdfce7f09bb0a446c95a4be8</guid></item><item><title>xquery serialization parameters are incorrect</title><link>https://sourceforge.net/p/mxquery/bugs/11/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;According to XQuery spec, which references the "XSLT 2.0 and XQuery 1.0 serialization" spec (http://www.w3.org/TR/xslt-xquery-serialization/), the serialization option "indent" accepts only the tokens "yes" or "no" (http://www.w3.org/TR/xslt-xquery-serialization-11/#serparam). The same holds for XQ 1.1 (and XSLT/XQ serialization 1.1).&lt;/p&gt;
&lt;p&gt;The 0.6.0 release only accepts "true" or "anything other than 't' 'r' 'u' 'e'".&lt;/p&gt;
&lt;p&gt;And, further, the "undeclare-prefixes" option is mis-implemented as "undeclared-prefixes".&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Matthew L Daniel</dc:creator><pubDate>Thu, 11 Mar 2010 23:58:47 -0000</pubDate><guid>https://sourceforge.net80e5063f44fe4316b9b85b4a2176adb1258f91f6</guid></item><item><title>XDMSerializer escapes already escaped &amp;</title><link>https://sourceforge.net/p/mxquery/bugs/10/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;I found the problem in changeEntityRef.&lt;br /&gt;
I propose to exchange:&lt;br /&gt;
val = Utils.replaceAll(val, "&amp;amp;", "&amp;amp;amp;");&lt;br /&gt;
with:&lt;br /&gt;
val = val.replaceAll( "&amp;amp;(?!(#\\d+;|amp;))", "&amp;amp;amp;");&lt;br /&gt;
This worked for my use cases at least fine.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Stivo</dc:creator><pubDate>Wed, 30 Dec 2009 12:38:06 -0000</pubDate><guid>https://sourceforge.netf8e64662d9fbec1ee1e19a05a1d799c924e1581b</guid></item><item><title>fn:resolve-uri implementation wrong in some cases</title><link>https://sourceforge.net/p/mxquery/bugs/9/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Running a query like:&lt;br /&gt;
String query = "resolve-uri('/','http://example.com/bla/asdf/')";&lt;br /&gt;
gives this output&lt;br /&gt;
&lt;a href="http://example.com/bla/asdf//" rel="nofollow"&gt;http://example.com/bla/asdf//&lt;/a&gt;&lt;br /&gt;
However, this should be:&lt;br /&gt;
&lt;a href="http://example.com/" rel="nofollow"&gt;http://example.com/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I replaced some code using the java library to do this stuff, which handles this case well and most likely all others too...&lt;br /&gt;
Surpisingly URIUtils.resolveURI also outputs a wrong result.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Stivo</dc:creator><pubDate>Wed, 23 Dec 2009 14:17:49 -0000</pubDate><guid>https://sourceforge.netf2cf24467fbac1c2cae57cca82472b0586d89cf8</guid></item><item><title>text() does not work correctly on external input</title><link>https://sourceforge.net/p/mxquery/bugs/8/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;I have the attached test case.&lt;br /&gt;
The expected output is:&lt;br /&gt;
1 &amp;amp; 2 &amp;amp; 3&lt;br /&gt;
5&lt;br /&gt;
&amp;lt;?xml version='1.0' encoding='UTF-8' ?&amp;gt;&lt;br /&gt;
42&lt;br /&gt;
Like I get when I use query2 or query3 instead of query1.&lt;br /&gt;
The actual output is:&lt;br /&gt;
1 &lt;br /&gt;
&amp;amp;&lt;br /&gt;
&amp;lt;?xml version='1.0' encoding='UTF-8' ?&amp;gt;&lt;br /&gt;
42&lt;br /&gt;
It seems to split incorrectly at the ampersand in this case...&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Stivo</dc:creator><pubDate>Tue, 22 Dec 2009 23:28:59 -0000</pubDate><guid>https://sourceforge.netebd1254ebbe4109f54127e5180cc4ae63036141a</guid></item></channel></rss>