|
||||
|
XML in a nutshellPaul Streder XML is a way of organizing data. If you understand the way HTML works, you will understand XML. XML is formatted exactly the same as HTML (an opening tag, and a closing tag). So where HTML has predefined tags (like <html> and <body> and <table>) in XML, those mean nothing except what you want them to. If you have a whole bunch of information on something (such as a car) you could organize it like so: <car> As you can see, the data is organized in a STRICT manner (any deviation in XML formatting will result in an unvalid XML document). Now after you have generated your XML doc (either by hand or as a return from SQL server), you cant just display this data to a user and have it look pretty (or even assume the user could figure out what you were trying to display). So you need to create an XSL document. These xsl documents take XML and display it as HTML. an example that would display the XML code above: <xsl:template match="car"> The xsl:value will take the value of the child node to "car" with the name specified in the select statement. One big difference between XSL and HTML, is the strict standards. EVERY tag must be closed, and every attribute must have quotes around it. You can use XML strictly as a storage medium, or you can use it as a SOAP call, and send data to a server in XML format and have the server parse the XML for values. XML is extremely versatile and is the key to using mobile devices online (displaying web docs on cell phones, pdas, etc). Using XML with ASPIn ASP, after you load an XML Docs & the XSL docs into an object Dim xmlDoc You will transform the data in the asp: strOutputHTML=xmlDoc.transformNode(xslDoc) Where strOutputHTML is the HTML string you response.write to the user Article last reviewed: 01/24/2003
|
Related Articles: |
||||||||