Basic XSLT Features

Now, let’s learn how to use the XSLT 1.0 features to create useful XSL transformations.

Multiple XML Inputs

XSLT inputs must be XML documents, but there is no limit on how many XML documents can be used. The XSL document() function allows XSLT to have multiple XML documents as the inputs.

A typical example is to use XSLT to merge XML documents (contact_resume_merge.xsl):

Listing 7-5 Merging XML Documents with XSLT

<xsl:stylesheet version=“1.0” xmlns:xsl=“http://www.w3.org/1999/XSL/Transform”

                                        xmlns:book=“http://xmlbook.com/sample/contact.xsd”>

     <xsl:output method=“xml” omit-xml-declaration=“no” indent=“yes”/>

     <xsl:template match=“@*|node()”>

          <xsl:choose>

                ...

Get Oracle Database 11g Building Oracle XML DB Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.