XSLT Cookbook: Solutions and Examples for XML and XSLT Developers

XSLT Cookbook: Solutions and Examples for XML and XSLT Developers

by Sal Mangano
XSLT Cookbook: Solutions and Examples for XML and XSLT Developers

XSLT Cookbook: Solutions and Examples for XML and XSLT Developers

by Sal Mangano

eBook

$32.99  $43.99 Save 25% Current price is $32.99, Original price is $43.99. You Save 25%.

Available on Compatible NOOK Devices and the free NOOK Apps.
WANT A NOOK?  Explore Now

Related collections and offers


Overview

Forget those funky robot toys that were all the rage in the '80s, XSLT (Extensible Stylesheet Transformations) is the ultimate transformer. This powerful language is expert at transforming XML documents into PDF files, HTML documents, JPEG files--virtually anything your heart desires. As useful as XSLT is, though, most people have a difficult time learning its many peculiarities. And now Version 2.0, while elegant and powerful, has only added to the confusion.

XSLT Cookbook, Second Edition wants to set the record straight. It helps you sharpen your programming skills and overall understanding of XSLT through a collection of detailed recipes. Each recipe breaks down a specific problem into manageable chunks, giving you an easy-to-grasp roadmap for integrating XSLT with your data and applications. No other XSLT book around employs this practical problem-solution-discussion format.

In addition to offering code recipes for solving everyday problems with XSLT 1.0, this new edition shows you how to leverage the improvements found in XSLT 2.0, such as how to simplify the string manipulation and date/time conversion processes. The book also covers XPath 2.0, a critical companion standard, as well as topics ranging from basic transformations to complex sorting and linking. It even explores extension functions on a variety of different XSLT processors and shows ways to combine multiple documents using XSLT. Code examples add a real-world dimension to each technique.

Whether you're just starting out in XSLT or looking for advanced techniques, you'll find the level of information you need in XSLT Cookbook, Second Edition.


Product Details

ISBN-13: 9780596553302
Publisher: O'Reilly Media, Incorporated
Publication date: 12/14/2005
Series: Cookbooks (O'Reilly)
Sold by: Barnes & Noble
Format: eBook
Pages: 778
File size: 4 MB

About the Author

Sal Mangano has worked as a developer on Wall Street for 12 years, including work at the New York Stock Exchange and Morgan Stanley. He has a Master's degree in Computer Science from Polytechnic Universityand is currently working as an independent consultant, focused on financial applications of XML and related technologies.

Table of Contents

Preface9
1.Strings1
1.1Testing if a String Ends with Another String2
1.2Finding the Position of a Substring2
1.3Removing Specific Characters from a String3
1.4Finding Substrings from the End of a String4
1.5Duplicating a String N Times6
1.6Reversing a String9
1.7Replacing Text13
1.8Converting Case17
1.9Tokenizing a String19
1.10Making Do Without Regular Expressions22
1.11Using the EXSLT String Extensions23
2.Numbers and Math26
2.1Formatting Numbers27
2.2Rounding Numbers to a Specified Precision36
2.3Converting from Roman Numerals to Numbers37
2.4Converting from One Base to Another39
2.5Implementing Common Math Functions43
2.6Computing Sums and Products54
2.7Finding Minimums and Maximums58
2.8Computing Statistical Functions65
2.9Computing Combinatorial Functions68
2.10Testing Bits69
3.Dates and Times75
3.1Calculating the Day of the Week77
3.2Determining the Last Day of the Month78
3.3Getting Names for Days and Months79
3.4Calculating Julian and Absolute Day Numbers from a Specified Date82
3.5Calculating the Week Number for a Specified Date85
3.6Working with the Julian Calendar86
3.7Working with the ISO Calendar87
3.8Working with the Islamic Calendar90
3.9Working with the Hebrew Calendar92
3.10Formatting Dates and Times101
3.11Determining Secular and Religious Holidays106
4.Selecting and Traversing109
4.1Optimizing Node Selections111
4.2Determining if Two Nodes Are the Same120
4.3Ignoring Duplicate Elements123
4.4Selecting All but a Specific Element127
4.5Performing a Preorder Traversal128
4.6Performing a Postorder Traversal132
4.7Performing an In-Order Traversal134
4.8Performing a Level-Order Traversal138
4.9Processing Nodes by Position143
5.XML to Text149
5.1Dealing with Whitespace150
5.2Exporting XML to Delimited Data155
5.3Creating a Columnar Report170
5.4Displaying a Hierarchy180
5.5Numbering Textual Output188
5.6Wrapping Text to a Specified Width and Alignment197
6.XML to XML201
6.1Converting Attributes to Elements202
6.2Converting Elements to Attributes204
6.3Renaming Elements or Attributes207
6.4Merging Documents with Identical Schema212
6.5Merging Documents with Unlike Schema217
6.6Splitting Documents223
6.7Flattening an XML Hierarchy224
6.8Deepening an XML Hierarchy228
6.9Reorganizing an XML Hierarchy232
7.Querying XML236
7.1Performing Set Operations on Node Sets237
7.2Performing Set Operations on Node Sets Using Value Semantics240
7.3Determining Set Equality by Value249
7.4Performing Structure-Preserving Queries253
7.5Joins255
7.6Implementing the W3C XML Query-Use Cases in XSLT260
8.XML to HTML288
8.1Using XSLT as a Styling Language289
8.2Creating Hyperlinked Documents293
8.3Creating HTML Tables296
8.4Creating Frames303
8.5Creating Data-Driven Stylesheets308
8.6Creating a Self-Contained HTML Transformation314
8.7Populating a Form318
9.XML to SVG324
9.1Transforming an Existing Boilerplate SVG325
9.2Creating Reusable SVG Generation Utilities for Graphs and Charts332
9.3Creating a Tree Diagram368
9.4Creating Interactive SVG-Enabled Web Pages378
10.Code Generation388
10.1Generating Constant Definitions396
10.2Generating Switching Code400
10.3Generating Message-Handling Stub Code405
10.4Generating Data Wrappers408
10.5Generating Pretty Printers412
10.6Generating a Test Data-Entry Web Client420
10.7Generating Test-Entry Web CGI421
10.8Generating Code from UML Models via XMI426
10.9Generating XSLT from XSLT442
11.Vertical XSLT Application Recipes449
11.1Converting Visio VDX Documents to SVG450
11.2Working with Excel XML Spreadsheets463
11.3Generating XTM Topic Maps from UML Models via XMI470
11.4Generating Web Sites from XTM Topic Maps490
11.5Serving SOAP Documentation from WSDL504
12.Extending and Embedding XSLT518
12.1Using Saxon's and Xalan's Native Extensions525
12.2Extending XSLT with JavaScript537
12.3Adding Extension Functions Using Java543
12.4Adding Extension Elements Using Java549
12.5Using XSLT from Perl563
12.6Using XSLT from Java566
13.Testing and Debugging569
13.1Using xsl: message Effectively570
13.2Tracing the Flow of Your Stylesheet Through Its Input Document572
13.3Automating the Insertion of Debug Output577
13.4Including Embedded Unit Test Data in Utility Stylesheets584
13.5Structuring Unit Tests589
13.6Testing Boundary and Error Conditions591
14.Generic and Functional Programming595
14.1Creating Polymorphic XSLT600
14.2Creating Generic Element Aggregation Functions607
14.3Creating Generic Bounded Aggregation Functions620
14.4Creating Generic Mapping Functions627
14.5Creating Generic Node-Set Generators635
Index641
From the B&N Reads Blog

Customer Reviews