Skip to Main Content
C# Cookbook, 2nd Edition
book

C# Cookbook, 2nd Edition

by Jay Hilyard, Stephen Teilhet
January 2006
Intermediate to advanced content levelIntermediate to advanced
1184 pages
43h 23m
English
O'Reilly Media, Inc.
Content preview from C# Cookbook, 2nd Edition
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Passing Parameters to XSLT Transformations
|
873
Using the GenerateSchemaForDirectory method can jump-start the process of devel-
oping schema for your XML, but each schema should be reviewed by the team mem-
ber responsible for producing the XML. This will help to ensure that the rules as
stated in the schema are correct and also to make sure that additional items like
schema default values and other relationships are added. Any relationships that were
not present in the example XML files would be missed by the schema generator.
See Also
See the “XmlSchemaInference Class” and “XML Schemas (XSD) Reference” topics in
the MSDN documentation.
15.14 Passing Parameters to XSLT Transformations
Problem
You need to use XSLT to produce information that has a few data items that could
change between transformations and you don’t want to have a separate XSLT
stylesheet for each variation.
Solution
Use the XsltArgumentList class to pass arguments to the XSLT transformation. This
technique allows the program to generate an object for the stylesheet to access (such
as a dynamic string) and use while it transforms the given XML file. The
storeTitle
and pageDate arguments are passed in to the transformation in the following exam-
ple. The
storeTitle is for the title of the comic store and pageDate is the
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

C# Cookbook

C# Cookbook

Stephen Teilhet, Jay Hilyard
C# Cookbook

C# Cookbook

Joe Mayo
Head First C#, 4th Edition

Head First C#, 4th Edition

Andrew Stellman, Jennifer Greene

Publisher Resources

ISBN: 0596100639Supplemental ContentCatalog PageErrata