Majix 1.1
Majix 1.1 is the third release of a Microsoft Word to XML converter written in Java. It corrects some bugs from version 1.0 and provides support for XSL through James Clarck’s XT, while the version 1.0 used the now discontinued MSXSL from Microsoft.
Majix is a converter from Microsoft's Word Rich Text Format (RTF) to XML.
It converts RTF styles and some document characteristics into a XML file conforming to a document type definition DTD. The names of the tags may be changed by the user.
A professional version, Majix Pro, is to be issued in 1999. It will allow more flexibility in defining the mapping process and will support several other input formats in addition to RTF.
You can download Majix 1.1 from TetraSix web site.
What's new ?
In addition to the functionality of Majix 1.0, Majix 1.1 provides:
•	Corrections of some bugs
•	Validate the generated XML document using any SAX-complinat parser
•	Integrated access to XT (James Clark’s implementation of the tree transformation part of XSL)
TetraSix Software License Agreement for Majix
IMPORTANT - READ CAREFULLY: This TetraSix Software License Agreement ("Agreement") is a legal agreement between you (either an individual or a single entity) and TetraSix for TetraSix software product, Majix, which may include associated software components, media, printed materials, and "online" or electronic documentation ("Majix"). By installing, copying or otherwise using Majix, you agree to be bound by the terms of this Agreement. If you do not agree to the terms of this agreement, do not install or use Majix.
Majix is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. Majix is licensed, not sold.
1. GRANT OF LICENSE
Majix is licensed as follows:
•	Installation and Uses. TetraSix grants you the right to install and use copies of Majix on your computers.
•	Backup copies. You may also make copies of Majix as may be necessary for backup and archival purposes.
2. DESCRIPTION OF OTHER RIGHTS AND LIMITATIONS
Maintenance of copyright notices. You must not remove or alter any copyright notices contained in any copy of Majix.
Distribution. You may reproduce and distribute an unlimited number of copies of Majix, provided each copy be a true and complete copy, this includes all copyrights and trademark notices, and that it be accompanied by a copy of this Agreement.
Support. TetraSys provides no support whatsoever for Majix, including, but not limited to, assistance in resolving problems or answering questions during the installation and operation of the software.
Upgrades. TetraSix is not obligated to provide any upgrades whatsoever for Majix, including, but not limited to, enhancements or bug fixes.
Prohibition of Reverse Engineering, Decompilation and Disassembly.
You may not reverse engineer, decompile, or disassemble Majix, except if ,and only to that extent , such activity is expressly permitted by applicable laws notwithstanding this limitation.
Transfer. You may permanently transfer all your rights under this Agreement, provided the recipient agrees to the terms of this Agreement.
Compliance with Applicable Laws. You must comply with all applicable laws regarding use of Majix.
3. TERMINATION
Without prejudice of any other rights, TetraSix may terminate this Agreement if you fail to comply with the terms and conditions of this Agreement. In such event, you must destroy all copies of Majix and render them unrecoverable.
4. COPYRIGHT
All title, including but not limited to copyrights,  in and to Majix and any copies are owned by TetraSix or its suppliers. All title and intellectual property rights in and to the content which may be accessed through use of Majix is the property of the respective content owner and may be protected by applicable copyright or other intellectual property laws and treaties. This Agreement grants you no right to use such content. All rights not expressly granted are reserved by TetraSix.
Majix includes the code of XML parser XP written by James Clark. This parser is covered by its own license agreement that you can find in the file copying_xp.txt.
5. GENERAL
This agreement shall be governed by the laws of the French Republic.
6. NO WARRANTIES
TetraSix expressly disclaims any warranty for Majix. Majix AND ANY RELATED DOCUMENTATION IS PROVIDES "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NONINFRINGEMENT. THE ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF Majix REMAINS WITH YOU.
7. LIMITATION OF LIABILITY
To the maximum extent permitted by applicable law, in no event shall TetraSix or its suppliers be liable for any special, incidental, indirect or consequential damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or any other pecuniary loss) arising out of the use or inability to use Majix, even if TetraSix has been advised of the possibility of such damages. In any case, TetraSix' entire liability under any provision of this Agreement shall be limited to the greater amount actually paid by you for Majix or FFr 50. Because some states and jurisdictions do not allow the exclusion or limitation of liability, the above limitation may not apply to you.
Downloading Majix
You will download Majix code and its documentation from TetraSix’ Web site. http://www.tetrasix.com.
The download is composed of a .zip file which opens into two files and three directories:
•	two batch files for immediate execution of Majix if you have already installed Sun's JRE or Microsoft's jview;
•	a directory classes containing the compiled Java classes as a JAR archive;
•	a directory docs containing the user's documentation;
•	a directory sample containing the documentation of majix in RTF and  the files required to build the XML version of that documentation, as well as the HTML version build using XT.
Majix uses two tools written by James Clark : the XML parser XP and the XSL engine XT. The license of these tools is available in the file copying_xp_xt.txt,  in the directory docs. To minimize the size of the download, only the compiled classes are provided in Majix download file (in the file xp.jar, xt.jar and sax.jar) . You can get the source of XP and XT and their documentation from James Clark's web site http://www.jclark.com/.
Note: 
•	the release of XP provided with Majix is the current version, numbered 0.5.
•	the release of XT provided with Majix is the current version, numbered 19990115. This version of XT implements the WD-xsl-19981216 version of XSL.
Obtaining a Java VM
Majix is a Java application (not an applet). You can run Majix on the Java virtual machine of your choice as long as it supports Java 1.1. and runs Java applications.
Majix will tell you if Java 1.1 is installed on your computer. If you get the message "This application requires Java 1.1 or higher" when you run Majix, please update your Virtual Machine.
Note that the Java Virtual Machine provided with Netscape Communicator can only be used to run applets. Users of that browser will need to obtain another virtual machine, from Sun or Microsoft , for instance.
Where to find a Java Virtual Machine
Sun's Virtual Machine
You can get a free Java virtual Machine from Sun for Solaris and Windows 95/NT. It is called the Java Runtime Interpreter (JRE) and is available from Javasoft's Web site: http://www.javasoft.com/ 
You can use Majix with either Java 1.1.x or Java 1.2.
•	The full URL of Javasoft's JRE download pages are:
http://www.javasoft.com/products/jdk/1.1/jre/index.html, and
•	http://www.javasoft.com/products/jdk/1.2/jre/index.html.
Remember the virtual machine must support Java 1.1 or higher; the JRE 1.0.2 will not do.
Microsoft's Virtual Machine
Microsoft's Java virtual machine supporting Java 1.1 is provided with Internet Explorer 4.0. You can download Internet Explorer 4.0 from http://www.microsoft.com/ie/. Of course, the Java VM provided with internet Explorer 5b2 will also do.
Alternatively, you can get more up-to-date versions of Microsoft's Java virtual machine from  http://www.microsoft.com/Java/.
Remember the virtual machine must support Java 1.1 or higher; the virtual machine provided with Internet Explorer 3 will not do.
Other Java virtual machines
Of course, due to the portability of Java programs, you can run Majix on any other Java virtual machine compliant with Java 1.1 or higher. TetraSix is not able to formally support Majix on any other Java VM than those mentioned above, but we would nevertheless like to hear from you if you have trouble running Majix on other Java VM.
Running Majix
Majix is a Java application (not an applet). You can run it on the virtual machine of your choice as long as it supports Java 1.1. Majix has been tested on Sun's and Microsoft's virtual machines, under Windows 95 and Windows NT.
Interactive execution
Majix is run by executing the main entry point in the Java class com.tetrasix.majixstandard.MajixStandard in the Java archive classes\majix.jar;classes\xp.jar. The following option is available:
•	-language en  or -language fr to change the language of the user's interface;
Running Majix with Sun's Virtual Machine
You can run Majix with the Sun's VM 1.1.x by typing the following command from the installation directory: 
jre -cp classes\majix.jar;classes\xp.jar;classes\xt.jar;classes\sax.jar com.tetrasix.majixstandard.MajixStandard
The installation directory of Majix contains a batch file run_jre.bat which executes this command. You can run it,  for instance , from the explorer.
Running Majix with Microsoft's Virtual Machine
You can run Majix, the XML converter, with Microsoft's VM by typing the following command in the installation directory: 
jview /cp classes\majix.jar;classes\xp.jar;classes\xt.jar;classes\sax.jar com.tetrasix.majixstandard.MajixStandard
The installation directory of Majix contains a batch file majix_jview.bat which executes this command. You can run it for instance from Explorer.
Running Majix with other Virtual Machine
To run Majix on another Java Virtual Machine, please refer to the documentation of that machine.
Finding the configuration file
Majix stores in a configuration file the information pertaining to its access to other tools (see tools) such as a HTML browser to display the documentation. It expects to find the configuration file in the current directory with the name majix.conf. You can specify another directory by setting the system property majix.dir, and the filename by setting the system property majix.conf. For instance, if you want to use a configuration file x:\myowndirectory\mymajix.conf, you will run Majix using Sun's VM with the command:
jre -Dmajix.dir=x:\myowndirectory -Dmajix.conf=mymajix.conf
or, using Microsoft's VM with the command:
jview /Dmajix.dir=x:\myowndirectory /Dmajix.conf=mymajix.conf
Changing the Interface Language
The user's interface of Majix exists in English and in French. By default, the language used is the current language of the system. You can force an other language by using the options
-language language -country country
where language is the code of the language and country is the code of the country. The two languages currently supported are:
•	language en for English language
•	language fr for French language
Examples:
jview /cp classes\majix.jar;classes\xp.jar com.tetrasix.majixstandard.MajixStandard -language en -country US
or, for a french interface
jview /cp classes\majix.jar;classes\xp.jar com.tetrasix.majixstandard.MajixStandard -language fr
Batch execution
The entry point for batch execution is com.tetrasix.majixstandard.MajixBatch. It takes the following options:
com.tetrasix.majixstandard.MajixBatch [ -xp ] [-styles filename ] [-tags filename ] inputfile outputfile
where:
•	-xp indicates that one wants to check the output file using XP
•	-styles filename specifies a file containing a style mapping definition
•	-tags filename specifies a file containing a tag mapping definition
•	inputfile is the name of the input file in format .RTF or .DOC
•	outputfile is the name of the output XML file.
Note: using .DOC file as input file is only supported when:
•	Majix runs under jview
•	Microsoft Word 97 is available
•	that function has been enabled in the configuration file.
The language options are available as in the interactive version.
Examples:
jview /cp classes\majix.jar;classes\xp.jar com.tetrasix.majixbox.MajixBatch -xp foo.rtf foo.xml
Majix process

Majix converts the RTF file into an intermediate format, and then converts this format into XML. 
By default, Majix works with predefined Word styles (see input format) and with predefined XML tags (see output format). The mapping between the Word style names and XML tags uses an Intermediate format. 
Adapt the conversion to your needs
•	The Input format may be changed by adding new Word styles from an existing Word file (see Modify input format).
•	The Intermediate format can not be modified in Majix, while Majix Pro will allow the user to extend or adapt it.
•	The Output format may be changed by associating new XML tags to the intermediate format (see Modify output format).

Majix user interface
To change the user interface's language, use the language option when you run Majix.
To get Help, be sure to indicate the browser you use in the “majix.tool.browser“ entry of the configuration file.
Note: an interactive tool is provided to edit the configuration file (see the section Editing the configuration file)
The main dialog screen of Majix is the following:

The screen contains the following items:
•	a text field to enter the name of the input (.DOC or .RTF) file;
•	a button Find Document to find the input file;
•	a text field to enter the name of the output (XML) file;
•	a status line;
•	a row of several buttons:
•	Convert to launch the converting process
•	Edit Styles to edit the names of the RTF styles
•	Edit Tags to edit the names of the XML tags
•	Tools to run some tools provided with, or accessible from Majix;
•	Help to access the help (when available);
•	About to display the version number and copyright information;
•	Quit to quit the application
Selecting the file to convert
You can select the file to convert by directly typing its path in the first text field or simply by clicking on the button labelled Find Document.
When clicking the Open button of the file dialogue, the text field “Input RTF file” is filled with the name of the chosen file. By default, the name of the output file has the same name as the input file with .XML extension instead of .RTF. You can change the output file name directly by typing in the “Output XML file” text field before performing the conversion
The input field can be a Rich Text Format (RTF) file. If you use Microsoft's Java virtual machine and if you have enabled that functionality, you will also be able to select  Word (DOC) files. When selecting a DOC file, Majix will refer to Word to perform the translation into RTF before performing the conversion into XML.
Performing the conversion
You perform the conversion by clicking on the button Convert of the main screen. That conversion runs mostly by itself. However, if Majix encounters a paragraph style it doesn’t know, it will ask you how to map this style with the following dialogue:

Majix prompts you with the abstract style (Intermediate format) to map with the Word style that Majix doesn’t know by default. When you have chosen the abstract style, click OK to continue Majix process. Or cancel the operation, in which case paragraphs of that style will be considered as normal paragraphs.
When the conversion is completed, the result XML data is written to the selected file and  simultaneously displayed in a window similar to this one:

Three buttons are available:
•	Close to close the window
•	Check syntax to check the syntax using NSGMLS (if enabled) or XP (if NSGMLS is not enabled)
•	Apply XSL to apply an XSL stylesheet using XT to the document.
Majix input format
Majix converts the RTF file into an intermediate format, and then converts this format into XML. The structure of this intermediate format is predetermined in Majix, while Majix Pro will allow the user to extend or adapt it.
We describe below the Word formatting instruction used by Majix by default, and their mapping into Majix intermediate format.
The conversion into this intermediate format is driven by:
•	Word document properties
•	Word styles (such as Heading 1-6, List bullet 1-3, List numbered 1-3, List continue 1-3)
•	typographical enrichments such as bold, italic, underline, font color etc.
•	Word fields, such as pictures, hyperlinks etc.;
•	Word tables.
It is possible to extend the names of the styles Majix can process by modifying input format.
It is possible to customize XML tags generated by Majix by associating XML tags to intermediate format: see modifying XML tag names.
Information block
Word attaches a set of properties to the document (you can view and modify these properties with the File->Properties menu) such as a title, subject, author, manager, company, etc.. By default, Majix extracts these informations and constructs an <info> element in the XML file, just after the first tag of the generated document. This <info> element contains the following sub-elements:
•	name of abstract structure also called intermediate format (<default XML tag>) 
•	title of the document (<title>)
•	subject (<subject>)
•	operator name (<operator>)
•	manager name (<manager>)
•	company name (<company>)
If you don’t want the <info> element to appear in the XML file, you can disable this functionality by clicking on the “Edit tag” button in the main Majix window. Then, choose “Include info block” in the “info element” section of the list. You will see a check box to enable or not the info block.
Sections
A document normally starts with a Document title, identified by default by the style Title;
•	Document title (<ti>)
It contains the various text body elements described below and at most six levels of sections, named as follows:
•	Word style - name of abstract structure also called intermediate format (<default XML tag>) 
•	Heading 1 - Section title, level 1 (<h1>)
•	Heading 2 - Section title, level 2 (<h2>)
•	Heading 3 - Section title, level 3 (<h3>)
•	Heading 4 - Section title, level 4 (<h4>)
•	Heading 5 - Section title, level 5 (<h5>)
•	Heading 6 - Section title, level 6 (<h6>)
All the sections start with a section title:
•	Section title (<ht>)
Word does not have the concept of section, but only of heading. Therefore, a paragraph of style Heading n, where n goes from 1 to 6, will be translated into a section title at the top of a new section of level n. A section of level n will include sections of lower levels (from n+1 to 6) and will be included in sections of higher level (from 1 to n-1). When encountering another heading of the same level, the section will be terminated and a new one started.
For example, a paragraph with “Heading 1” style containing the words “Majix input format” following with a normal paragraph containing the text “Majix input format is ….” will be converted in XML like that:
<H1><HT>Majix input format</HT>
<P>Majix input format is …</P>
</H1>
Body of text
The body of text contains ordinary paragraphs:
•	Name of abstract structure also called intermediate format (<default XML tag>) 
•	Normal - paragraph (<p>)
Styles such as Normal, Body Text, etc. will normally be translated into paragraphs.
Lists
It can contain simple, unordered (bulleted) and ordered (numbered) lists with at most three levels of nesting. The lists are composed of list items that themselves contain paragraphs or nested lists:
•	Word style - Name of abstract structure also called intermediate format (<default XML tag>) 
•	List 1-3 - Simple list (<li>)
•	List ordered 1-3 - Ordered list (<ol>)
•	List bullet 1-3 - Unordered list (<ul>)
•	No Word style - List item (<it>)
•	List Continue 1-3 - Continued list item (<p>)
List item continuation are described in Word using the styles List Continue, List Continue 2 and  List Continue 3. They will be represented in XML by other paragraphs included in the list item element.
Styles in Word are normally represented by styles such as List, List Bullet and List Numbered. Word represents list nesting by using different styles (such as List Bullet 2 and List Bullet 3). Majix generates instead XML recursive structures (a list item can contain another list).
List items cannot directly contain character data, but contain instead paragraphs that themselves contain character data:
<li>
<it><p>first item</p></it>
<it><p>second item</p></it>
</li>
Definition lists
Items of Definition lists are composed of a term and its definition:
•	name of abstract structure also called intermediate format (<default XML tag>) 
•	Definition list (<dl>)
•	Definition list entry (no corresponding tag by default)
•	Defined term (<dt>)
•	Definition (<dd>)
While this structure is rather common, there is no predefined Word style to define it. Majix uses by default the style Definition List to represent that structure, and uses a tabulation to separate the defined term from the definition.
User defined styles
User defined styles may be map to abstract structures named block type 1 to block type 9. Theses structures are user-defined paragraph-like elements. The user will map theses abstract structures to its own XML elements in the tag editor. 
The complete list of user defined styles is:
•	Word style - Name of abstract structure also called intermediate format (<default XML tag>) 
•	User-defined Word style - block type 1 (<b1>)
•	User-defined Word style - block type 2 (<b2>)
•	User-defined Word style - block type 3 (<b3>)
•	User-defined Word style - block type 4 (<b4>)
•	User-defined Word style - block type 5 (<b5>)
•	User-defined Word style - block type 6 (<b6>)
•	User-defined Word style - block type 7 (<b7>)
•	User-defined Word style - block type 8 (<b8>)
•	User-defined Word style - block type 9 (<b9>)
Note: as they are expected to be mapped to user-defined tags, these block elements are not defined in the provided DTD.
The “block type” intermediate format is to be used with user-defined paragraph styles. User-defined character styles may be mapped to inline text elements.
Table elements
Tables are composed of rows, themselves composed of cells:
•	name of abstract style also called intermediate format (<default XML tag>) 
•	table (<table>)
•	table row (<row>)
•	table cell (<cell width=…>)
XML Table are produced from Word tables. In Majix, only regular tables are supported (that is, where each row has the same number of cells). Merged cells are not supported in Majix.
In-line text elements
The concept of “In-line elements” corresponds to character properties and character styles in Word.
Character properties
The following character properties are by default transalated into XML elements:
•	Word character enhancement - Name of intermediate format (<default XML tag>) 
•	bold - bold text (<b>)
•	italic - italic text (<i>)
•	underline - underlined text (<u>)
•	hidden - hidden text (<v>)
Majix predefined characters styles
The character styles Emphasis and Strong are predefined in Word. The following character styles are predefined in Majix. The correspondence between Word style, intermediate Majix format and XML tag name is:
•	Word character style - Name of intermediate format (<default XML tag>) 
•	Emphasis - emphasis (<emph>)
•	Strong - strong (<strong>)
•	Product Name - product name (<prodname>)
•	Trademark - trade mark (<tm>)
•	Jargon - jargon (<jargon>)
•	Keyword - keyword (<kw>)
•	Example inline - in-line example (<ex>)
User defined character styles
You can define your own character styles in Word. The “inline element” intermediate format is provided to map your own character styles to XML elements.
•	Word character style - Name of intermediate format (<default XML tag>) 
•	User-defined Word character style - inline element 1 (<ie1>)
•	User-defined Word character style - inline element 2 (<ie2>)
•	User-defined Word character style - inline element 3 (<ie3>)
•	User-defined Word character style - inline element 4 (<ie4>)
•	User-defined Word character style - inline element 5 (<ie5>)
Note: as they are expected to be mapped to user-defined tags, these block elements are not define in the provided DTD.
The “inline element” intermediate format is to be used with user-defined character styles. User-defined paragraph styles may be mapped to block type elements.

Colors
Each of the sixteen colours supported by Word can be treated by Majix. By default, they are converted in XML by the <c> element with the attribute “color”. You can change the name of the XML tags (see modifying XML tag names.). 
The list of supported colors is:
•	colour Black (<c color="black">)
•	colour Blue (<c color="blue">)
•	colour Aqua (<c color="aqua">)
•	colour Lime (<c color="lime">)
•	colour Fuchsia (<c color="fuchsia">)
•	colour Red (<c color="red">)
•	colour Yellow (<c color="yellow">)
•	colour White (<c color="while">)
•	colour Navy (<c color="navy">)
•	colour Teal (<c color="teal">)
•	colour Green (<c color="green">)
•	colour Purple (<c color="purple">)
•	colour Maroon (<c color="maroon">)
•	colour Olive (<c color="olive">)
•	colour Grey (<c color="gray">)
•	colour Silver (<c color="silver">)
Note: the colour names used are the standard HTML names; the names used by Word are sometimes different.
Pictures
In Word, pictures can be embedded or linked (Insert->Picture->From file with check box “Link to file” checked).
When converting a linked picture, Majix generates by default a <graphic> element with a url attribute containing the file name of the picture.
When converting an embedded picture, Majix also extracts the picture data and produces a WMF (Windows Metafile File) file with the picture data. The name of the picture file is built by adding a numeric suffix to the name of the generated XML file, and prefixing the name by a customizable directory name (the default directory is images).
For instance, let us assume that we convert a file named myreport.doc into XML, using the default output name: myreport.xml. If mydefault.doc contains embedded pictures, they will be extracted in files images\myreport-001.wmf, images\myreport_002.wmf, etc.
Note: WMF is not a common format for raster images on the Web. You are therefore encouraged to use linked images with a more common format such as GIF or JPEG.
Majix intermediate format
The conversion process uses a mapping from the Word styles names and an internal definition. By default, the mapping between Word styles (or characteristics), Majix internal definition and XML tags are summarized in the following table.
Word style or characteristic	Intermediate format	XML tag (output format)	
Document properties	Include info block.	A check box allows you to include info block in the generated XML file or not.	
Document properties	info block:	<info>	
Document properties	title (info):	<title>	
Document properties	subject (info):	<subject>	
Document properties	author (info):	<author>	
Document properties	operator (info):	<operator>	
Document properties	manager(info):	<manager>	
Document properties	company (info):	<company>	
Document title property	document title	<title> (not the same as the document title included in the “info block”)	
Heading 1-6	section level 1-6 and section title	<h1>, <h2>, <h3>, <h4>, <h5> or <h6> element followed by the title <ht>	
Normal	paragraph	<p>	
User defined paragraph styles	block element 1-9	<b1>, <b2>, <b3>, <b4>, <b5>, <b6>, <b7>, <b8> or <b9>	
List simple (not a default Word style, so, you must define it)	simple list item	<list> for the first paragraph and <item> for the following ones	
List bullet	unordered list item	<list style='bullet'> for the first paragraph and <item> for the following ones	
List number	ordered list item	<list style='numeric'> for the first paragraph and <item> for the following ones	
List continue	Continued list item	A new paragraph <p> in the <item> element	
Definition list	Definition list : a definition term, a tabulation and the definition	<dl>
<dt> for the term
<dd> for the definition	
Regular tables	Table	<table>	
Regular tables	Table row	<row>	
Regular tables	Table cell	<cell>	
Regular tables	Cell width attribute name: 	<cell width=”99”>	
Character styles			
Emphasis	Emphasis	<emph>	
Strong	Strong	<strong>	
Product Name	Product Name	<list>	
TradeMark	Trade Mark		
Jargon	Jargon	<jargon	
Keyword	Keyword	<kw>	
Example inline	Example in-line	<item>	
User defined characters styles	Inline element 1-5	<ie1>, <ie2>, <ie3>, <ie4>, <ie5>	
Coloured text	Colour XXX : <c color=’xxx’>	<c color=’the color’>	
Bold characters	bold text:	<b>	
Italic characters	italic text:	<i>	
Underlined characters	underlined text:	<u>	
Hidden characters	hidden text	<v>	
tabulation	Tabulation entity	Not defined by default	
A picture	picture	<graphic name="entity_name">	
	picture entity prefix:	pict It is not used to define a tag but is used as a prefix to build the names of the picture entities and of the system identifier of the picture entities.	
	Pictures directory	images	
Hypertext link	Hyperlink	<link url=”address”>	
Table of contents	Table of contents	<toc>	
Bookmark	Id attribute : id=’...’	<XXX id=’...’>	

Majix output format
Majix convert RTF files into XML files. 
The prologue of the generated XML document is:
<?xml version="1.0"?>
<!DOCTYPE mydoc PUBLIC "-//TetraSix//DTD mydoc v1//EN" "mydoc.dtd" [
]>
If the document contains pictures, the converter generates an entity set declaration with a notation and one entity declaration for each picture, like this (assuming there are three pictures):
<!NOTATION WMF PUBLIC "-/TetraSix/NOTATION Windows Metafile/EN">
<!ENTITY pict001 SYSTEM "pict001.wmf" NDATA WMF>
<!ENTITY pict002 SYSTEM "pict002.wmf" NDATA WMF>
<!ENTITY pict003 SYSTEM "pict003.wmf" NDATA WMF>
Remark: this version of Majix does not extract the picture data from the RTF file.
Majix produces by default XML documents conforming to the following DTD element set:
<!ELEMENT mydoc  (info?, title?, (p|list|table|toc)*, h1*)>

<!ELEMENT info		(title?, subject?, operator?, manager?, company?)>
<!ELEMENT subject   (#PCDATA)>
<!ELEMENT operator  (#PCDATA)>
<!ELEMENT manager   (#PCDATA)>
<!ELEMENT company   (#PCDATA)>

<!ELEMENT title  (#PCDATA|i|u|c)*>
<!ELEMENT h1     (ht, (p|list|table)*, h2*)>
<!ELEMENT h2     (ht, (p|list|table)*, h3*)>
<!ELEMENT h3     (ht, (p|list|table)*, h4*)>
<!ELEMENT h4     (ht, (p|list|table)*, h5*)>
<!ELEMENT h5     (ht, (p|list|table)*, h6*)>
<!ELEMENT h6     (ht, (p|list|table)*)>
<!ELEMENT ht     (#PCDATA|b|i|u|c)*>
<!ELEMENT p      (#PCDATA|b|i|u|c|graphic)*>
<!ELEMENT b      (#PCDATA|i|u|c|graphic)*>
<!ELEMENT i      (#PCDATA|i|u|c|graphic)*>
<!ELEMENT u      (#PCDATA|b|i|c|graphic)*>
<!ELEMENT c      (#PCDATA|b|i|u|graphic)*>
<!ATTLIST c      color
				 CDATA #IMPLIED>
<!ELEMENT list   (item|list)+>
<!ATTLIST list   style (bullet|numeric) #IMPLIED>
<!ELEMENT item   (p*)>
<!ELEMENT graphic EMPTY>
<!ATTLIST graphic name ENTITY #REQUIRED>

<!ELEMENT table   (row+)>
<!ELEMENT row     (cell+)>
<!ELEMENT cell    (p|list)+>

<!ELEMENT toc     EMPTY>

<!ENTITY undef "">
where the use of the various elements is the following:
mydoc	the top-level element
info	a bloc of information concerning the document
subject	the subject of the document
operator	the author's name
manager	the manager's name
company	the company's name
title	the title of the document
h1	a section of level 1
h2	a section of level 2
h3	a section of level 3
h4	a section of level 4
h5	a section of level 5
h6	a section of level 6
ht	the title of a section
p	a text paragraph
list	list of items
item	item of a list
b	text in bold (occurs in paragraphs)
i	text in italic (occurs in paragraphs)
u	text in underline (occurs in paragraphs)
c	text in color (occurs in paragraphs)
graphic	an embedded picture
table	a table
row	a table row
cell	a table cell
It is however possible to change the names of the tags. Of course, if you do so you will also need to change the DTD.
Modify input format
Default process
Remember, Majix converts a RTF file into an XML file. The input format in Majix is composed by the Word styles, character styles and so on (see “Majix input format” for more details). In a conversion, Majix automatically asks you what to do with a style which it doesn’t know.
For example, in your Word file, there is a paragraph containing “145$” with the style “Price”. This style is not recognized by Majix. Majix makes a stop and a dialogue box prompts you the intermediate format to associate with this style. Choose “block type 1”.

As <B1> is the XML tag associated by default with the intermediate format called “block type 1”, Majix will generate the tag <B1>145$</B1> in the XML file.
After that, you can customize the XML generated with your own tag in order to have <PRICE>132</PRICE> (see Modify XML tags).
Importing new styles from a file
The list of the Word styles processed is by default a small set of predefined Word styles, but that list can be changed.
By clicking on the Edit Styles button of the main screen of Majix user interface, one obtains the following dialogue:

This dialog contains:
•	a list of the supported styles. Each line of the list presents the name of the style and its description. The description is the Majix intermediate format.
•	a choice control allowing to select the meaning of the style
•	a row of three buttons:
•	Save to save the definition of the styles into a file.
•	Load to load a previously saved file.
•	Reset to reset the style mapping to its default value.
•	another row of four buttons:
•	Help to show the help documentation;
•	Add from RTF to add to the list the styles defined in a RTF file.
•	Cancel to quit editing the styles while canceling the modifications performed.
•	Close to quit editing the styles while using the modified style list and saving it as the default style list.
You can import styles from a Word file by clicking on the “Add from RTF” button. A dialog box will prompt you the name of the RTF file containing your own predefined styles. This can be your input file.
The conversion process uses a mapping from the style names and an internal definition called Majix intermediate format.
The default style definition file
At startup, Majix load the default style definition file, “default.sty” stored in Majix startup directory. This style keeps track of all the modification you performed in the style editor when you closed the dialog. You can therefore keep your custiomizations from one session of Majix to another. Of course, you can always come back to the initial style mapping by clicking on “reset”.
Modify XML tag names
Majix allows the renaming of tags in the generated XML file. This function is accessed through the “Edit Tags” button of the main window.
It displays the following dialogue:

This dialogue contains the following items:
•	a text field to change the name of the DTD
•	a text field to change the name of the file containing the DTD
•	a list with a mapping between a description of the tags and their names
•	two text fields with respectively the name and attribute of the selected tag
•	a row of three buttons:
•	Help to get help (don’t forget to save default browser in the configuration file).
•	Cancel to quit editing the tag names while canceling the modifications performed.
•	Close to quit editing the tag names while using the modified style list and saving it to the default tag definition file.
For a complete list of Intermediate formats, XML tags and the correspondence with Word styles or Word constructions, see Majix Intermediate Format
Customizable pictures directory
When converting an embedded picture, Majix also extracts the picture data and produces a WMF (Windows Metafile File) file with the picture data. The name of the picture file is built by adding an underscore a numeric suffix to the name of the generated XML file, and prefixing the name by a customizable directory name (the default directory is images).
To customize the directory in which pictures will be saved, open the XML tag editor with the “Edit Tags” button from the Majix main window.
In the list, choose Pictures directory: \images. A text field will appear and allow you to name your own picture directory.
Majix saves the picture as Windows metafiles (.wmf). You can choose the extension generated in the XML file if you plan to convert these files to a more common format such as GIF or jpeg. You can also change the name and the public identifier of the generated graphic entities.
The default tag definition file
At startup, Majix load the default tag definition file, “default.tdef” stored in Majix startup directory. This style keeps track of all the modification you performed in the tag editor when you closed the dialog. You can therefore keep your custiomizations from one session of Majix to another. Of course, you can always come back to the initial style mapping by clicking on “reset”.
Browsing XML documents
Netscape Navigator and Internet Explorer 4.0 are not able to directly display XML documents yet, but it is possible to convert the XML documents into HTML using XT.
Internet Explorer 5beta2 is able to display directly XML documents using either a CSS stylesheet or an XSL stylesheet.
WARNING : the XSL stylesheet standard is still under development. The current version available at the release date of Majix 1.1 is the Working draft of December 1998. XT and IE5b2 implements slightly different versions of XSL, so that is not currently possible to use a single XSl stylesheet with both tools.
Conversion to HTML
The program XT by James Clarck converts XML files into HTML files using a XSL stylesheet.
The Tools button in Majix main dialogue box allows you to launch XT directly.
Notes: The HTML version of Majix documentation has been produced by XT, without any manual modification.
A sample XSL stylesheet
You can find a few simple XSL stylesheets which can be used to display XML documents conforming to the provided DTD : 
•	The stylesheet simple.xsl is used to convert XML documents produced by the conversion process into HTML, using XT;
•	The stylesheet splitter.xsl is used to convert XML documents produced by the splitter process into HTML, using XT;
•	The stylesheet mydoc.xsl is used to display XML documents produced by the conversion process using IE5b2.
There is a point rather delicate when converting XML documents produced by the splitter into HTML. When processing links, the splitter must replace internal URL (line “#foo”) into full URL when the target element is in another chapter. Of course, it uses the path name of the new component, which uses the .xml extension. When converting into HTML, one needs to replace the .xml extension by a .html extension. The current version of XSL does not allow to perform such modifications. We therefore use an extension mechanism provided by XT, which allows us to call Java written “filters” to process the subtree. The non-portable fragment of the stylesheet is the following:
<xsl:template match="link[@url]">
<xsl:filter classid="java:com.tetrasix.majix.tools.URLFilter">
<xsl:arg name="url" value="{@url}"/>
<xsl:apply-templates/>
</xsl:filter>
</xsl:template>
This fragment uses the Java class com.tetrasix.majix.tools.URLFilter which replaces any .xml extension into .html.
The same functionality can be provided in IE5b2 using scripts.
The configuration file

Editing the configuration file
Click on the Tools button in the Majix main dialogue box. In the list displayed in the dialogue box that appears, choose “Editing configuration file”. This allows you to modify main options. The complete list of options is detailed below.

Don’t forget to validate your modifications by clicking on the Validate button.
Options stored in the configuration file
Majix uses a configuration file stored in its installation directory. It simply maps entry keys to values. The keys supported are:
country	country code
language	language code
majix.check.default	“nsgmls” if the document validation is performed using nsgmls, “sax” if it is performed by a SAX parser
majix.dir.doc	path name of the directory containing Majix documentation
majix.enable.doc	"1" if the browsing of Majix documentation is enabled
majix.enable.msword	"1" if MS-Word is available
majix.enable.nsgmls	"1" if nsgmls is available
majix.tool.browser	command used to run the HTML browser (for example: value="explorer" or value="netscape")
majix.tool.browser	name of the browser (e.g. “iexplore”)
majix.tool.nsgmls	path name of nsgmls.exe, if available
majix.tool.nsgmls.catalog	path name of nsgmls catalog file, if available
sax.driver.sax	class name of the SAX driver; for instance “com.ibm.xml.parser.SAXDriver” for IBM’s XML for Java parser (version 1.1), or “com.jclark.xml.sax.CommentDriver” for James Clark’s XP.
xt.stylesheet.default	path name of XSL default stylesheet
The Majix configuration file is a XML file conforming to the following DTD:
<!DOCTYPE configuration [
<!ELEMENT configuration (entry+)>
<!ELEMENT entry EMPTY>
<!ATTLIST entry 
          key  CDATA #REQUIRED
          value CDATA #IMPLIED>
]>
Example of configuration file
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE configuration [
<!ELEMENT configuration (entry+)>
<!ELEMENT entry EMPTY>
<!ATTLIST entry 
          key  CDATA #REQUIRED
          value CDATA #IMPLIED>
]>
<configuration>
<entry key="xt.stylesheet.default" value="C:\majix\userdoc\programs\simple.xsl"/>
<entry key="country" value="US"/>
<entry key="majix.tool.nsgmls" value="c:\sp\bin\nsgmls.exe"/>
<entry key="majix.tool.nsgmls.catalog"
       value="SGML_CATALOG_FILES=c:\sp\pubtext\xml.soc "/>
<entry key="majix.enable.nsgmls" value="1"/>
<entry key="sax.driver.class" value="com.ibm.xml.parser.SAXDriver"/>
<entry key="majix.enable.msword" value="1"/>
<entry key="majix.dir.doc" value="e:\usr\dev\majix-1.1\userdoc\html"/>
<entry key="majix.check.default" value="sax"/>
<entry key="language" value="en"/>
<entry key="majix.enable.doc" value="1"/>
<entry key="majix.tool.browser" value="iexplore"/>
</configuration>

The tools
Majix provides direct access to a set of auxiliary tools. The list of these tools is made available by using the "tools" button in Majix main window. This dialogue box will appear:

The following tools are provided:
•	Editor of the configuration file
•	XML parsing using a SAX compilant parser; the default parsert is XP.
•	XML parsing using nsmls
•	Application of a XSL stylesheet using XT
•	Splitting of an XML file conforming to mydoc.dtd into smaller "pages".
Editor of the configuration file
An interactive tool is provided to edit the configuration file (see the section Editing the configuration file).
XML parsing using a SAX compliant parser
This tool checks a XML file using a SAX compliant parser. The default parser is James Clark’s XML parser written in Java called XP, but you can change the parser by specifying its class in the configuration of Majix (see the Editor of the configuration file). This tool is always available.

XML parsing using nsgmls
This tool checks a XML file using James Clark's XML and SGML parser nsgmls. XML checking using nsgmls is much more thorough than with XP. However, due to its size, nsgmls is not provided with Majix installation. To use nsgmls from Majix, you need to:
•	download SP distribution (which includes nsgmls) from James Clark web site: http://www.jclark.com/.
•	configure Majix using the Editor of the configuration file to enable the use of nsgmls and to tell Majix the path of nsgmls executable and catalog file.

Application of a XSL stylesheet using XT
As described in “Browsing XML documents”, you can transform XML into HTML or XML conforming to another structure using XT, driven by a XSL stylesheet.

Splitting of an XML file
Converting a big Word file into XML provides a big XML file. Applying an XSL stylesheet to that XML file will build a big HTML file, where it is often better to limit the size of individual HTML files destined to be downloaded on the web.
A small tool is provided with Majix which will split a XML file conforming to mydoc.dtd into a set of smaller XML files.
Note: this has been developed to produce the downloadable version of the documentation of Majix, and is not a general-purpose XML splitter.
More precisely, the splitter tool will:
•	extract the sections of level 1 (delimited by tags <h1>) and put them into separate files;
•	build a table of content with the headings of these sections, conforming to the DTD mytoc.dtd
•	apply a XSL stylesheet to the generated XML files
•	apply a XSL stylesheet to the table of content
•	insert the HTML table of content in the generated HTML files.

The sample
As a sample of execution of Majix, we suggest that you regenerate the documentation of Majix from the RTF source file. The RTF source file is converted in XML, then, it is converted in HTML (by the use of XT ). This applies the splitter.xsl style sheet, splits the HTML document in smaller files at level 1 and makes a table of contents.
To this effect:
•	run Majix; by clicking on majix_jview.bat under Windows or by clicking on majix_jre.bat under Sun’s Java virtual machine.
•	in the main window, use button Find Document to select the file majixdoc.rtf in the directory sample;
•	click on the Convert button to launch the conversion process; 
•	the window with the XML result file appears, close it;
•	click on the Tools button to open the ”Tools” window;
•	select the tool "split into pages" and click on the Run button
•	in the splitter tool window, select the XML file (majixdoc.xml in the sample directory) created in the preceding phase;
•	enter mdoc in the second text field (labeled Root XML file). The generated files will start with “mdoc_”.
•	select the XSL stylesheet splitter.xsl in the third text field (labeled XSL File).
•	click the Run button
•	Your default HTML browser will be launched with the Majix documentation displayed.
Comments
Please kindly answer these few questions. This will help us improve Majix to match your needs.

•	Have you encountered problems when installing MajiX?
Yes  -  No
•	Have you encountered problems when installing Java virtual machine?
Yes  -  No
•	You have installed MajiX under
Windows 3.11 (…) Windows 95 (…) Windows 98 (…) UNIX (…) MacOS (…) Other (………………)
•	Did you know XML before using MajiX?
Yes  -  No
•	Do you know XML, now?
Yes  -  No
•	Have you encountered problems when creating RTF files?
Yes  -  No
•	Is MajiX easy to use?
Yes  -  No
•	Have you personalized your XML file?
Yes  -  No
•	What do you think could be done to improve MajiX?

•	Your name, address, company, Email: