Since the early days of XSLT, many have asked whether it was possible to automate the creation of XSLT stylesheets. The general idea of filling out a form or dragging some icons around, then clicking a button and seeing a productive stylesheet generated from your input has always appealed to people. However, the problem of generating working XSLT syntax from the result of someone clicking on pull-down menus and radio buttons has not attracted many takers.
As XML formatted content and data becomes pervasive on intranets and the Internet the requirement to minimize individual process times becomes great. XPath has been evolving into a rich expression language to query and extract data in a precise way. While it has been designed to be used by a host language such as XSLT and XQuery, an XPath processor can be used quite usefully standalone or as part of an application framework.
XML considers four characters to be whitespace: the carriage return, the linefeed, the tab, and the spacebar space. Microsoft operating systems put both a carriage return and a linefeed at the end of each line of a text file, and people usually refer to the combination as the "carriage return". XSLT stylesheet developers often get frustrated over the whitespace that shows up in their result documents -- sometimes there's more than they wanted, sometimes there's less, and sometimes it's in the wrong place. Over the next few columns, we'll discuss how XML and XSLT treat whitespace to gain a better understanding of what can happen, and we'll look at some techniques for controlling how an XSLT processor adds whitespace to the result document.
XPath 2.0 is the foundation of two essential recommendations currently in the final stages of development at W3C: XSLT 2.0 and XQuery. It is a major rewrite designed to significantly increase the power and efficiency of the language. In this article, BenoÃ®t Marchal shows how the new data model enables you to easily write more sophisticated requests.
BMC Software Inc., a company that writes utility tools for database administrators, wanted to reuse the error messages from partner database companies. Having learned that two of these database companies already used single-source files for their error messages, BMC Software integrated the information about the error messages from the database companies. We accomplished our goal by negotiating with our partner companies for the source files of the error message information. This session discusses how we took those source files and modified them to create simple XML files, then transformed them into HTML using XSL transforms within a product.
XML is a data format concerned primarily with compatibility and flexibility. But as useful as XML is, it's limited without the abilities to find specific portions of a document quickly and to filter and selectively locate data within a document. XPath provides the ability to easily reference specific text, elements, and attributes within a document—and with a fairly low learning curve. Additionally, XPath is key to many other XML vocabularies and technologies, such as XSL and XQuery. This tutorial will teach you the fundamentals of XPath, including all of its various selectors and semantics, in an example-driven and hands-on manner.
This month I'm taking a break from covering XSLT 2.0 to describe how the combination of XSLT 1.0 and an application with an open XML format solved a problem for me. I solved this problem so quickly and easily that it got me thinking about how the combination of XSLT 1.0 and the increasing amount of open XML formats are opening up a world of simple, valuable new applications and utilities for us to write.
Covers XPath's new ability to do some things that every real programming language can do: conditional statements and iteration, or, as they're more colloquially known, "if" statements and "for" loops. We'll also look at a useful related technique for checking whether certain conditions do or don't exist in a set of nodes.
How do you convert your application-neutral, vendor-neutral, unformatted XML content into paginated content (such as PDF) or HTML? O'Keefe introduces one solution: the Extensible Stylesheet Language, a programming language for processing XML.
In a recent weblog post, XML.com's "Python and XML" columnist Uche Ogbuji provided a nice collection of links to discussions about the push vs. pull styles of XSLT stylesheet development. What do we mean by "push" and "pull"? As a short example of each, let's look at two approaches to converting the following DocBook document to XHTML.
The idea behind that quote is that XQuery is like a jacked up version of XPath with a little XSLT sprinkled in for good measure. In other words, XQuery is a technology that packs some punch when it comes to drilling deep into XML data and extracting exactly the data in which you're interested. This tutorial introduces you to XQuery and shows you some practical ways to put the language to use with your own XML code.
The value of XQuery is not in its role as an alternative syntax to XSLT 2.0 for manipulating XML; it's in the implementations, which let you quickly retrieve, sort, and manipulate specific subsets of XML from collections that can measure in the terabytes. The ability to store large, indexed collections of data that don't fit neatly into normalized relational tables will create possibilities for all kinds of new applications, both inside and outside of the publishing world.
Gets you to the point where you could start exploring those features with a reasonably large collection of your own data. Without spending any money, you can check them all out and discover the advantages to having large amounts of your XML stored in a database where you (or an application!) can use a W3C standard language to quickly retrieve what you want from that database.
With the release of version 2.0, XSLT now allows you to design your stylesheets to be schema-aware. A schema-aware XSLT system offers many benefits, including the ability to validate input trees prior to the XSLT transformation to ensure that the XSLT stylesheet only processes valid input, as well as the ability to validate output trees to ensure that the XSLT transformation is producing the valid XML output. You are also able to specify data types for variables, for input parameters for user-defined functions and templates, and for return values from the functions. In this article, learn more about the concept of schema-aware facilities and follow some examples that illustrate the benefits.
XPath 1.0 (and hence your XSLT style sheets) considers two elements to be equal if their string values are the same. The string value is essentially all of the PCDATA between the element's start and end tags, even if the element has descendant elements. For example, an XSLT processor considers the w and z elements in the following to be equal, because they both have a string value of "abcdefghi".
One of the tenets of modern software design is that early and frequent testing is a key contributor to successful application development. Unit testing frameworks, tools designed to ease the development and execution of unit tests, exist for many programming languages. This paper discusses how unit testing can be applied to the development of stylesheets and describes a testing framework for XSLT 2.0 unit tests.
This two-part article series is designed to get PHP developers up to speed in leveraging Web 2.0 XForms forms for their PHP forms development so that they can finally put their outdated Web 1.0 HTML forms away. This will be accomplished by creating a library of functions that generate XForms elements when called upon. In this article, Part 1 of a two-part series, developers will create the XForms library using PHP, allowing each function to take in parameters and output XForm elements.
This two-part article seriess is designed to get PHP developers up to speed in leveraging Web 2.0 XForms forms for their PHP forms development so that they can finally put their outdated Web 1.0 HTML forms away. In Part 1, you created the PHP XForms library. In this article, Part 2, you will enhance the library to include some error checking and convenience functions to help make using the library more manageable, and lastly you'll demo the library by creating a proof of concept XForm.
With XSLT support fast becoming a commonly available component in the browser, web developers can now leverage transformations to manipulate large amounts of data in the browser at speeds acceptable for more advanced user interfaces. Once Safari gets its act together, I see more and more UI-specific data processing being moved off of the server into the browser. This article outlines the process involved in transforming the del.icio.us user API XML document into an HTML fragment.
XQuery, the query language for XML, can be used to modify XML. In this article, learn about the various ways to modify XML, including XML stored in memory or in a DB2® pureXML™ database. Explore the different ways to modify XML in four different use cases: health care, business, financial derivatives, and information technology, while utilizing DB2 pureXML. Finally, examine guidelines for when to use XQuery to perform either sub-document updates or full document replacement and versioning of the stored XML.