13.07.2015 Views

Applied XML Programming for Microsoft .NET.pdf - Csbdu.in

Applied XML Programming for Microsoft .NET.pdf - Csbdu.in

Applied XML Programming for Microsoft .NET.pdf - Csbdu.in

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Don't confuse the Internet Explorer 5.0 client-side HTML tag with the serversidecontrol. In Chapter 14, we'll return to data islands, and you'll learn how to def<strong>in</strong>ethem from with<strong>in</strong> server pages. For now, let's just say that an <strong>XML</strong> data island is <strong>XML</strong>text wrapped <strong>in</strong> an HTML tag. Not all browsers support this. The exampledescribed here requires Internet Explorer 5.0 or later.Used <strong>in</strong> conjunction with the tag, the <strong>XML</strong> Web server control can be very helpfuland effective. The follow<strong>in</strong>g code flushes the contents of the specified <strong>XML</strong> file <strong>in</strong> aparticular data island:If needed, you can first apply a trans<strong>for</strong>mation. For example, you can embed an ADO<strong>XML</strong> Recordset object <strong>in</strong> a data island. In this case, set the Trans<strong>for</strong>mSource propertyof the <strong>XML</strong> Web server control with the proper style sheet.Internet Explorer 5.0 automatically exposes the contents of the tag through an<strong>XML</strong> DOM object. Hold on, though—that's not managed code! What you get is ascriptable MS<strong>XML</strong> COM object. The follow<strong>in</strong>g ASP.<strong>NET</strong> page <strong>in</strong>cludes some VBScriptcode that retrieves the contents of the data island. (More on this <strong>in</strong> Chapter 14.)void Page_Load(object sender, EventArgs e){button.Attributes["onclick"] = "ReadXmlData()";}Sub ReadXmlData()' data is the name of the tag and' represents an MS<strong>XML</strong> <strong>XML</strong> DOM objectw<strong>in</strong>dow.alert(data.DocumentElement.nodeName)End SubClient-side Data Islands274

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!