Summary


This chapter has not been an extensive look at XML, because the subject can easily take several chapters in its own right. What we've done is limit the topics to the most useful areas for ASP.NET developers, starting with Visual Studio 2005 and its support for XML and schemas.

We then moved on to displaying XML data through the use of databound controls and the XmlDataSource control. Here you saw the differences between binding to XML files with elements and XML files with attributes. One important point was the use of #InnerText as the TextField in bindings for nodes in a tree that bind to the data contained within elements, whereas for attributes, you can use the attribute name. You then saw the use of binding expressions and selections using XPath expressions, which are for use in templates of databound controls.

The next topic was transforming XML by using XSLT to transform XML from one form into another. You saw that XSLT can be a confusing language, but that the new XSLT Debugging features of Visual Studio 2005 allow XSLT to be stepped through just like other code. Transforming can be done with the XmlDataSoure control or with the XslCompiledTransform in code.

Next, you saw several ways of working with XML directly, either streaming the data with the XmlReader and XmlWriter objects or using in-memory XML stores such as the XmlDocument, XPathDocument, and XmlDataDocument. The XPathNavigator provides a way of navigating over these in-memory stores, allowing you to move around the data, updating it if the underlying object allows it.

Finally, you saw how SQL Server 2005 allows XML to be stored as a native type, allowing validation and searching within the XML for each column. Accessing these XML columns can be done either as a string value or as a strongly typed SqlXml type.

Now it's time to move away from data and back into the world of ASP.NET forms and controls.



ASP. NET 2.0 Illustrated
ASP.NET 2.0 Illustrated
ISBN: 0321418344
EAN: 2147483647
Year: 2006
Pages: 147

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net