OpenSolaris

You are not signed in. Sign in or register.

XML Templates

This page describes editing, validating, and processing an XML Task template with a text editor or with Netbeans.

Send all comments to docs dash discuss at opensolaris dot org.

Editing SolBook XML with XMLmind

An add-on is available which allows the XMLmind XML editor to easily create and edit SolBook XML documents, such as those available on the Documentation Download Page.

Information on how to download and install this can be found here. If this add-on is used within the XMLmind editor, then no additional templates need to be downloaded for XML authoring.

To Edit XML Template With a Text Editor

  1. Download the template files to a common directory.
    Note: You might need to right-click and select Save target As.. . to download this tarball.
  2. Untar the files by running the following command:
    tar xvf template_files.tar

    The the task_template.xml, xinclude.mod, and docbook.dtd files are expanded.
  3. Open the task_template.xml file in your favorite text editor.
  4. Edit the file text or tags.
  5. Save the file.

To Validate and Process the XML Template

  1. Validate the saved XML by running the following command:
    % xmllint --valid --noout task_template.xml
  2. Download the latest XSLT stylesheets for converting DocBook 5 XML documents into HTML (and also into PDF and other formats). Detailed instructions for use are here: http://sagehill.net/docbookxsl/index.html.
  3. Unpack the XSLT files and note down the directory where ..html/docbook.xsl is located:
     gzip -d docbook-xsl-1.70.0.tar.gz
     tar xvf docbook-xsl-1.70.0.tar

    The files are expanded into directories.
  4. Process the XML into HTML by running the following command:
    % xsltproc --nonet --xinclude -o task_template.html docbook/html/docbook.xsl task_template.xml

    Note: Replace the docbook- directory in the above command with the one noted in the previous step.
    The task_template.html file appears in the current directory.

To Edit the XML Task Template With NetBeans

  1. Go to: http://www.netbeans.info/downloads/ and download the IDE.
  2. Go to: http://www.netbeans.org/community/releases/50/install.html for installation instructions specific to your OS and follow them.
  3. Run /netbeans-5.0/bin/netbeans to launch the IDE.
  4. Download the task_template.xml, xinclude.mod, and docbook.dtd from http://opensolaris.org/os/community/documentation/files to a common directory.
    Note: You might need to right-click and select Save target As.. . to download these files.
  5. Select File->Open in the NetBeans GUI and navigate to the task_template.xml.
  6. Edit the file text or tags. To view the list of available tags for a location, just type an open tag '<' and Netbeans will pop-up a window with the complete list.
  7. Select File->Save.
  8. Click the green arrow in the right pane or press Alt+F9 to Check the XML. Output appears in the bottom pane, click underlining to find the error. See To Validate and Process the XML Template below for further instructions.