Aklımda Kalası Kelimeler

* давайте работать вместе
* Zarf ve Mazruf, Zerafet(xHoyratlık) ile aynı kökten(za-ra-fe) gelir
* Bedesten
* Suç subuta ermiştir - Suç sabit olmuştur

5 Haziran 2010 Cumartesi

XML'i TABLE'a sayfalı ilerleyecek şekilde bağla

Normalde ASP.NET ile GridView'a datasource olarak bağlardım. Ama burada daha güzeli var. Hem XML inmiş olur istemciye, hemde sunucu tarafında bir ton yük olmaz. Tabii XML çok büyük olmayacaksa.

Microsoft'un "Adım Adım XML" kitabından güzel bir örnek:


<HTML>

<HEAD>
<TITLE>Book Inventory</TITLE>
</HEAD>

<BODY>

<XML ID="dsoInventory" SRC="Inventory Big.xml"></XML>

<H2>Book Inventory</H2>

<BUTTON ONCLICK="InventoryTable.firstPage()">
|< First Page
</BUTTON>

<BUTTON ONCLICK="InventoryTable.previousPage()">
< Previous Page
</BUTTON>


<BUTTON ONCLICK="InventoryTable.nextPage()">
Next Page >
</BUTTON>

<BUTTON ONCLICK="InventoryTable.lastPage()">
Last Page >|
</BUTTON>
<p>


<TABLE ID="InventoryTable" DATASRC="#dsoInventory"
DATAPAGESIZE="5" BORDER="1" CELLPADDING="5">
<THEAD>
<TH>Title</TH>
<TH>Author</TH>
<TH>Binding</TH>
<TH>Pages</TH>
<TH>Price</TH>

</THEAD>
<TR ALIGN="center">
<TD><SPAN DATAFLD="TITLE"
STYLE="font-style:italic"></SPAN></TD>
<TD><SPAN DATAFLD="AUTHOR"></SPAN></TD>
<TD><SPAN DATAFLD="BINDING"></SPAN></TD>
<TD><SPAN DATAFLD="PAGES"></SPAN></TD>
<TD><SPAN DATAFLD="PRICE"></SPAN></TD>
</TR>
</TABLE>

</BODY>

</HTML>


Bu da XML:

<!-- File Name: Inventory Big.xml -->

<INVENTORY>

<BOOK>
<TITLE>The Adventures of Huckleberry Finn</TITLE>
<AUTHOR>Mark Twain</AUTHOR>
<BINDING>mass market paperback</BINDING>
<PAGES>298</PAGES>
<PRICE>$5.49</PRICE>
</BOOK>

<BOOK>
<TITLE>The Adventures of Tom Sawyer</TITLE>
<AUTHOR>Mark Twain</AUTHOR>
<BINDING>mass market paperback</BINDING>
<PAGES>205</PAGES>
<PRICE>$4.75</PRICE>
</BOOK>

<BOOK>
<TITLE>The Ambassadors</TITLE>
<AUTHOR>Henry James</AUTHOR>
<BINDING>mass market paperback</BINDING>
<PAGES>305</PAGES>
<PRICE>$5.95</PRICE>
</BOOK>

<BOOK>
<TITLE>The Awakening</TITLE>
<AUTHOR>Kate Chopin</AUTHOR>
<BINDING>mass market paperback</BINDING>
<PAGES>195</PAGES>
<PRICE>$4.95</PRICE>
</BOOK>

<BOOK>
<TITLE>Billy Budd</TITLE>
<AUTHOR>Herman Melville</AUTHOR>
<BINDING>mass market paperback</BINDING>
<PAGES>195</PAGES>
<PRICE>$4.49</PRICE>
</BOOK>

<BOOK>
<TITLE>A Connecticut Yankee in King Arthur's Court</TITLE>
<AUTHOR>Mark Twain</AUTHOR>
<BINDING>mass market paperback</BINDING>
<PAGES>385</PAGES>
<PRICE>$5.49</PRICE>
</BOOK>

<BOOK>
<TITLE>Joan of Arc</TITLE>
<AUTHOR>Mark Twain</AUTHOR>
<BINDING>trade paperback</BINDING>
<PAGES>465</PAGES>
<PRICE>$6.95</PRICE>
</BOOK>

<BOOK>
<TITLE>Leaves of Grass</TITLE>
<AUTHOR>Walt Whitman</AUTHOR>
<BINDING>hardcover</BINDING>
<PAGES>462</PAGES>
<PRICE>$7.75</PRICE>
</BOOK>

<BOOK>
<TITLE>The Legend of Sleepy Hollow</TITLE>
<AUTHOR>Washington Irving</AUTHOR>
<BINDING>mass market paperback</BINDING>
<PAGES>98</PAGES>
<PRICE>$2.95</PRICE>
</BOOK>

<BOOK>
<TITLE>The Marble Faun</TITLE>
<AUTHOR>Nathaniel Hawthorne</AUTHOR>
<BINDING>trade paperback</BINDING>
<PAGES>473</PAGES>
<PRICE>$10.95</PRICE>
</BOOK>

<BOOK>
<TITLE>Moby-Dick</TITLE>
<AUTHOR>Herman Melville</AUTHOR>
<BINDING>hardcover</BINDING>
<PAGES>724</PAGES>
<PRICE>$9.95</PRICE>
</BOOK>

<BOOK>
<TITLE>Passing</TITLE>
<AUTHOR>Nella Larsen</AUTHOR>
<BINDING>trade paperback</BINDING>
<PAGES>165</PAGES>
<PRICE>$5.95</PRICE>
</BOOK>

<BOOK>
<TITLE>The Portrait of a Lady</TITLE>
<AUTHOR>Henry James</AUTHOR>
<BINDING>mass market paperback</BINDING>
<PAGES>256</PAGES>
<PRICE>$4.95</PRICE>
</BOOK>

<BOOK>
<TITLE>Roughing It</TITLE>
<AUTHOR>Mark Twain</AUTHOR>
<BINDING>mass market paperback</BINDING>
<PAGES>324</PAGES>
<PRICE>$5.25</PRICE>
</BOOK>

<BOOK>
<TITLE>The Scarlet Letter</TITLE>
<AUTHOR>Nathaniel Hawthorne</AUTHOR>
<BINDING>trade paperback</BINDING>
<PAGES>253</PAGES>
<PRICE>$4.25</PRICE>
</BOOK>

<BOOK>
<TITLE>The Turn of the Screw</TITLE>
<AUTHOR>Henry James</AUTHOR>
<BINDING>trade paperback</BINDING>
<PAGES>384</PAGES>
<PRICE>$3.35</PRICE>
</BOOK>
</INVENTORY>