XQuery says "memory exhausted"
-
I've written a Qt program for extracting some nodes from an xml file (generated by JIRA). Here is the xquery code:
@
<issue_result>
{
for $issue in doc($file)/rss/channel/item[resolution/@id = '1']
let $key := $issue/key
let $link := $issue/link/text()
let $summary := $issue/summary/text()
let $description := $issue/description
let $changelog := $issue/customfields/customfield[@id = 'customfield_10031']/customfieldvalues/customfieldvalue/text()
let $testplan := $issue/customfields/customfield[@id = 'customfield_10070']/customfieldvalues/customfieldvalue/text()
let $tickets := $issue/customfields/customfield[@id = 'customfield_10030']/customfieldvalues/customfieldvalue/text()
let $reporter := $issue/reporter
let $assignee := $issue/assignee
let $project := data($issue/project/@key)
let $updatedDate := $issue/updated
let $resolvedDate := $issue/resolved
let $inChangelog := $issue/customfields/customfield[@id = 'customfield_10090']/customfieldvalues/customfieldvalue/text()
let $resources := $issue/customfields/customfield[@id = 'customfield_10094']/customfieldvalues/customfieldvalue/text()
let $installSqlScript := $issue/customfields/customfield[@id = 'customfield_10091']/customfieldvalues/customfieldvalue/text()
let $uninstallSqlScript := $issue/customfields/customfield[@id = 'customfield_10092']/customfieldvalues/customfieldvalue/text()
let $hostChanges := $issue/customfields/customfield[@id = 'customfield_10093']/customfieldvalues/customfieldvalue/text()
let $letterNumber := $issue/customfields/customfield[@id = 'customfield_10060']/customfieldvalues/customfieldvalue/text()
return
<issue>
{$key}
<link>{$link}</link>
<summary>{$summary}</summary>
{$description}
<changelog>{$changelog}</changelog>
<testplan>{$testplan}</testplan>
<tickets>{$tickets}</tickets>
{$reporter}
{$assignee}
<project>{$project}</project>
{$updatedDate}
{$resolvedDate}
<exists_in_changelog>{$inChangelog}</exists_in_changelog>
<resources>{$resources}</resources>
<install_sql_script>{$installSqlScript}</install_sql_script>
<uninstall_sql_script>{$uninstallSqlScript}</uninstall_sql_script>
<requires_changes_in_host>{$hostChanges}</requires_changes_in_host>
<letter_number>{$letterNumber}</letter_number>
</issue>
}
</issue_result>
@It works fine; but when I add at least two new variables, xquery engine return this error:
@
Error XPST0003 in file:XMLs/issue.xq, at line 24, column 36: memory exhausted
@For example consider below code:
@<issue_result>
{
for $issue in doc($file)/rss/channel/item[resolution/@id = '1']
let $key := $issue/key
let $link := $issue/link/text()
let $summary := $issue/summary/text()
let $description := $issue/description
let $changelog := $issue/customfields/customfield[@id = 'customfield_10031']/customfieldvalues/customfieldvalue/text()
let $testplan := $issue/customfields/customfield[@id = 'customfield_10070']/customfieldvalues/customfieldvalue/text()
let $tickets := $issue/customfields/customfield[@id = 'customfield_10030']/customfieldvalues/customfieldvalue/text()
let $reporter := $issue/reporter
let $assignee := $issue/assignee
let $project := data($issue/project/@key)
let $updatedDate := $issue/updated
let $resolvedDate := $issue/resolved
let $inChangelog := $issue/customfields/customfield[@id = 'customfield_10090']/customfieldvalues/customfieldvalue/text()
let $resources := $issue/customfields/customfield[@id = 'customfield_10094']/customfieldvalues/customfieldvalue/text()
let $installSqlScript := $issue/customfields/customfield[@id = 'customfield_10091']/customfieldvalues/customfieldvalue/text()
let $uninstallSqlScript := $issue/customfields/customfield[@id = 'customfield_10092']/customfieldvalues/customfieldvalue/text()
let $hostChanges := $issue/customfields/customfield[@id = 'customfield_10093']/customfieldvalues/customfieldvalue/text()
let $letterNumber := $issue/customfields/customfield[@id = 'customfield_10060']/customfieldvalues/customfieldvalue/text()
let $letterNumber2 := $issue/customfields/customfield[@id = 'customfield_10060']/customfieldvalues/customfieldvalue/text()
let $letterNumber3 := $issue/customfields/customfield[@id = 'customfield_10060']/customfieldvalues/customfieldvalue/text()
return
<issue>
{$key}
<link>{$link}</link>
<summary>{$summary}</summary>
{$description}
<changelog>{$changelog}</changelog>
<testplan>{$testplan}</testplan>
<tickets>{$tickets}</tickets>
{$reporter}
{$assignee}
<project>{$project}</project>
{$updatedDate}
{$resolvedDate}
<exists_in_changelog>{$inChangelog}</exists_in_changelog>
<resources>{$resources}</resources>
<install_sql_script>{$installSqlScript}</install_sql_script>
<uninstall_sql_script>{$uninstallSqlScript}</uninstall_sql_script>
<requires_changes_in_host>{$hostChanges}</requires_changes_in_host>
<letter_number>{$letterNumber}</letter_number>
</issue>
}
</issue_result>
@As you can see I've added letterNumber2 and letterNumber3. I know their value are the same as letterNumber, but I've tried different values and I got the same result. I will be grateful if somebody could help me.
-
According to "this":http://qt-project.org/forums/viewthread/19652 it seems it's QtXmlPatterns fault. I use "Zorba":http://www.zorba.io/ with the same files and there is no problem.