Skip to Content
XSLT and XPATH: A Guide to XML Transformations
book

XSLT and XPATH: A Guide to XML Transformations

by John Robert Gardner, Zarella L. Rendon
July 2001
Intermediate to advanced
592 pages
11h 16m
English
Pearson
Content preview from XSLT and XPATH: A Guide to XML Transformations

by Jeni Tennison

Grouping is a common problem in XSLT stylesheets. How do you take a list of elements and arrange them into groups? One of the most common situations in which it occurs is when you are getting XML output from a database. The database usually gives you results that are structured according to the records in the database. If it's an address book, for example, it might give you something like:

<records>
      <contact id="0001">
            <title>Mr</title>
            <forename>John</forename>
            <surname>Smith</surname>
      </contact>
      <contact id="0002">
            <title>Dr</title>
            <forename>Amy</forename>
            <surname>Jones</surname>
      </contact>
      -
</records>

The problem is how to turn this flat input into a number of lists, grouped by surname, to give something like:

 Jones,<br ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning XSLT and XPath: Transforming XML Documents and Data

Beginning XSLT and XPath: Transforming XML Documents and Data

Ian Williams
Java and XSLT

Java and XSLT

Eric M. Burke
Learning XSLT

Learning XSLT

Michael Fitzgerald

Publisher Resources

ISBN: 0130404462Purchase book