Search Across a Variety of XML Data
The W3C XQuery 3.1 standard provides a tool to search, extract, and manipulate content, whether it's in XML, JSON or plain text. With this fully updated, in-depth tutorial, you’ll learn to program with this highly practical query language.
Designed for query writers who have some knowledge of XML more » basics, but not necessarily advanced knowledge of XML-related technologies, this book is ideal as both a tutorial and a reference. You’ll find background information for namespaces, schemas, built-in types, and regular expressions that are relevant to writing XML queries.
This second edition provides:
* A high-level overview and quick tour of XQuery
* New chapters on higher-order functions, maps, arrays, and JSON
* A carefully paced tutorial that teaches XQuery without being bogged down by the details
* Advanced concepts for taking advantage of modularity, namespaces, typing, and schemas
* Guidelines for working with specific types of data, such as numbers, strings, dates, URIs, maps and arrays
* XQuery’s implementation-specific features and its relationship to other standards including SQL and XSLT
* A complete alphabetical reference to the built-in functions, types, and error messages « less
Level the Learning Curve and Put Your XML to Work
Finally, a ground-up, quick-start approach to XSLT that teaches not just the language, but XML processing solutions. XSLT Jumpstarter approaches the subject like no other book, using examples that ease you through the basic concepts while demonstrating how to solve common problems. It doesn't unload more » language elements on you, it shows how to create HTML output, rearrange and modify XML nodes, manipulate text, conditionalize processing, make global changes, perform grouping and sorting, and implement strategies for re-using templates and stylesheets. XSLT Jumpstarter offers a hands-on, jump-in-the-water approach that will launch you over the XSLT learning curve!
Get your XML under control with XSLT Jumpstarter. XML is everywhere in data and web technology, and XSLT was created specifically to transform XML into all kinds of text output, including HTML, XML, SVG, and others. You'll start with example solutions that introduce the range of XSLT possibilities. You'll get the processing concepts behind XSLT; how to create and manipulate output; how to make global changes to XML; how to use conditional instructions, XPath, and XSLT functions for complex controls; how to sort and group your output; and techniques for large-scale stylesheet management.
Using a browser-based XSLT processor, you'll immediately transform XML with no setup time. You'll set up a stand-alone XSLT processor controlled from the command line. You'll get a clear view into the basic XSLT processing model so you can put it to work. Throughout the book, you'll see elements of XSLT working together in solutions to common XML processing problems. And you'll get a thorough analysis of the solutions, giving you the understanding to modify examples or create your own XSLT from scratch.
This is not another XSLT reference, but an accessible guide that gets your hands dirty with a solution-oriented approach. Filled with practical examples and detailed explanations, this book is designed to kickstart the XSLT newbie into action. « less
The XML language has become the standard for writing documents on the Internet and is constantly improving and evolving. This new edition covers all the many new XML-based technologies that have appeared since the previous edition four years ago, providing you with an up-to-date introductory guide and more » reference. Packed with real-world code examples, best practices, and in-depth coverage of the most important and relevant topics, this authoritative resource explores both the advantages and disadvantages of XML and addresses the most current standards and uses of XML. « less
Master the .NET Framework’s XML features to build powerful, data-driven applications
Beginning XML with C# 2008 focuses on XML and how it is used within .NET 3.5. As you'd expect of a modern application framework, .NET 3.5 has extensive support for XML in everything from data access to configuration, from raw parsing to code documentation. This book demystifies all of this. It explains more » the basics of XML as well as the namespaces and objects you need to know in order to work efficiently with XML. You will see clear, practical examples that illustrate best practices in action. With this book, you'll learn everything you need to know from the basics of reading and writing XML data to using the DOM, from LINQ and SQL Server integration to SOAP and web services. « less
This book is primarily a practical reference book for professional XSLT developers. It assumes no previous knowledge of the language, and many developers have used it as their first introduction to XSLT; however, it is not structured as a tutorial, and there are other books on XSLT that provide a gentler more » approach for beginners. The book does assume a basic knowledge of XML, HTML, and the architecture of the Web, and it is written for experienced programmers. There’s no assumption that you know any particular language such as Java or Visual Basic, just that you recognize the concepts that all programming languages have in common.
The book is suitable both for XSLT 1.0 users upgrading to XSLT 2.0, and for newcomers to XSLT. The book is also equally suitable whether you work in the Java or .NET world.
As befits a reference book, a key aim is that the coverage should be comprehensive and authoritative. It is designed to give you all the details, not just an overview of the 20 percent of the language that most people use 80 percent of the time. It’s designed so that you will keep coming back to the book whenever you encounter new and challenging programming tasks, not as a book that you skim quickly and then leave on the shelf. If you like detail, you will enjoy this book; if not, you probably won’t.
But as well as giving the detail, this book aims to explain the concepts, in some depth. It’s therefore a book for people who not only want to use the language but who also want to understand it at a deep level.
The book aims to tell you everything you need to know about the XSLT 2.0 language. It gives equal weight to the things that are new in XSLT 2.0 and the things that were already present in version 1.0. The book is about the language, not about specific products. However, there are appendices about Saxon (the author’s own implementation of XSLT 2.0), about the Altova XSLT 2.0 implementation, and about the Java and Microsoft APIs for controlling XSLT transformations, which will no doubt be upgraded to handle XSLT 2.0 as well as 1.0. A third XSLT 2.0 processor, Gestalt, was released shortly before the book went to press, too late to describe it in any detail. But the experience of XSLT 1.0 is that there has been a very high level of interoperability between different XSLT processors, and if you can use one of them, then you can use them all.
In the previous edition we split XSLT 2.0 and XPath 2.0 into separate volumes. The idea was that some readers might be interested in XPath alone. However, many bought the XSLT 2.0 book without its XPath companion and were left confused as a result; so this time, the material is back together. The XPath reference information is in self-contained chapters, so it should still be accessible when you use XPath in contexts other than XSLT.
The book does not cover XSL Formatting Objects, a big subject in its own right. Nor does it cover XML Schemas in any detail. If you want to use these important technologies in conjunction with XSLT, there are other books that do them justice.
This book contains twenty chapters and eight appendixes (the last of which is a glossary) organized into four parts. The following section outlines what you can find in each part, chapter, and appendix.
Part I: Foundations: The first part of the book covers essential concepts. You should read these before you start coding. If you ignore this advice, as most people do, then you read them when you get to that trough of despair when you find it impossible to make the language do anything but the most trivial tasks. XSLT is different from other languages, and to make it work for you, you need to understand how it was designed to be used.
Chapter 1: XSLT in Context: This chapter explains how XSLT fits into the big picture: how the language came into being and how it sits alongside other technologies. It also has a few simple coding examples to keep you alert.
Chapter 2: The XSLT Processing Model: This is about the architecture of an XSLT processor: the inputs, the outputs, and the data model. Understanding the data model is perhaps the most important thing that distinguishes an XSLT expert from an amateur; it may seem like information that you can’t use immediately, but it’s knowledge that will stop you making a lot of stupid mistakes.
Chapter 3: Stylesheet Structure: XSLT development is about writing stylesheets, and this chapter takes a bird’s eye view of what stylesheets look like. It explains the key concepts of rule-based programming using templates, and explains how to undertake programming-in-the-large by structuring your application using modules and pipelines.
Chapter 4: Stylesheets and Schemas: A key innovation in XSLT 2.0 is that stylesheets can take advantage of knowledge about the structure of your input and output documents, provided in the form of an XML Schema. This chapter provides a quick overview of XML Schema to describe its impact on XSLT development. Not everyone uses schemas, and you can skip this chapter if you fall into that category.
Chapter 5: The Type System: XPath 2.0 and XSLT 2.0 offer strong typing as an alternative to the weak typing approach of the 1.0 languages. This means that you can declare the types of your variables, functions, and parameters, and use this information to get early warning of programming errors. This chapter explains the data types available and the mechanisms for creating user-defined types.
Part II: XSLT and XPath Reference: This section of the book contains reference material, organized in the hope that you can easily find what you need when you need it. It’s not designed for sequential reading, though you might well want to leaf through the pages to discover what’s there.
Chapter 6: XSLT Elements: This monster chapter lists all the XSLT elements you can use in a stylesheet, in alphabetical order, giving detailed rules for the syntax and semantics of each element, advice on usage, and examples. This is probably the part of the book you will use most frequently as you become an expert XSLT user. It’s a “no stone unturned” approach, based on the belief that as a professional developer you need to know what happens when the going gets tough, not just when the wind is in your direction.
Chapter 7: XPath Fundamentals: This chapter explains the basics of XPath: the low-level constructs such as literals, variables, and function calls. It also explains the context rules, which describe how the evaluation of XPath expressions depends on the XSLT processing context in which they appear.
Chapter 8: XPath: Operators on Items: XPath offers the usual range of operators for performing arithmetic, boolean comparison, and the like. However, these don’t always behave exactly as you would expect, so it’s worth reading this chapter to see what’s available and how it differs from the last language that you used.
Chapter 9: XPath: Path Expressions: Path expressions are what make XPath special; they enable you to navigate around the structure of an XML document. This chapter explains the syntax of path expressions, the 13 axes that you can use to locate the nodes that you need, and associated operators such as union, intersection, and difference.
Chapter 10: XPath: Sequence Expressions: Unlike XPath 1.0, in version 2.0 all values are sequences (singletons are just a special case). Some of the most important operators in XPath 2.0 are those that manipulate sequences, notably the «for» expression, which translates one sequence into another by applying a mapping.
Chapter 11: XPath: Type Expressions: The type system was explained in Chapter 5; this chapter explains the operations that you can use to take advantage of types. This includes the «cast» operation which is used to convert values from one type to another.A big part of this chapter is devoted to the detailed rules for how these conversions are done.
Chapter 12: XSLT Patterns: This chapter returns from XPath to a subject that’s specific to XSLT. Patterns are used to define template rules, the essence of XSLT’s rule-based programming approach. The reason for explaining them now is that the syntax and semantics of patterns depends strongly on the corresponding rules for XPath expressions.
Chapter 13: The Function Library: XPath 2.0 includes a library of functions that can be called from any XPath expression; XSLT 2.0 extends this with some additional functions that are available only when XPath is used within XSLT. The library has grown immensely since XPath 1.0. This chapter provides a single alphabetical reference for all these functions.
Chapter 14: Regular Expressions: Processing of text is an area where XSLT 2.0 and XPath 2.0 are much more powerful than version 1.0, and this is largely through the use of constructs that exploit regular expressions. If you’re familiar with regexes from languages such as Perl, this chapter tells you how XPath regular expressions differ. If you’re new to the subject, it explains it from first principles.
Chapter 15: Serialization: Serialization in XSLT means the ability to generate a textual XML document from the tree structure that’s manipulated by a stylesheet. This isn’t part of XSLT processing proper, so (following W3C’s lead) it’s separated it into its own chapter. You can control serialization from the stylesheet using an declaration, but many products also allow you to control it directly via an API.
Part III: Exploitation: The final section of the book is advice and guidance on how to take advantage of XSLT to write real applications. It’s intended to make you not just a competent XSLT coder, but a competent designer too. The best way of learning is by studying the work of others, so the emphasis here is on practical case studies.
Chapter 16: Extensibility: This chapter describes the “hooks” provided in the XSLT specification to allow vendors and users to plug in extra functionality. The way this works will vary from one implementation to another, so we can’t cover all possibilities, but one important aspect that the chapter does cover is how to use such extensions and still keep your code portable.
Chapter 17: Stylesheet Design Patterns: This chapter explores a number of design and coding patterns for XSLT programming, starting with the simplest “fill-in-the-blanks” stylesheet, and extending to the full use of recursive programming in the functional programming style, which is needed to tackle problems of any computational complexity. This provides an opportunity to explain the thinking behind functional programming and the change in mindset needed to take full advantage of this style of development.
Chapter 18: Case Study: XMLSpec: XSLT is often used for rendering documents, so where better to look for a case study than the stylesheets used by the W3C to render the XML and XSLT specifications, and others in the same family, for display on the web? The resulting stylesheets are typical of those you will find in any publishing organization that uses XML to develop a series of documents with a compatible look-and-feel.
Chapter 19: Case Study: A Family Tree: Displaying a family tree is another typical XSLT application. This example with semi-structured data—a mixture of fairly complex data and narrative text—that can be presented in many different ways for different audiences. It also shows how to tackle another typical XSLT problem, conversion of the data into XML from a legacy text-based format. As it happens, this uses nearly all the important new XSLT 2.0 features in one short stylesheet. But another aim of this chapter is to show a collection of stylesheets doing different jobs as part of a complete application.
Chapter 20: Case Study: Knight's Tour: Finding a route around a chessboard where a knight visits every square without ever retracing its steps might sound a fairly esoteric application for XSLT, but it’s a good way of showing how even the most complex of algorithms are within the capabilities of the language. You may not need to tackle this particular problem, but if you want to construct an SVG diagram showing progress against your project plan, then the problems won’t be that dissimilar.
Part IV: Appendices: Appendix A: XPath 2.0 Syntax Summary: Collects the XPath grammar rules and operator precedences into one place for ease of reference.
Appendix B: Error Codes: A list of all the error codes defined in the XSLT and XPath language specifications, with brief explanations to help you understand what’s gone wrong.
Appendix C: Backward Compatibility: The list of things you need to look out for when converting applications from XSLT 1.0.
Appendix D: Microsoft XSLT Processors: Although the two Microsoft XSLT processors don’t yet support XSLT 2.0, we thought many readers would find it useful to have a quick summary here of the main objects and methods used in their APIs.
Appendix E: JAXP: the Java API for XML Processing: JAXP is an interface rather than a product. Again, it doesn’t have explicit support yet for XSLT 2.0, but Java programmers will often be using it in XSLT 2.0 projects, so the book includes an overview of the classes and methods available.
Appendix F: Saxon: At the time of writing Saxon (developed by the author of this book) provides the most comprehensive implementation of XSLT 2.0 and XPath 2.0, so its interfaces and extensions are covered in some detail.
Appendix G: Altova: Altova, the developers of XML Spy, have an XSLT 2.0 processor that can be used either as part of the development environment or as a freestanding component. This appendix gives details of its interfaces.
Appendix H: Glossary
Note: CD-ROM/DVD and other supplementary materials are not included as part of eBook file. « less
Mastering XML Transformations
The second edition of XSLT incorporates new material for XSLT 2.0 and
expounds on the lessons learned over the last six years of XSLT 1.0 use. Whether you're looking for the latest and greatest in XSLT 1.0 techniques, or moving on to XSLT 2.0, this new edition of XSLT will address your needs. This book more » includes plenty of practical,
real-world examples to show you how to apply XSLT stylesheets to XML data using either version. « less
So what is XML? It's a markup language, used to describe the structure of data in meaningful ways. Anywhere that data is input/output, stored, or transmitted from one place to another, is a potential fit for XML's capabilities. Perhaps the most well-known applications are web-related (especially with more » the latest developments in handheld web accessâfor which some of the technology is XML-based). However, there are many other non-web-based applications for which XML is useful - for example, as a replacement for (or to complement) traditional databases, or for the transfer of financial information between businesses. News organizations, along with individuals, have also been using XML to distribute syndicated news stories and blog entries. « less
Planning Your XML Model
Have you ever wondered how to get started writing your own schema? As you prepare to create your schema, you must consider a number of factors. This guide explains each of those factors in detail and recommends an approach for documenting your schema development plan in an information model.
Your information more » model can not only be used as a planning mechanism to develop your schema but can also be used as a training resource and as a reference guide for those using the schema after it is developed. By putting a well-thought-out information model in place, you are bound to produce a schema that you can use indefinitely and build upon easily. « less
Search Across a Variety of XML Data
XQuery delivers a carefully paced tutorial that goes into the final 1.0 standard in detail. The book delves into critical advanced issues such as data typing and designing efficient query logic. Whether you're coming from SQL, XSLT, or starting from scratch, you'll learn about XQuery's support for filtering, more » sorting, and grouping data, as well as how to use FLWR expressions, XPath, and XQuery tools for extracting and combining information. « less
Microsoft Official Workshop
XML, otherwise known as eXtensible Mark Up language is the latest buzz-word on the Internet, but it's a rapidly maturing technology with powerful real-world applications, particularly for the management, display and organization of data. The book's scope is XML, XSL, and the whole Document Object Model. more » It also investigates SAX, WAP, XML linking, XML e-commerce, server to server XML and XML databases. This book is a broad compendium that investigates and describes how the total XML concept will work for programmers. « less