Browsing for Messages in your Application Library

Tony Marston - 5th January 2002
amended 10th July 2002

One of the problems I have encountered when using messages from an application library is finding out if the message I want already exists or not, and if it does what is its identification? Unfortunately the UNIFACE form for maintaining messages does not give you the ability to search on the contents of any message text, just the message name or description.

By experimenting with XML and XSL files I have created a facility which provides the following abilities:-

This particular method is a two-stage process:-

When viewed from within a web browser the contents of the XML file can be viewed in a single browser window, and can be searched using the standard Edit/Find commands available from the browser's pulldown menu. This will enable you to include the whole of the message text in your search criteria. Provided that you follow the steps outlined below your browser view should look something like Table 1.

Table 1 - Formatted View of XML file

end of messages
USYSM_9000190001: STORE failed - see Message Frame for more details
USYSM_9000290002: STORE successful
USYSM_9000390003: No changes found - Store not executed
USYSM_9000490004: RETRIEVE failed - invalid key passed from popup
USYSM_9000590005: Nothing selected from popup
USYSM_9000690006: RETRIEVE failed - see Message Frame for more details
USYSM_9000790007: No entries were found matching this profile
USYSM_9000890008: This function has been disabled
USYSM_9000990009: This action is not valid on an empty occurrence
USYSM_9001090010: This is a database occurrence - value cannot be changed
USYSM_9001190011: This is a database occurrence - entry cannot be deleted
USYSM_9001290012: You must CLEAR the screen before attempting a RETRIEVE
USYSM_9001390013: Cannot delete - subordinate entries exist on %%$entname
USYSM_9001490014: STORE failed in form %%$instancename, status = %%$status, entity = %%$entname
USYSM_9001590015: ERASE failed - see Message Frame for more details
USYSM_9001690016: ERASE not allowed
USYSM_9001790017: Erase successful
USYSM_9001890018: Controls released - data available as default for new input
USYSM_9001990019: No help text found for %%$1
USYSM_9002090020: Entry not found

Creating an XML file

The ability to export/import repository objects in XML format was first made available in UNIFACE 7.2.05. To export your application messages to an XML file you must perform the following:-

The contents of the XML file created by this method should look something like the following when viewed in a text editor:-

<?xml version='1.0' ?>
<!-- Created by UNIFACE - (C) Compuware Corporation -->
<UNIFACE release="" xmlengine="1.0">
<USOURCE:UTEXT>90001: STORE failed - see Message Frame for more details</USOURCE:UTEXT>

Viewing an XML file

If you simply double-click on this XML file it is possible for it to appear in your browser, but instead of being formatted as shown in Table 1 it will simply look like the raw XML data but indented and colour coded. In order for the raw XML data to be formatted into a more readable format what you need are two additional files which can be created using the sample code shown below. These files are:-

Contents of MESSAGES.XSL

<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="" version="1.0"

<xsl:template match="/">

    <STYLE type="text/css">
      BODY { margin-left: 5%; margin-right: 5%; }

    <table border="1">

        <tr><th colspan="3">end of messages</th></tr>

      <xsl:apply-templates select="UNIFACE/TABLE/OCC[USOURCE:UVAR]"/>



<xsl:template match="UNIFACE/TABLE/OCC[USOURCE:UVAR]">
     <td><xsl:value-of select="USOURCE:UVAR"/></td>
     <td><xsl:value-of select="USOURCE:ULABEL"/></td>
     <td><xsl:value-of select="USOURCE:UTEXT"/></td>


This basically contains instructions to create an HTML document using data obtained from an XML file. I shall not bother to explain what the individual commands mean as that is better done in an XML/XSL tutorial such as can be found at



<script language="javascript">
// Load XML 
var xml = new ActiveXObject("Microsoft.XMLDOM")
xml.async = false

// Load the XSL
var xsl = new ActiveXObject("Microsoft.XMLDOM")
xsl.async = false

// Transform


When you double-click on MESSAGES.HTML this will activate your browser. This will then transform the contents of MESSAGES.XML into a new document using the instructions in MESSAGES.XSL. This new document should look something like that shown in Table 1. If it does not then you are probably running a version of Internet Explorer with an out-of-date version of the XML Parser. You need at least version 4.0 which can be obtained from Microsoft at The latest release (27 March 2002) is v4.0 SP1. NOTE: this link is now dead, but MSXML6 (dated 7th December 2006) can be obtained from

Tony Marston
5th January 2002

Amendment history:

10th July 2002 Updated for version 4 of the MSXML Parser. This involves changes to MESSAGES.XSL as follows:
  • Changed the XSL namespace clause from
    xmlns:xsl="" to
  • Included a namespace declaration for xmlns:USOURCE="USOURCE.DICT".
  • Inserted basic stylesheet options to set the left and right margins of the HTML output.