Summary

In this chapter we presented the basics of XML and its purpose. We also demonstrated some of the ways that XML can be used within the .NET Framework and how to work with XML from VB.NET. By the end of the chapter, we had shown you how to configure IIS and SQL Server 2000 to return XML documents that can be easily manipulated to produce HTML pages. Much of the information covered here is background for the material presented in Chapter 10.

Questions and Answers

Q1:

What exactly does "create a schema" mean in XML lingo?

A1:

As in database lingo, creating a schema refers to a document that defines objects and entities. In XML, this concept can be extended to include schemas that require certain information to be included in a document, similar to defining a NOT NULL field in a database table.

Q2:

What if I want to name an element in my XML document the same as the name of an HTML element? Say "title", for example.

A2:

This is where namespaces come in to play, as they are available for you to define a custom namespace within your document and then reference its object separately. For example, you've created an XML document to which you want to apply XSLT, where one of the fields returned from the database is labeled "title". Because HTML already has the title tag reserved, you need to create your own namespace.

Take a look at the line of code

 <xmlns:b=http://myMachine.com>  

It allows you to prefix any XML element with "b:", and it won't interfere with any of the HTML reserved words.

The line <b:title> and <title> are now two different entities. The only hard and fast rule that you must be comply with here is to ensure that the namespace declaration occurs somewhere near the beginning of the document, before you declare any conflicting elements.



Database Access with Visual Basic. NET
Database Access with Visual Basic .NET (3rd Edition)
ISBN: 0672323435
EAN: 2147483647
Year: 2003
Pages: 97

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