Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Authoring with the developerWorks XML templates

A step-by-step guide for authors to create articles, tutorials, and knowledge paths for publication on developerWorks

Ian Shields, Senior Programmer, IBM
Ian Shields
Ian Shields works on a multitude of Linux projects for the developerWorks Linux zone. He is a Senior Programmer at IBM at the Research Triangle Park, NC. He joined IBM in Canberra, Australia, as a Systems Engineer in 1973, and has since worked on communications systems and pervasive computing in Montreal, Canada, and RTP, NC. He has several patents. His undergraduate degree is in pure mathematics and philosophy from the Australian National University. He has an M.S. and Ph.D. in computer science from North Carolina State University. You can contact Ian at ishields@us.ibm.com.
(An IBM developerWorks Contributing Author)
John Holtman (holtman@us.ibm.com), developerWorks community and tools support, IBM
author photo - john holtman
John Holtman works on the developerWorks Content and Community team. He leads a group that provides level-one support for community-based applications and maintains the site's authoring and editing tools. Since joining IBM in 1983, he has held a variety of positions, most of which have centered around development, design, and delivery of technical and marketing information in print, online, and interactive media. He holds a degree in Communication Arts from the University of Dayton in Dayton, Ohio.
Gretchen Moore (gemoore@us.ibm.com), developerWorks web editor, IBM
author photo - Gretchen Moore
As a developerWorks Web editor, Gretchen Moore has shaped developerWorks' editorial style, publication processes, and best practices since she helped launch the site in 1999. She's the Web editor for the Linux zone, and also serves as the tech lead for the Web editors of the technology zones. Her degrees are in Biology from the University of North Carolina in Chapel Hill, NC, and Technical writing from Rensselaer Polytechnic Institute in Troy, NY. For more info, see Gretchen's profile on My developerWorks.

Summary:  Welcome, authors! This article shows how to prepare technical articles, tutorials, and knowledge paths for publication on the developerWorks site. The steps are simple. You download our XML-based template for articles, tutorials, or knowledge paths, fill in the template using any validating XML editor or your preferred Microsoft® Windows® or Linux® text editor, check it to ensure it follows the tagging structure as defined in the developerWorks schema, and preview your article or tutorial. Tips for composing your content and submitting it to the developerWorks staff are also included.

Date:  01 Mar 2013 (Published 10 Feb 2005)
Level:  Introductory PDF:  A4 and Letter (422 KB | 17 pages)Get Adobe® Reader®
Also available in:   Chinese  Korean  Russian  Japanese  Vietnamese  Portuguese  Spanish

Activity:  85452 views
Comments:  

Looking for Word or OpenDocument templates rather than XML templates?

If you prefer to compose your article or tutorial in Microsoft Word, OpenOffice.org Writer, IBM Lotus Symphony, or another OpenDocument editor, we also offer Word and OpenDocument templates for your use. See the companion article, "Authoring with the developerWorks Word and OpenDocument templates."

Getting started

The editors at developerWorks look forward to working with you to publish your content. Please be sure you have presented your idea to an editor and have obtained his or her approval to proceed with your content before using these instructions. If you haven't already, fill in the Submit content form to propose your idea.

Articles, tutorials, and knowledge paths are published on developerWorks in HTML format, but are written using XML (Extensible Markup Language) format. Prior to publication, the XML source of the content is validated for acceptable markup as defined in the developerWorks schema and then transformed into the HTML for publication using an XSLT (Extensible Stylesheet Language for Transformations) stylesheet. This separation of article content from presentation details helps us use automated processes to manage our large site.

The authoring approaches we offer do not require specialized skills. If you are familiar with XML or HTML already, you'll find our templates easy to use. If not, you can get acquainted with XML by reading the composition tips later in these instructions, and by browsing the New to XML page on the developerWorks XML zone.

While you prepare your content for publication, think about making it accessible to readers who are vision challenged. In other words, supply text alternatives to non-text content like images. Later in this article, you'll see some examples of accessibility requirements for Web content. To learn more about Web content accessibility, skim the Web Content Accessibility Guidelines 2.0 for tips and techniques.


Which template?

If you've browsed the developerWorks site, you know that authors contribute articles, tutorials, and knowledge paths to developerWorks. Their format and purpose differ. Your developerWorks editor can help you decide which format best suits your content idea.

Articles

  • Like tutorials, articles often teach, but less overtly than tutorials. Articles don't spell out their educational objectives or time to completion.
  • In addition to instructing readers on a particular task, articles can also introduce new concepts, architectures, or product features. These kinds of articles aim to raise readers' awareness and whet their appetite to learn more (perhaps by taking a developerWorks tutorial!). Other kinds of articles take a more persuasive tone, where the author shares his or her unique approach, perspective, or experience. And other kinds of articles delve into a new product or technology by interviewing an expert or reviewing current literature on the topic.
  • Articles average 10 pages or fewer when printed. Readers generally read article content online.
  • An article can stand alone or be one part of a multi-part series.

Tutorials

  • Tutorials have educational objectives; they teach. Rather than simply listing steps, tutorials explain why the step is done and how it relates to the overall objective. Tutorials spell out their educational objectives and time to completion (usually around two hours). After completing a tutorial, the reader should be able to repeat the learned task independently.
  • Tutorials can teach concepts or how to complete tasks. Many tutorials teach both concepts and tasks, and encourage readers to try the tasks while reading. To make it easy to follow along, tutorials often include sample code and advice for setting up the reader's environment. Tutorials also often chunk content into discrete and manageable tasks that make up the whole.
  • Tutorials average 20 to 30 pages when printed. And because the task may take several hours to complete, many readers print the tutorial PDF for reference during or after the task.
  • A tutorial can stand alone or be one part of a multi-part series.

Knowledge paths

  • Knowledge paths are a new type of content on developerWorks, introduced in the spring of 2011 in beta format, and offered with full function in the fall of 2011.
  • Knowledge paths are focused learning guides for IT professionals. They help readers quickly and easily gain the skills that are essential to using IBM products, technologies, and solutions.
  • Each knowledge path is a carefully prescribed sequence of diverse resources, including how-to articles, trial downloads, discussion forums, educational videos, hands-on exercises, and much more. Specifically chosen by subject matter experts like you, the resources guide readers from conceptual awareness to task mastery.
  • Knowledge paths lead the reader to "next steps" in the learning process.
  • A knowledge path can stand alone or be one part of a multi-part series.

Basic steps

Create your content by following these steps:

  1. Download the author package and unzip the file.
  2. Create a folder and XML template for your article, tutorial, or knowledge path using a script from the package.
  3. Edit the XML template to add your content, then validate that XML against the schema and correct any errors.
  4. Preview your content in a browser to get an idea of how it will appear on developerWorks.

Step 1. Download the author package

Download the author-package zip file and place it in a suitable location (for example, C:\ on Windows or your home directory on Linux). Unzip the file.

The developerworks directory does not have to be located in the root directory or even on the Windows C:\ drive. However, the tools assume the location of files within the developerworks directory and its subdirectories, so please keep the developerworks directory structure and file names as is.

If you're using Linux, you should also download an IBM Developer Kit for Java (see Resources for a link), and install it, preferably in /opt/ibm, although you can download a tarball version and install in your home space if you do not have root authority. The validation tools (described in "Using the developerWorks XML validation tools" work only with Java versions that include Xalan (Java version 5.0 includes Xalan 2.7). See that article for more details.

After you unzip the file, you should see a developerworks directory (or folder) containing the following subdirectories:

  • readme—contains a readme.html file. This readme file links to this article you're now reading.
  • schema—contains the schema files. The main schema file is named dw-document-6.0.xsd. (6.0 is the level of the developerWorks schema at the time of this writing.)
  • tools—contains three templates (template-dw-article-6.0.xml, template-dw-knowledge-path-6.0.xml,and template-dw-tutorial-6.0.xml) as well as some simple tools to help you set up and validate a new article. The java subdirectory contains the source of the Java™ programs, which are used with the Linux validation and transformation tool, in case you want to modify or rebuild them.
  • web—contains images and JavaScript needed to preview your content.
  • xsl—contains the stylesheet files used for preview. The primary stylesheet for each developerWorks site is in a subfolder appropriate to that site, for example: 6.0/en_US/dw-document-html-worldwide-6.0.xsl for worldwide (English) or 6.0/ja_JP/dw-document-html-japan-6.0.xsl for Japan.

The files and tools included in the author package are designed for use on 32-bit or 64-bit versions of Linux or Windows (including Windows 7). If you need help with editing the templates using an operating system other than Windows or Linux, please contact your developerWorks editor.


Release notes

Before moving on to Step 2, let's preview what's changed in recent releases.

On May 22, 2012, we made internal updates that do not affect authors. This release does however correct an error in the knowledge path template that was inadvertently introduced in the previous release.

On March 9, 2012, we added support for the new Agile transformation, Business process management, and Mobile development zones.

On November 16 and 28, 2011, we made internal updates that do not affect authors. (The updates improve our handling of rich media and PDFs, and include a new template for landing pages.)

On October 6, 2011, we updated the templates for articles, tutorials, and knowledge paths to include the new rich-media-source element. We also updated some of the comments and samples in the knowledge path template.

On September 1, 2011, we replaced the beta-level support for knowledge paths with full support for authors to create knowledge paths.

On May 27, 2011, we added beta-level support for authors who are creating a new content type, knowledge paths. We also updated internal files for improved maintenance and accessibility across multiple content types; these changes do not affect authors.

On April 21, 2011, we fixed script errors that occur when authors create a new template or transform a template on Windows. This release also includes internal maintenance fixes to the schema, stylesheets, and template that do not affect authors.

On April 18, 2011, we added support for the new IBM i zone.

On January 10, 2011, we added date support for the new calendar year and beyond.

The author-package zip file and this article conform to the 6.0 release. You should prepare your content using the 6.0 schema and stylesheets. If you have used an earlier release of the developerWorks schema and stylesheets, you'll need to download the 6.0 author-package.zip file from the Download section below.

Articles, knowledge paths, and tutorials use the same primary schema (xsd file), but the primary stylesheet varies:

  • Primary schema: dw-document-6.0.xsd
  • Articles, knowledge paths, and tutorials use a stylesheet appropriate to the local site for which the article is being written. For example, 6.0/en_US/dw-document-html-worldwide-6.0.xsl is used for English-language articles for the developerWorks worldwide site, while 6.0/ja_JP/dw-document-html-japan-6.0.xsl is used for the Japanese local site.

Step 2. Create a new template

In this step, you'll set up your own copy of the article, knowledge path, or tutorial template using a tool from the author package. This will create a new file, called index.xml, in a separate directory. It will set up the proper paths and also adjust the template so it works properly in the different operating system environments.

Using Microsoft Windows

In the developerworks directory, double-click new-article.vbs to create an article, new-knowledge-path.vbs to create a knowledge path, or new-tutorial.vbs to create a tutorial. You may choose any valid name as your folder name; the defaults are my-article, my-knowledge-path, and my-tutorial.


Figure 1. Creating and naming a new article on Windows
Screen capture of the dialog that appears when you click new-article.vbs to create and name a new article on Windows

After you click OK, you should see a new folder in the developerworks folder. You may need to refresh your view (View > Refresh) to see it. This new folder contains your template (index.xml) and a validation and transformation script (dw-transform.vbs).

Using Linux

Use the new-article.sh, new-knowledge-path.sh, or new-tutorial.sh shell script in the developerworks directory. (If you're running the KDE or GNOME desktops, you can run this from a graphical manager, such as Nautilus or Konqueror; otherwise, run the script in a terminal window.) You'll see a dialog box where you can enter your new project's name.You can choose any valid name; the defaults are my-article, my-knowledge-path, and my-tutorial.


Figure 2. Creating and naming a new tutorial on Linux
Screen capture of the dialog that appears when you click new-tutorial.sh to create and name a new tutorial on Linux

After you select OK (or press Enter), you should see a new folder within the developerworks folder. This new folder contains your template (index.xml) and a validation and transformation script (dw-transform.sh).

Note: If you are using a graphical environment, you will need the appropriate zenity, gdialog, or kdialog package for your GNOME or KDE desktop. If you are using a non-graphical environment, you will need the dialog package.


Step 3. Edit and validate your XML

You can choose either of two basic methods for editing and validating your XML source.

Using a validating XML editor

Using a validating XML editor to edit and validate your XML helps you identify any errors as you go. Many commercial XML editors are on the market today for both Windows and Linux. Three examples are Rational® Web Developer for WebSphere® Software, <oXygen/>, and Altova XMLSpy (see Resources for links to downloads and documentation). All three provide free downloadable trial versions, and we recommend that you read the instructions that come with these products to learn how to use them. All the required and supporting files you'll need to use these products, or other commercial XML editors, to develop your article or tutorial are in the developerWorks author-package.zip file.

Some free XML editors are also available. Besides the commercial version of XMLSpy mentioned above, Altova has introduced a free Home Edition of XMLSpy. XML Copy Editor is a free editor released under the GNU General Public License. In addition, plug-ins are available for the Eclipse platform that you can use for preparing XML documents. See Resources for links.

When using a validating XML editor or workbench, keep in mind:

  • In the templates that you created with the scripts above, the references to the schema and stylesheet files are relative to your content directory. You may need to change these references to absolute references. For example you may need to change ..\schema\6.0\dw-document-6.0.xsd to something like C:\developerworks\schema\6.0\dw-document-6.0.xsd. You may need to make a corresponding change for the stylesheet, and you will need to change the stylesheet name and location if you want to prepare and article for a local site, such as Japan. In some editors, you may have to specify the location of these files through other configuration means.
  • If you transform your content in an XML editor, and none of your images display, it is likely that the editor has created the HTML file in a directory used for temporary storage. If so, you will need to save the generated HTML file in your article directory (my-article, in our example), and open it either in the XML editor GUI or with a browser.

Using a text editor and validation tools

If you can't find a validating XML editor you like, or prefer not to take the time now to learn how to use one, you can use your preferred text editor to edit the XML template and then use the tools supplied in the author package (dw-transform.vbs for Windows or dw-transform.sh for Linux) to validate your XML and transform it to HTML. You can then preview your HTML in a browser. See the companion article "Using the developerWorks XML validation tools" for details on using these simple tools.


Step 4. Preview your content

You can preview your article, knowledge path, or tutorial to get a general idea of what the final output will look like. However, there will be some differences between the previewed version and the final version. When you preview your tutorial or article, focus on the content and don't worry about the presentation or style issues. We will make necessary modifications when we do the final edit.

If you are using a validating XML editor, check the documentation for instructions on how to transform the XML into an HTML file and then view that file with a browser. Some editors have a browser preview option to simplify this step.

If you are using a text editor and the developerWorks scripts, your output HTML will be created in your article or tutorial folder. Open index.html with a browser. More detailed instructions on using these scripts are in "Using the developerWorks XML validation tools".


Composition tips

New to XML markup?

Like all XML documents, the XML templates in the author package follow these rules:
  • XML tags usually come in a pair: an opening tag and a matching closing tag. For example, <title> and </title> are the opening and closing tags for your article or tutorial title.
  • Your content goes between the opening and closing tags, as in <title>Groovy's growth spurt</title>.
  • An exception to the tag pairs is a self-closing tag such as a line break (<br />) or an image tag (<img />), where a single tag serves as both opening and closing tag; in this case, the tag ends with />.
  • XML tags (the strings between < and >) are case-sensitive and the opening and closing tags must match exactly. <Aacute /> and <aacute /> are two different elements. Most elements that you will use in developerworks articles or tutorials are in lowercase.
  • Comment lines are surrounded with <!-- and -->.

The XML files that you generate in Step 2 are your best source for comprehensive tips on developing your article, knowledge path, or tutorial. Extensive comments in the templates guide you through every aspect of coding your content. Here are some other tips you might find helpful:


Table 1. Special characters
CharacterXML coding
Ampersand (&)&amp; (Always code ampersands as &amp; — even in URLs.)
Apostrophe (')&apos;
Left angle bracket, or less-than sign (<)&lt;
m-dash (—)<mdash />
Quotation mark (")&quot; (In text, use the keyboard quote, but to include a quotation mark in an XML element, use &quot;)
Registered trademark (®)<reg/> (Authors can, but don't need to, insert trademark symbols; the developerWorks editorial staff will take care of trademarks.)
Right angle bracket, or greater-than sign (>)&gt;
Trademark (™)<trade/> (Authors can, but don't need to, insert trademark symbols; the developerWorks editorial staff will take care of trademarks.)

For example, to include angle brackets in a code section:

<TABLE border="0" width="100%">

You would code the following in the XML template:

&lt;TABLE border="0" width="100%"&gt;


Highlighting conventions

Not sure how to highlight code strings? Do you emphasize an article or book title? When should you use no highlighting at all? Table 2 shows the highlighting conventions recommended for developerWorks articles and tutorials.


Table 2. Recommended highlighting
Highlighted elementRecommended highlightingExample of XML coding
"Article title"Quotes"Introduction to Android development"
Book title Emphasis<em>AI Application Programming</em>
Class Inline code<code type="inline">Command</code> class
Code listing Code section<code type="section">
struct my_data_structure {
    int value;
    struct list_head list;
};
</code>
Code string in a sentence Inline code<code type="inline">my_hrtimer_callback</code>
Column or series name EmphasisThe <em>Learn Linux 101</em> series on developerWorks
Command name Inline code<code type="inline">Print</code> command
Dialog or panel nameNo highlightingThe Installation options dialog
Emphasis Strong emphasis. For example: "The maximum code line length is 90 characters."The maximum code line length is <strong>90 characters</strong>.
File nameNo highlightingsample.zip
GUI control Strong emphasis. For example: "Click Options > Preferences."Click <strong>Options</strong> > <strong>Preferences</strong>.
HTML element Inline code<code type="inline">title</code> element
Keyword Inline code<code type="inline">cloud</code> keyword
Macro Inline code<code type="inline">LIST_HEAD</code> macro
Magazine title Emphasis<em>Linux Magazine</em>
Message text or prompt addressed to the user Inline code<code type="inline">The queue was created successfully</code>
Method Inline code<code type="inline">execute()</code> method
Object Inline code<code type="inline">Zend_Service_Amazon_Sqs</code> object
Path nameNo highlightingC:\jdk1.6.0_18
Term defined in context Emphasis<em>timer wheel</em>
"Tutorial title"Quotes"Create modern Web sites using HTML5 and CSS3"
Type (such as int or long) Inline code<code type="inline">int</code> type
URL in textNo highlightingwww.ibm.com/developerworks/
Variable Emphasis<em>your-file</em>
Web site nameNo highlightingThe developerWorks Web site
XML element Inline code<code type="inline">heading</code> element

Submitting your article, knowledge path, or tutorial to developerWorks

Once you've finished your masterpiece, you're ready to send it to your developerWorks editor. Email the XML file for your article, knowledge path, or tutorial (along with any associated graphics or sample code) to your editor. For detailed guidelines and tips on creating and submitting graphics for your article, see "Illustrating your article or tutorial for developerWorks: How to create effective graphics."

If you have any questions or problems, please contact your editor for additional help.



Download

DescriptionNameSizeDownload method
IBM developerWorks author package, V6.0author-package-V6.0_20130301.zip1177KBHTTP

Information about download methods


Resources

Learn

Get products and technologies

  • Microsoft's XML Parser (MSXML) Version 4 or Version 6: To use the dw-transform.vbs script to transform your article or tutorial, you need either version 4 or version 6 of the MSXML parser. The file you need is msxml.msi (version 4) or msxml6.msi (version 6).

  • IBM Developer Kit for Java: To use the dw-transform.sh script on Linux to transform your article or tutorial, you need the IBM Developer Kit for Java, Version 5.0 or later.

  • Rational® Application Developer for WebSphere® Software V7.5: Download a no-charge trial version directly from developerWorks.

  • IBM trial products for download: Build your next development project with IBM trial software, available for download directly from developerWorks.

  • <oXygen/> XML Editor & XSLT Debugger (for multiple platforms) and Altova XMLSpy (for Windows): Learn about or download trial versions of these commercial XML editors.

  • XML Copy Editor: Learn about this fast, free, validating XML editor that can validate and transform your XML files.

  • "XML development with Eclipse" (developerWorks, April 2003): Create XML documents using the Eclipse platform with plug-ins such as Bocaloco Software's XMLBuddy.

  • Evaluate IBM products: Download a product trial, try a product online, use a product in a cloud environment, or spend a few hours in the SOA Sandbox learning how to implement Service Oriented Architecture efficiently.

Discuss

About the authors

Ian Shields developerWorks Contributing author level

Ian Shields works on a multitude of Linux projects for the developerWorks Linux zone. He is a Senior Programmer at IBM at the Research Triangle Park, NC. He joined IBM in Canberra, Australia, as a Systems Engineer in 1973, and has since worked on communications systems and pervasive computing in Montreal, Canada, and RTP, NC. He has several patents. His undergraduate degree is in pure mathematics and philosophy from the Australian National University. He has an M.S. and Ph.D. in computer science from North Carolina State University. You can contact Ian at ishields@us.ibm.com.

author photo - john holtman

John Holtman works on the developerWorks Content and Community team. He leads a group that provides level-one support for community-based applications and maintains the site's authoring and editing tools. Since joining IBM in 1983, he has held a variety of positions, most of which have centered around development, design, and delivery of technical and marketing information in print, online, and interactive media. He holds a degree in Communication Arts from the University of Dayton in Dayton, Ohio.

author photo - Gretchen Moore

As a developerWorks Web editor, Gretchen Moore has shaped developerWorks' editorial style, publication processes, and best practices since she helped launch the site in 1999. She's the Web editor for the Linux zone, and also serves as the tech lead for the Web editors of the technology zones. Her degrees are in Biology from the University of North Carolina in Chapel Hill, NC, and Technical writing from Rensselaer Polytechnic Institute in Troy, NY. For more info, see Gretchen's profile on My developerWorks.

Report abuse help

Report abuse

Thank you. This entry has been flagged for moderator attention.


Report abuse help

Report abuse

Report abuse submission failed. Please try again later.


developerWorks: Sign in


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

Choose your display name

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


Rate this article

Comments

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=XML
ArticleID=90785
ArticleTitle=Authoring with the developerWorks XML templates
publish-date=03012013