Dynamic XLS file?

wxdqz

New Member
Greetings, I'm trying to insert a set of subrecords into an element but am not sure how to go about doing it:

The following XML File (sample, real file contains 2,000+ <DOC> elements):


<?xml version="1.0" encoding="ISO-8859-1" ?>
- <DASF>
- <DOC>
<ID>A############</ID>
<NSN>#############</NSN>
<RU>A####</RU>
<PC>A</PC>
<UI>AA</UI>
<BOQTY>#####</BOQTY>
<DUE>#####</DUE>
<RCVD>#####</RCVD>
<PRI>##</PRI>
<UP>#######.##</UP>
<SAC>#</SAC>
<PROJ />
<SC>#</SC>
<ADV>#A</ADV>
<RFSN>#############</RFSN>
- <trailers>
- <trail>
<Tblank />
<TDIC>A##</TDIC>
<TRIC />
<TSUF />
<TQTY>#######</TQTY>
<TUI>AA</TUI>
<TSTAT />
<TSTATTO />
<TDSTAT>####</TDSTAT>
<TDSHIP>####</TDSHIP>
<TDTF>#############</TDTF>
<TMODE />
<TDATE />
<TDIC2>AA#</TDIC2>
<TRIC2>A#A</TRIC2>
<TSUF2 />
<TQTY2>#######</TQTY2>
<TUI2>AA</TUI2>
<TSTAT2>AA</TSTAT2>
<TSTATTO2 />
<TDSTAT2>####</TDSTAT2>
<TDSHIP2>####</TDSHIP2>
<TDTF2>#############</TDTF2>
<TMODE2 />
<TDATE2 />
</trail>
- <trail>
<Tblank />
<TDIC>A##</TDIC>
<TRIC />
<TSUF />
<TQTY>#######</TQTY>
<TUI>AA</TUI>
<TSTAT />
<TSTATTO />
<TDSTAT>####</TDSTAT>
<TDSHIP>####</TDSHIP>
<TDTF>#############</TDTF>
<TMODE />
<TDATE />
<TDIC2>AA#</TDIC2>
<TRIC2>A#A</TRIC2>
<TSUF2 />
<TQTY2>#######</TQTY2>
<TUI2>AA</TUI2>
<TSTAT2>AA</TSTAT2>
<TSTATTO2 />
<TDSTAT2>####</TDSTAT2>
<TDSHIP2>####</TDSHIP2>
<TDTF2>#############</TDTF2>
<TMODE2 />
<TDATE2 />
</trail>
</trailers>
</DOC>
</DASF>


I use an xls file to transform the above XML into a set of tables in an HTML page that looks like so:


<table>
<tr><td><img src='http://www.webdeveloper.com/forum/archive/index.php/../img/a.gif'onclick='ToggleChild(this)'></td><td><pre>(DOC ID TAG)</pre></td><td>..cell for every tag up to trailers..<td></tr>
<table class="hidden">
on image click, unhide this table and load all the informaton in the Trailers/trail tags in relation to the parent DOC ID TAG
</table>
</table>


This is where I'm stuck. How would I go about toggling a sub-element and loading XML into it from a Local xml file? Using the first cell of the table with data (DOC ID TAG), I'd like to query the xml file for the matching element, and return its sibling (Trailers) in order to generate the cells to fill the child table. Whats the best way to query the xml file? (already loaded into memory)
 
Back
Top