XSLT Processors and Processing

XSLT does not operate directly on the XML text. Instead, it relies on a parser (DOM or SAX compliant) to convert values into an object tree for processing. It uses this tree to manipulate the structure in memory. XSLT enables the user to take advantage of the native language to navigate around the node tree, select nodes, and alter the nodes as the transformation requires.

XSLT processors apply an XSLT stylesheet to an XML source document and thus create a results document all while remaining consistent with the way processors handle XML through trees. Thus, XSLT must process three trees: the input, stylesheet, and output trees, which we will discuss in more detail later in this chapter.

The XSLT processor applies a stylesheet to an input document and produces an output document. Having the output document be the same kind of object as the input document enables XSLT to carry out a transformation. The stylesheet document defines the transformation to occur.

Again, text documents are not dealt with directly. They are dealt with in object trees that exist in memory. A tree is an abstract data type. There are no predefined ways to represent trees. A tree resembles the W3C's DOM, but without the API, and the structure and processing models of trees are localized to the particular XSLT processor. For example, MSXML3 uses a different structure than the Saxon XSLT processor.

Adhering to the rules of the XSLT specification, the processor must read a stylesheet tree and use it to transform the input document tree to the output document tree. However, no formal rules govern how source documents are read or how output documents are produced.

Most real-world application integration tools are much more complex than this example, and many different types of problem domains will stretch the capabilities of the XSLT processing model (see Figure 11.9), including handling:

  • Multiple document inputs.

  • Multiple stylesheet inputs.

  • Multiple documents outputs.

Figure 11.9. XSLT, when leveraged for application integration, will have to handle complex operations such as processing multiple input, output, and stylesheet documents at the same time.

graphics/11fig09.gif



Next Generation Application Integration(c) From Simple Information to Web Services
Next Generation Application Integration: From Simple Information to Web Services
ISBN: 0201844567
EAN: 2147483647
Year: 2005
Pages: 220

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