Home > Articles

  • Print
  • + Share This
This chapter is from the book

Editors

A simple text editor will work fine for editing XML, including XSL style sheets. A number of structured editors are available that are designed with XML in mind.

If you're using a text editor, you will sometimes have the problem of finding an error in the source, such as a missing end tag or a missing close quote. Errors of that type are known as well-formedness errors. They break the syntax of XML. The processing application may not be helpful in pinpointing well-formedness errors.

Microsoft Internet Explorer Version 5.5 (IE 5.5) has a mode for displaying XML content that is very helpful in pinpointing well-formedness errors. It gives the exact line where an expected end tag was not found, for example.

If you're having trouble pinpointing an error in an XML source, try loading it with IE5.5.

XSL Spy has is now a complete XSL editing environment. With version 4.4, the editor introduced an FO formatter extension based on XEP. This means that the editor will preview a style sheet with result elements in the FO namespace. XSL Spy is a commercial product. Refer to http://www.xmlspy.com/ for further information about XSL Spy.

The oXygen XML editor incorporated FOP with version 1.2 so that you can generate a PDF or PostScript output directly from the editor. The oXygen editor is a commercial product. The locator for oXygen is oxygen.sync.ro/.

SourceForge has an open source project titled Formatting Objects Authoring (FOA), located at foa.sourceforge.net/. The tool has an interactive preview that uses the FOP formatter.

jCatalog Software AG sells an editor for FO that lets you graphically lay out a document. The editor will store the document as a style sheet to format input XML data. The product is called XSLFast, located at http://www.xslfast.com.

The IBM Websphere Studio Application Developer contains editors for XML and XSLT. Find that at http://www.ibm.com/software/ad/studioappdev/.

SoftQuad, recently acquired by Corel Corp., produces an XML editor called XMetal http://www.xmetal.com. This is not strictly an XSL editor, but it is highly acclaimed as a general-purpose editor for markup.

Microsoft Word

The HTML export and import functions of Microsoft Word offer some capability for XML editing. Word has a styling feature that enables you to name combinations of font, paragraph, layout, and alignment settings. Word will output a class attribute on paragraphs containing the name of the style for that paragraph. It outputs CSS definitions that match each class. Following is an example of a CSS definition output by MS Word:

p.HA, li.HA, div.HA
	{mso-style-name:HA;
	mso-style-parent:"";
	margin-top:0in;
	margin-right:0in;
	margin-bottom:12.0pt;
	margin-left:0in;
	line-height:12.0pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:Courier;
	mso-fareast-font-family:"Times New Roman";
	mso-bidi-font-family:"Times New Roman";
	font-weight:bold;
	mso-bidi-font-weight:normal;}

This style definition will match for all <p>, <li>, or <div> elements that have class="HA." The mso-prefixed names are Microsoft proprietary names. Word uses those to capture internal settings not otherwise expressible with CSS. The other settings, such as font-weight, line-height, and margin-top, are all CSS defined. The following HTML output typesets a title element using the properties defined by the style named HA:

<p class=HA>(b)Tools and Implementations</p>

The bottom line of all this is that you can apply the style settings within a Microsoft Word document, save that as HTML, and then use a style sheet to convert it to FO or any other XML result. A style sheet template that matched the title element just shown would look like this:

<xsl:template match="p[@class='HA']">
 <!— template body —>
</xsl:template>

SourceForge has a project called WH2FO at wh2fo.sourceforge.net/ that accepts the Microsoft Word HTML output and produces XSL FOs.

  • + Share This
  • 🔖 Save To Your Account