PDA

View Full Version : Parse and sort XML in HTML table



brent.fraser
09-17-2009, 04:35 PM
Hello all,

I have an XML file and I am attempting to parse it into HTML and then have some drop-down lists to sort on a few of the columns.

I have been doing some research and have found there are many ways of parsing XML into HTML but I am not sure what the best way is.

My XML file is as follows:

documents>
<data>
<docID>FISL-SCM9a-SCON-PRPC-001</docID>
<docName>&lt;a href="http://ofe/sites/Infrastructure/Tlbx/Subcontracts/FISL-SCM9a-SCON-PRPC-001-Requisition for Subcontract.pdf"&gt;Requisition for Subcontract&lt;/a&gt;</docName>
<function>Subcontracts</function>
<docType>PROCESS</docType>
<activity>Process and Procedures</activity>
</data>
<data>
<docID>FISL-SCM9b-SCON-PRPC-001</docID>
<docName>&lt;a href="http://ofe/sites/Infrastructure/Tlbx/Subcontracts/FISL-SCM9b-SCON-PRPC-001-Subcontract Solicitation and Award.pdf"&gt;Subcontract Solicitation and Award&lt;/a&gt;</docName>
<function>Subcontracts</function>
<docType>PROCESS</docType>
<activity>Process and Procedures</activity>
</data>
<data>
<docID>FISL-SCM9c-SCON-PRPC-001</docID>
<docName>&lt;a href="http://ofe/sites/Infrastructure/Tlbx/Subcontracts/FISL-SCM9c-SCON-PRPC-001-Generating Subcontract Agreements.pdf"&gt;Generating Subcontract Agreements&lt;/a&gt;</docName>
<function>Subcontracts</function>
<docType>PROCESS</docType>
<activity>Process and Procedures</activity>
</data>
<data>
<docID>FISL-SCM9d-SCON-PRPC-001</docID>
<docName>&lt;a href="http://ofe/sites/Infrastructure/Tlbx/Subcontracts/FISL-SCM9d-SCON-PRPC-001-Subcontract PO Creation.pdf"&gt;Subcontract PO Creation&lt;/a&gt;</docName>
<function>Subcontracts</function>
<docType>PROCESS</docType>
<activity>Process and Procedures</activity>
</data>
<data>
<docID>FISL-SCM9e-SCON-PRPC-001</docID>
<docName>&lt;a href="http://ofe/sites/Infrastructure/Tlbx/Subcontracts/FISL-SCM9e-SCON-PRPC-001-Subcontract Receiving.pdf"&gt;Subcontract Receiving&lt;/a&gt;</docName>
<function>Subcontracts</function>
<docType>PROCESS</docType>
<activity>Process and Procedures</activity>
</data>
<data>
<docID>FISL-SCM9g-SCON-PRPC-001</docID>
<docName>&lt;a href="http://ofe/sites/Infrastructure/Tlbx/Subcontracts/FISL-SCM9g-SCON-PRPC-001-Subcontract Closeout.pdf"&gt;Subcontract Closeout&lt;/a&gt;</docName>
<function>Subcontracts</function>
<docType>PROCESS</docType>
<activity>Process and Procedures</activity>
</data>
</documents>

and I would like to sort on function, docType and activity with a drop-down list in the header of the column.

There are a few samples I am playing with but I can't get the full functionality to work yet as I only have bits and pieces.

Thank you all for your help.
Brent