Bug #1139
closedsquery produces output that is not well-formed
0%
Description
When a metacat query is submitted using the "squery" approach and the query
document is missing the xml declaration (i.e., ""), then
the output that is returned is not well-formed. In particular, the leading
"pathquery" element is missing its "<" opening tag delimiter. Metacat should
accept documents without the xml declaration, and should never produce
non-well-formed output (its clear that the query is running successfully, but
the output formatting is getting messed up).
Here's an example return from metacat:
<resultset>
<query>pathquery version="1.0">
<returndoctype>meeting</returndoctype>
<returnfield>/meeting/title</returnfield>
<returnfield>/meeting/start</returnfield>
<returnfield>/meeting/end</returnfield>
<querygroup operator="INTERSECT">
<queryterm casesensitive="false" searchmode="contains">
<value>%</value>
</queryterm>
</querygroup>
</pathquery></query>
<document><docid>mtg-test.1.2</docid><docname>meeting</docname><doctype>meeting</doctype><createdate>2003-08-14
21:37:36.0</createdate><updatedate>2003-08-15 15:09:41.0</updatedate><param
name="/meeting/title">SEEK All-Hands Meeting 2003</param><param
name="/meeting/end">14 Oct 2003</param><param name="/meeting/start">10 Oct
2003</param></document></resultset>
That document was produced from the following query:
<pathquery version="1.0">
<returndoctype>meeting</returndoctype>
<returnfield>/meeting/title</returnfield>
<returnfield>/meeting/start</returnfield>
<returnfield>/meeting/end</returnfield>
<querygroup operator="INTERSECT">
<queryterm casesensitive="false" searchmode="contains">
<value>%</value>
</queryterm>
</querygroup>
</pathquery>
If instead on changes the query to this:
<pathquery version="1.0">
<returndoctype>meeting</returndoctype>
<returnfield>/meeting/title</returnfield>
<returnfield>/meeting/start</returnfield>
<returnfield>/meeting/end</returnfield>
<querygroup operator="INTERSECT">
<queryterm casesensitive="false" searchmode="contains">
<value>%</value>
</queryterm>
</querygroup>
</pathquery>
then the metacat response is a well-formed result, like this:
<resultset>
<query>
<pathquery version="1.0">
<returndoctype>meeting</returndoctype>
<returnfield>/meeting/title</returnfield>
<returnfield>/meeting/start</returnfield>
<returnfield>/meeting/end</returnfield>
<querygroup operator="INTERSECT">
<queryterm casesensitive="false" searchmode="contains">
<value>%</value>
</queryterm>
</querygroup>
</pathquery></query>
<document><docid>mtg-test.1.2</docid><docname>meeting</docname><doctype>meeting</doctype><createdate>2003-08-14
21:37:36.0</createdate><updatedate>2003-08-15 15:09:41.0</updatedate><param
name="/meeting/title">SEEK All-Hands Meeting 2003</param><param
name="/meeting/end">14 Oct 2003</param><param name="/meeting/start">10 Oct
2003</param></document></resultset>
Updated by Jing Tao about 21 years ago
In MetaCatServlet class, the code for handle the pathquery without xml declaration.
The bug was fixed.