20.01.2015 Views

Teach Yourself e.net - Syspro

Teach Yourself e.net - Syspro

Teach Yourself e.net - Syspro

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

6<br />

More Advanced Options<br />

Objectives - In this chapter we deal with two concepts that will advance your use of<br />

ASP.NET with e.<strong>net</strong> solutions. We will first tackle XSLT, examining the process of<br />

transforming XML output for use in custom applications and by other proprietary<br />

applications. By the end of this section you will be familiar with XSLT and the<br />

transformation of an XmlOut string to an HTML table. In the second section of this<br />

chapter we will deal with the concept of ASP.NET codebehind, separating the<br />

programming logic from the presentation logic.<br />

If you are already familiar with XSLT and ASP.NET codebehind usage then please move<br />

on to the next chapter.<br />

6.1. Transforming XML<br />

XML is useful for transferring data between applications and between objects within an<br />

application. It is, however, not very useful to present an XML file to an accountant or an<br />

auditor or a data capture clerk. The benefit of using XML as a data transfer standard is that<br />

one can also transform that data into other formats that can then be used to display the<br />

information more effectively.<br />

The transformation standards or capabilities for XML were being developed at the same<br />

time that the XML standard was being developed. Using these standards, it is possible to<br />

transform XML into HTML, SQL scripts, emails, and virtually any other document type.<br />

This happens through the use of XSLT (Extensible Style Language Transformation)<br />

definition files and an XSLT processor.<br />

6.1.1. What is XSLT<br />

XSLT (Extensible Style Language Transformation) is a standard that was created to<br />

transform XML files into other formats or other XML Schemas. An XSL processor reads<br />

the XML document and follows the instructions in the XSL stylesheet, then it outputs the<br />

data as an HTML page, a SQL script, an email, an XML file governed by a different<br />

schema, or any other standardized document type.<br />

XSLT transformations are also useful in situations where the XML document's structure<br />

does not match up well with an application that needs access to the data. An XML<br />

document may contain the appropriate data to be imported into a database, for example,<br />

but may not be structured in the format that the application performing the import expects.<br />

The following two examples show how an XML document can be transformed from one

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

Saved successfully!

Ooh no, something went wrong!