Using XQuery in DBXML I want to prioritize some elements depending on multiple nodes set to certain values.
I want to be able to show three of this elements at the top and the rest below.
<properties>
<property>
<zip_code>5550</zip_code>
<agency>ABC</agency>
</property>
<property>
<zip_code>5550</zip_code>
<agency>DEF</agency>
</property>
<property>
<zip_code>5550</zip_code>
<agency>DEF</agency>
</property>
<property>
<zip_code>XYZ</zip_code>
<agency>ABC</agency>
</property>
</properties>
We are getting this XML in a property search page. Real search results will be having hundreds of records but we are only taking the first 10 records to display on the first page. Here we need to apply a sorting order which will show properties of "ABC" agency followed by zip code "XYZ" always on top. If the total result set does not have these agencies we can show them in the normal sorting order.