Stylus Studio is a product of the DataDirect Technologies division of Progress Software is a flexible, extensible tool for working with XML. It is strongest at opening XML from a variety of sources and enabling conversion of many formats into XML.
Stylus Studio supports basic XML editing, but also provides a number of advanced and unique features for working with XML documents. The first feature you notice when you attempt to open an XML file is the incredible number of sources available for opening XML (see Figure 2-17). Stylus Studio can open XML files directly from a number of file systems, as well as relational or object databases. In addition, you can convert nonXML files into XML as you load them by adding a converter or adapter between the source and Stylus Studio. This enables you to convert CSV, delimited, or EDI files directly as you load them.
Figure 2-17
In addition to opening existing XML files, you can create new XML files using a basic template or an existing data source. Figure 2-18 shows some of the available document wizards that can convert or create XML files.
Figure 2-18
Stylus Studio has different views for working with your XML files. In addition to the normal text-based view of your XML, Stylus Studio also includes two graphical views. You can switch between these views via the tabs at the bottom of the editor window. Figure 2-19 shows the tree view. Using this view, you can quickly view and navigate the structure of a document.
Figure 2-19
In addition, a grid view (as seen in Figure 2-20) adds to the capabilities of the tree view by providing a surface where you can navigate and edit an XML document using a grid at each level in the document. This is very useful when working with documents that contain repeating structures, such as those extracted from databases.
Figure 2-20
Stylus Studio certainly has all the core XML features you need for typical XML work. The grid and tree views make exploring and editing XML files easier. Where Stylus really shines is in its import and conversion capabilities.
As you would expect from an editor that is as capable as Stylus is for opening and transforming XML, the schema support is extensive. Stylus allows for creating and editing both DTDs and XML schemas. In addition, it has support for converting between these two formats. Figure 2-21 shows the schema editor window, with both the graphical and text views of the schema.
Figure 2-21
After the schema has been created, Stylus can create a set of documentation pages for the schema. This creates a number of HTML pages (see Figure 2-22) based on the schema structure, as well as any annotations available. This can be quite useful when sharing a schema between developers because users can more rapidly learn how to structure their documents.
Figure 2-22
Like many of the other editors in this chapter, Stylus Studio supports debugging XSLT (see Figure 2-23). You can set breakpoints in the templates, step through the code, and query values while the transformation is in process. You start the debugger using the commands in the Debug menu.
Figure 2-23
This debugger can also be used when working with XQuery documents. In addition to debugging XSLT or XQuery statements, you can also generate a profile report of the transformation. This can highlight slow points in the query or transformation by showing the relative timings at each step (see Figure 2-24).
Figure 2-24
One unique capability among these editors is the capability of Stylus to create an XSLT template with a graphical mapper. This enables you to align two similar XML documents or visually define how the XML can be used when generating HTML output. Figure 2-25 shows this mapper in action. Notice how the XSLT is built in the lower window as the tags are mapped between the source and destination files. The transformation can even include additional processing on the elements using Java extensions.
Figure 2-25
You can debug SOAP calls directly from Stylus Studio by creating a new Web Service call file. You assign the WSDL for the call. You can then directly call the SOAP endpoint. The resulting SOAP request and response files are created, enabling you to save them for later use or documentation (see Figure 2-26).
Figure 2-26
Stylus Studio also supports code generation. If you work in Java, Stylus can generate classes that wrap Xalan or Saxon processor calls for XSLT transformations or XQuery queries, as shown in Figure 2-27.
Figure 2-27
The following table summarizes the editing capabilities of Stylus Studio.
Benefit | Disadvantage |
---|---|
Can convert CSV, delimited, EDI, or other formats to XML when loading. | Schema support limited to DTD and W3C XML schema. No support for Relax NG or Schematron. |
Has support for opening and closing files from a number of sources, including relational and object databases. | |
Document Wizards enable conversion of files from CSV, tab-delimited, or databases into XML. | |
Integrated XSLT mapper allows for visually designing XSLT transformation. | |
Support for XQuery, including debugging. | |
Can generate Java source code for XSLT or XQuery. | No support for .NET or C++ code generation. |