Now Metacat can support a path query whcih has attributes. The format is:
<queryterm searchmode="contains" casesensitive="false">
<value>denyFirst</value>
<pathexpr>acl/@order</pathexpr>
</queryterm>
Order is a attribute and its value should be "denyFirst". You can specify more
than one queryterm whcih has attribute in the squery.
Now Metacat can also support return fields have attributes. The format is:
<returnfield>keywordSet/keyword/@keywordType</returnfield>
<returnfield>originator/phone/@phonetype</returnfield>
keywordType and phonetype are attributes.
In QuerySepcification class, attribute sql query was created and in DBQuery
class, this query will be executed.
For search attributes, the sql query look like:
SELECT docid,docname,doctype,date_created, date_updated, rev FROM
xml_documents WHERE docid IN ((((SELECT DISTINCT docid FROM xml_nodes WHERE
UPPER LIKE '%DENYFIRST%' AND nodetype LIKE 'ATTRIBUTE' AND nodename
LIKE 'order' AND parentnodeid IN (SELECT nodeid FROM xml_index WHERE path LIKE
'acl') ))))
For return fields, the sql query for attributes will look like:
select xml_nodes.docid, xml_index.path, xml_nodes.nodedata, xml_nodes.nodename
from xml_index, xml_nodes where xml_index.nodeid=xml_nodes.parentnodeid and ((
xml_index.path like 'originator/phone' AND xml_nodes.nodename like
'phonetype') or ( xml_index.path like 'keywordSet/keyword' AND
xml_nodes.nodename like 'keywordType') ) AND xml_nodes.docid in ('tao.9301')
AND xml_nodes.nodetype = 'ATTRIBUTE'