XML Stylesheet Language for Transformations





XML Stylesheet Language for Transformations

Eric Armstrong

In This Chapter

7.1 Introducing XSLT and XPath

7.2 Writing Out a DOM as an XML File

7.3 Generating XML from an Arbitrary Data Structure

7.4 Transforming XML Data with XSLT

7.5 Concatenating XSLT Transformations with a Filter Chain

The XML Stylesheet Language for Transformations (XSLT) defines mechanisms for addressing XML data (XPath) and for specifying transformations on the data, in order to convert it into other forms. In this chapter, you'll learn how to use XSLT to write out a DOM as an XML file. You'll also see how to generate a DOM from an arbitrary data file in order to convert it to XML. Finally, you'll use XSLT to convert XML data into a different form, unlocking the mysteries of the XPath addressing mechanism along the way.

In this chapter, you'll parse an existing XML file to construct a DOM, display and inspect the DOM hierarchy, convert the DOM into a user-friendly JTree, and explore the syntax of namespaces. You'll also create a DOM from scratch, and see how to use some of the implementation-specific features in Sun's JAXP reference implementation to convert an existing data set to XML.

Note

The examples in this chapter can be found in docs/tutorial/examples/jaxp/xslt/samples.



     Python   SQL   Java   php   Perl 
     game development   web development   internet   *nix   graphics   hardware 
     telecommunications   C++ 
     Flash   Active Directory   Windows