When developing Web applications that use Java and XML there are many
options, including (among others) the Apache Struts framework and the
Extensible Stylesheet Language Transformation (XSLT) language.
At first blush, these options may seem like an "either/or" proposition,
considering the fact that the view portion of Struts serves essentially the
same purpose as XSLT: to render the view, or visual output, of the
application. This article will show how XSLT can be used within the view
layer of Struts to leverage the strengths of both and allow you maximum
flexibility in the visual presentation of your Java Web applications.
Some of you may be thinking design patterns at this point. That is, Struts
uses the model 2 (M2) design pattern, which began as the
model-view-controller pattern (see Design Patterns: Elements of Reusable
Object-Oriented Software from Addison We... (more)
In my last article, "Two Great Technologies, One Amazing Solution" (XML-J,
Vol. 2, issue 1), I demonstrated how the Java programming language could be
used within stylesheets to add robustness to XSLT. This month I'll stick
strictly within the confines of the XPath and XSLT to show some of the
built-in functionality available to you.
The XPath and XSLT specifications include sections defining "functions."
Whether they're core (required by an implementation of the spec) or external
(core extensions or user defined), functions assist the stylesheet writer by
providing valuable ser... (more)
The Extensible Stylesheet Language (XSL) W3C recommendation was created as a
means to display XML data. The recommendation includes a transformation
language (XSLT) and formatting object (or output format) language (XSL-FO),
which together provide the XSL stylesheet developer with the tools necessary
to present XML.
The XSL-FO language is like HTML on steroids, because it allows not only
cascading stylesheet (CSS)-type functionality, but also pagination and page
layout, which are not available using HTML alone (at least not to as great a
degree as with XSL-FO). However, such rob... (more)
As those of you familiar with XSL know, there are two parts to the W3C
Recommendation (www.w3.org/TR/xsl): a transformation part (XSLT) and a
formatting part (XSL Formatting Objects, or XSL-FO for short) with the intent
being the presentation of XML. However, since XSLT is also its own (more
mature) W3C Recommendation (www.w3.org/TR/xsl), it has enjoyed the attention
of developers wishing to transform XML into other markup languages such as
HTML. In a very real sense XSLT is how XML is currently being visually
presented.
Although using XSLT to transform XML to HTML can be very p... (more)
The eXtensible Stylesheet Language Transformation (XSLT) process allows for
the changing (or transformation) of XML into other text including (different)
XML, plain text, HTML, and Wireless Markup Language (WML). Understanding the
basics of XSLT can serve you well as you pursue the presentation and
integration of XML in your applications.
This article briefly introduces these concepts and the transformation
process. I'll then show how Java classes can be used directly within XSL
stylesheets to provide extensive robustness during the transformation
process. I'll demonstrate how X... (more)