XML Filter Configuration

OpenOffice.org 1.1 and 1.1.1
OpenOffice.org 2.0

Document - ID	Specification Owner	Last Change	Status
	Matthias Müller-Prove	9/21/04	draft
Conforms to	
Applies to	Installer, Writer, Writer/Web, Calc, Impress, Draw, Master Document, Math
Task ID(s)	OOo later #i27312 – orthogonal handling for all filters #i27325 – enable filter with more than one stylesheet #i27614 – enable filter for all office documents #i27616 – enable debug output for filter deployment #i33361 – enable choose of existing file formats for filters OOo 2.0 #i22865 – MSWord export filter #i28207 – MSSpreadsheet export filter OOo 1.1 #107159 #107291, #107442 – Export-only filters to be displayed in Export dialog #108952 – string change #109780 – new strings
Category	feature

Abstract 1.1.x

The expert user should be able to install XSLT-based input/output filters for OpenOffice.org. The average user should be able to use them seamlessly.

Abstract 2.0

OOo 2.0 supports – additionally to the XHTML output filter of OOo 1.1 – also XHTML output filters for Calc, Draw, and Impress. Furthermore, output filters “Microsoft Word 2003 XML (Writer export)” and “Microsoft Excel 2003 XML (Calc export)” are part of the installation.

i-Team Members for OOo 2.0

	Name	E-mail Address
User Experience	Matthias Müller-Prove /MMP	mprove@sun.com
Development	Svante Schubert /SUS Lars Oppermann /LO	Svante.Schubert@Sun.Com
Quality Assurance	Jörg Sievers /JS	jogi@Sun.COM
Documentation	Frank Peters /FPE	fpe@sun.com

Approved for Implementation for OOo 2.0

	Approved by	Date
User Experience	Matthias Müller-Prove	05/25/04
Development		
Quality Assurance		
Documentation		
String Review		

Feature Team for OOo 1.1.x

Project Owner	Dieter Löschky	Dieter.Loeschky@sun.com
Marketing Contact		
User Experience Contact	Matthias Müller-Prove	mprove@sun.com
Development Contact	Michael Brauer	Michael.Brauer@Sun.COM
	Christian Lippka	Christian.Lippka@Sun.COM
Quality Assurance Contact	Jörg Sievers	jogi@Sun.COM
Documentation Contact	Frank Peters	fpe@sun.com

Document History

Version	Author	Comment
Draft 1/29/03	Michael Brauer	initial version
1/30/03	Matthias Müller-Prove	some UI additions
02/28/03	Michael Brauer	description of test features
2/5/03	Matthias Müller-Prove	UI in progress
2/6/03	MMP	4.2.1 List of XML Filters
2/7/03	MMP	4.3 XML Filter dialog 6.2 Export menu item conflict
2/12/03	MMP	4.0, 4.2.5, 4.2.6 create and install XML filter packages
2/14/03	MMP	modal XML Filter editor dialog, modeless test window (3.2, 4.2.7, 4.3.1)
2/17/03	MMP	4.2 XML Filter Settings dialog: terminology (to be approved by EM) 4.2.5/6 Alerts for package installation
Specification Review 2/20/03	Frank Loehmann	ok
2/24/03	Matthias Müller-Prove	4.3 XML Filter Dialog: new mockups for dialog (v4), string table (#5) for this dialog
2/26/03	MMP	4.4 Testing: first serious proposal for testing window
2/28/03	MMP	XMerge does not require a jar file any longer. (has to be changed in XMerge library) 4.3 XML Editor: A DocType is needed 4.4 Testing: several updates, new string table #6 4.5 File menu, Open , Save /SaveAs and Export dialogs 7 Legal Issues: XMerge and Validation TBD
3/11/03	MMP	4.3 no vendor information for XML Filter 7.1 legal statements on XMerge by MB and Aiden Butler
GUI String Review March 10+11, 2003	Elizabeth Matthis	string changes
Legal Review 3/19/03	Frank Loehmann	ok for section 7.1
3/19/03	MMP	dialog layout changes – due to EM's strings review 4.2.2 default values for new filters 4.3 no vendor/creator information 4.4 Test, Validation & Source Window 4.6 error strings
4/1/03	MMP	4.1 menu spec for backing window state new section 4.3.1 on type detection 7.2 no licensing for Validation
GUI String Review 03/27/03 and 03/28/03	Elizabeth Matthis	String corrections and additional table at end to include CLs strings requested via e-mail
4/4/3	MMP	3.1.3 Java 1.4.1 required
Final 4/7/03	MMP	
4/9/03	MMP	3.1.4 XSLT version 1.0 supported
4/15/03	MMP	String change “Name of file type”(was “Name for on user interface”) for XML Filter Dialog
4/15/03	EM	GUI string review OK
April 30, 2003	EM	In String table 9 corrected “Filter” to “XML-Filter” to match the English
5/7/3	MMP	6.2 register XML file types in the future
5/8/3	MMP	replaced dialog mockups with actual screenshots
5/20/3	MMP	4.6.4 new strings in String Table 10 (just look for “[EM]”)
GUI String Review 5/23/03	Elizabeth Matthis	ok
PP1 & OOo 1.1.1: 09/19/03	MMP	new XSLT filter for Calc: 4.7Setup
OOo 2.0: 04/06/04	Svante Schubert /SUS	additions for OOo2 at section 4.7 Setup Notes SUS-1 to SUS-5 Working on SUS-1
OOo 2.0: 05/17/04	Svante Schubert /SUS	Move of OOo2 tasks to OOo later additions for OOo2 at section 4.7 Setup String Table 2: additions for Math and Master documents
	Svante Schubert /SUS	Notes SUS-6

Contents

1	Motivation	2

2	Goals	2

2.1	Where and how does this feature meet customer requirements	2

2.2	Usage Scenarios	3

2.2.1	XML Filter Developers	3

2.2.2	Administrations	3

2.2.3	End Users	3

2.3	Where and how does this feature improve the program architecture	3

2.4	Where and how does this feature support future developments	3

3	Dependencies and Requirements	4

3.1	Technical Dependencies/Requirements	4

3.1.1	Type Detection	4

3.1.2	Xmerge	4

3.1.3	Java	4

3.1.4	XSLT	4

3.2	Human Effort and/or Financial Requirements	4

4	Detailed Spec	4

4.1	UI Changes for Tools Menu	5

4.2	XML Filter Settings Dialog	5

4.2.1	List of XML Filters	9

4.2.2	Creating a new XML Filter	9

4.2.3	Editing an XML Filter	10

4.2.4	Deleting an XML Filter	10

4.2.5	Creating an XML Filter Package	10

4.2.6	Installing an XML Filter Package	11

4.2.7	Testing an XML Filter	11

4.3	XML Filter Dialog	11

4.3.1	Type Detection	13

4.4	Testing / Debugging	15

4.4.1	Export	17

4.4.2	Import	17

4.4.3	Source Window	18

4.5	File Menu and Filing Dialogs	19

4.6	Error Conditions	19

4.6.1	Creating/Editing an XML Filter	19

4.6.2	Installing an XML Filter Package	19

4.6.3	Testing	20

4.6.4	Regular use	20

4.7	Setup	21

5	Details and Problems of Implementation	22

5.1	XMerge technology	22

6	Future Tasks	22

6.1	Tag the documents	22

6.2	register filetypes according to installed XSLT filters	22

7	Notes	22

7.1	Addressed Issues	23

Glossary

Term	Description
XML	Extensible Markup Language
XSL	Extensible Stylesheet Language
XSLT	Extensible Stylesheet Language Transformation XSLT files are also called XSLT stylesheets

References

XML Filter Kick-Off:

http://staroffice-doc.germany.sun.com:8080/Teams/User_Experience/HCI/Star/Geordi/XMLFilter/index.html

XSL:	http://www.w3.org/Style/XSL/

XSLT: http://www.w3.org/TR/xslt

XMerge: http://xml.openoffice.org/xmerge/

PDF Export:

http://ui.openoffice.org/proposals/PDFExport.sxw

Motivation

Microsoft added a couple of XML features to Office 11, and is promoting them as the main new features of Office 11. Among these features are:

XML file formats for Word and Excel. (not PowerPoint).

The ability to apply XSLT stylesheets to Office 11 XML files while loading and saving.

The ability to merge XML sources into Excel documents.

A new “XML layer” in word: XML tags can be added within the text, and the document that consists of these tags and its content can be validated against an XSD schema.

Beside its XML file format, StarOffice 6.0/OOo 1.0 and Geordi/OOo 1.1 have already the possibility to use XSLT stylesheets as regular document filters, and therefor cover already some of Office 11's new features. However, adding such XSLT based filters requires a manual change of the StarOffice installation. This makes it very difficult to use XSLT stylesheet and to promote this feature to our customers. A User Interface for maintaining XSLT based filters might simplify this.

Goals

Where and how does this feature meet customer requirements

From various groups (OASIS UBL TC, Linux AG, 1dok.org, Danish Ministry of Science) we have been asked for support of other XML schemes than OpenOffice.org XML and for adding user defined XML to OpenOffice.org XML. After the launch at Office 11, the demand for these features will raise. As said above, some of the new Office 11 features can at least partially covered by XSLT based filters.

Packaged XML file formats are already available for all applications already (mentioned for completeness only). XML filters for unpacked XML exist as well, but are not installable using the setup program. Because of its size unpacked full-featured XML files are not considered to be suitable for office suites, regardless whether it is StarOffice or Office 11. Making the unpacked XML filters installable by the setup program is an option, but not covered by this proposal.

XSLT based filters offer exactly the same functionality as Office 11's feature to select an XSLT stylesheet while loading/saving documents. However, making XSLT filters regular document filters that can be used like any other filter however seems to be more consistent with existing office suite user interfaces and office suite user habits and skills.

Calc has a feature to fill the content of table ranges from other documents, including documents loaded using the HTTP protocol. Since all document filters can be used for loading the table range, XSLT based filter can be used here as well. This allows to merge the content of any XML document into the table range.

The same feature is available for text sections in Writer documents.

Office suites in general contain already a lot of structuring features, like headings or lists. Though (user defined) enhancement to this structuring features are requested by our customers, the existing ones could be used and evaluated by XSLT stylesheets to create user defined XML as well. With some limitations, validation of user defined XML is possible as well.

Taking it all together, XSLT based filters open StarOffice to other XML schemes than its own one, as requested by IT departments, but in way where StarOffice users don't have to care of XML. This saves training costs compared to the Office 11 solution to add some XML editor capabilities to office 11.

Moreover, it can be assumed that in general the ROI of using a few standardized XML schemes that might be adopted a little is much higher than the the design of user defined schemes. These schemes take over the role of classical file formats, and therefore should be addressed by document filters rather than as an extension of office documents.

As said above, StarOffice Geordi already supports XSLT based filters. However, to add an XSLT based filter, the XSLT stylesheets have to be added to a jar file, a filter specific XML configuration file has to be created, and StarOffice's TypeDetection.xcu XML configuration has to be modified. Though these steps could be described in the documentation, the hurdle to add an XSLT based filter might be too high that people really do that or even worse, notice that they could do that. At this point, a user interface contained in StarOffice might be helpful. Another reason for including the user interface into StarOffice itself is that even existing XSLT stylesheet might require small adoptions.

However, the new user interface could only help to add a filter to StarOffice if there are XSLT stylesheets for the user defined XML scheme, and to test these transformations. It does not help creating the scheme or the XSLT stylesheet itself. Since even Microsoft thinks that creating a XML scheme requires some skills, it can be assumed that people, that have the skills to create an XML scheme, will have the skills to create an XSLT stylesheet as well.

Usage Scenarios

The three main usage scenarios are described in this section. Different users have a different understanding of what is going on. The final design has to find a balance between the different interests of the users.

XML Filter Developers

It can be assumed that XML Filter developers are experts on XSLT stylesheets and all technical aspects of their problem domain. Typical tasks are to create, test, install, activate, update and remove XML Filters in StarOffice/OpenOffice.org.

Administrations

Administrators need a way to distribute XML filters to their users. They take or receive XML filters from the developers and have to share them with their user base.

End Users

End users don't care. They work according to a given workflow. They do not even need to know if XML format is used on open, save or export commands. The XML Filters blend seamlessly into the type controls of the existing open, save and export dialogs

Where and how does this feature improve the program architecture

XSLT based filter can be added and tested without StarOffice configuration skills. The only skills required are XML skills.

Where and how does this feature support future developments

Sun or others can deliver XSLT based document filters that can be installed and updated easily. Moreover, other companies and individuals are encouraged to so. This is especially of interest since most upcoming file formats, like Office 11 XML and UBL, are XML file formats.

The release and update of XSLT based filters becomes independent of product cycles and does not require specialized setup programs.

Dependencies and Requirements

Technical Dependencies/Requirements

Type Detection

Since “.xml” is a common extension for any XML files, it is likely that several XSLT based filters use this extension. To detect the types of a file with the extension “.xml”, a filter detection for XSLT based filters is required. Otherwise XML files can only be opened by selecting the correct filter in the “File Open” dialog. Independent of this proposal, a filter detection feature is already in progress for StarOffice Geordi (iBis task #106233#).

Xmerge

The XMerge technology needs to be improved to get rid of the requirement to store the XSLT stylesheets in a jar file.

XSLT based filters are currently part of the XMerge project that is implemented in Java. The test features described below require a XSLT engine as well. If they are implemented in C++, the result might be that different XSLT engines are used for testing and in the filters themselves.

Java

The XML filter feature requires Java 1.4.1 JRE or greater.

XSLT

The XML filter feature supports XSL Transformations version 1.0 as specified in http://www.w3.org/TR/xslt.

Human Effort and/or Financial Requirements

To be determined. Most features that are required, like parsing/writing XML files, are available in Java and/or StarOffice API components. Moreover, Geordi's new features to deploy external components might help as well. The main effort therefor will be the enhancement of the XMerge technology and the user interface itself.

Detailed Spec

Entry point for developers and administrators is a dialog in the “Tools” menu. This dialog displays a list of existing XML Filters (short for XSLT based filter), and buttons to add, modify or remove a filter. Additionally, a dialog for testing XML Filters can be opened here.

The developer of an XML Filter can create a package to distribute the filter to her customer. The administrator can install a XML Filter from the packed version either into a local installation of SO/OOo or into a network installation.

UI Changes for Tools Menu

The XML Filter Manager is called by the menu item XML Filter Settings... in the Tools menu. The new order of items is as follows:

Macros (submenu)

XML Filter Settings...

Configure...

Options...

Idea for 6.y

While in backing window state the menu item XML Filter Settings is also visible.

String Table 1

Item	English	German	Comments
menu item	~XML Filter Settings...	~XML-Filtereinstellungen...	new entry in Tools menu
slot info	XML Filter Settings	XML-Filtereinstellungen	slotinfo for new entry in Tools menu

XML Filter Settings Dialog

The main purpose of the XML Filter Settings dialog is to edit a list of XML Filters. It is possible to create new XSLT-based filters, to edit existing XSLT-based filters and to delete them.

The dialog is modeless, i.e. it has no Cancel and OK buttons. It uses a Close button instead.

XML Filter Setting dialog (v7)

String Table 2

Item	English	German	Comments
dialog title	XML Filter Settings	XML-Filtereinstellungen	
grid control heading	Name	Name	column heading for list of XML filters
grid control heading	Type	Art	column heading for list of XML filters
button label	~New...	~Neu...	
button label	~Edit...	~Bearbeiten...	
button label	~Delete...	~Löschen...	
button label	~Test XSLTs...	~XSLTs testen...	
button label	~Save as Package...	~Als Paket sichern...	
button label	~Open Package...	~Paket öffnen...	
button label	~Help	~Hilfe	
button label	~Close	~Schließen	
content of grid control	Writer - import filter	Writer - Importfilter	Developer: Use variable for “Writer -” so it is not translated; list entry in “Type” column
dto.	Writer - export filter	Writer - Exportfilter	list entry in “Type” column
dto.	Writer - import/export filter	Writer - Im-/Exportfilter	list entry in “Type” column
dto.	Writer - undefined filter	Writer - Undefinierter Filter	list entry in “Type” column
content of grid control	Calc - import filter	Calc - Importfilter	Developer: Use variable for “Calc -” so it is not translated; list entry in “Type” column
dto.	Calc - export filter	Calc - Exportfilter	list entry in “Type” column
dto.	Calc - import/export filter	Calc - Im-/Exportfilter	list entry in “Type” column
dto.	Calc - undefined filter	Calc - Undefinierter Filter	list entry in “Type” column
content of grid control	Draw - import filter	Draw - Importfilter	Developer: Use variable for “Draw -” so it is not translated; list entry in “Type” column
dto.	Draw - export filter	Draw - Exportfilter	list entry in “Type” column
dto.	Draw - import/export filter	Draw - Im-/Exportfilter	list entry in “Type” column
dto.	Draw - undefined filter	Draw - Undefinierter Filter	list entry in “Type” column
content of grid control	Impress - import filter	Impress - Importfilter	Developer: Use variable for “Impress -” so it is not translated; list entry in “Type” column
dto.	Impress - export filter	Impress - Exportfilter	list entry in “Type” column
dto.	Impress - import/export filter	Impress - Im-/Exportfilter	list entry in “Type” column
dto.	Impress - undefined filter	Impress - Undefinierter Filter	list entry in “Type” column
content of grid control	Math - import filter	Math - Importfilter	Developer: Use variable for “Math -” so it is not translated; list entry in “Type” column ##(SUS>EM: this is a new strings for OOo later)
dto.	Math - export filter	Math - Exportfilter	list entry in “Type” column ##(SUS>EM: this is a new strings for OOo later)
dto.	Math - import/export filter	Math - Im-/Exportfilter	list entry in “Type” column ##(SUS>EM: this is a new strings for OOo later)
dto.	Math - undefined filter	Math - Undefinierter Filter	list entry in “Type” column ##(SUS>EM: this is a new strings for OOo later)
content of grid control	Writer/Web - import filter	Writer/Web - Importfilter	Developer: Use variable for “Web -” so it is not translated; list entry in “Type” column ##(SUS>EM: this is a new strings for OOo later)
dto.	Writer/Web - export filter	Writer/Web - Exportfilter	list entry in “Type” column ##(SUS>EM: this is a new strings for OOo later)
dto.	Writer/Web - import/export filter	Writer/Web - Im-/Exportfilter	list entry in “Type” column ##(SUS>EM: this is a new strings for OOo later)
dto.	Writer/Web - undefined filter	Writer/Web - Undefinierter Filter	list entry in “Type” column ##(SUS>EM: this is a new strings for OOo later)
content of grid control	Master - import filter	Master - Importfilter	Developer: Use variable for “Master -” so it is not translated; list entry in “Type” column ##(SUS>EM: this is a new strings for OOo later)
dto.	Master - export filter	Master - Exportfilter	list entry in “Type” column ##(SUS>EM: this is a new strings for OOo later)
dto.	Master - import/export filter	Master - Im-/Exportfilter	list entry in “Type” column ##(SUS>EM: this is a new strings for OOo later)
dto.	Master - undefined filter	Master - Undefinierter Filter	list entry in “Type” column ##(SUS>EM: this is a new strings for OOo later)

Open Issues

How to detect conflicts of XML Filters that are registered for the same extension/DTD?

List of XML Filters

The list consists of 2 columns: Name and Type.

The column Name contains the name of the XML Filter.

The column Type contains short information on the application and the import/export capabilities of the filter. Some examples:

Writer import filter

Draw export filter

Calc import/export filter

undefined filter

Undefined filters are not yet specified properly for any import or export operation, i.e. no XSLT stylesheet has been selected.

The list provides for multi-selection.

Idea

Are there other important information that should be displayed in the list of filters? What about the DTD/extention in order to identify type conflicts?

Provide a third column On. It contains a row of check boxes (cf. Writer AutoCorrect/Options dialog). Marking a check box activates the XML Filter, i.e. the filter can be used for importing or exporting files.

Creating a new XML Filter

Pressing the button New... opens the XML Filter dialog. The default name for a new filter is “Untitled Filter”. In order to create unique filter names a number might be added.

The Application value has StarOffice Writer as default.

The Name for the user interface is by default “Untitled”. In order to create unique UI names a number might be added.

The Extension is by default “xml”

String Table 7

Item	English	German	Comments
default filter name	Untitled Filter	Unbenannter Filter	
dto.	Untitled Filter %n	Unbenannter Filter %n	“%n” is replaced by a number
default UI name	Untitled	Unbenannt	
dto.	Untitled %n	Unbenannt %n	“%n” is replaced by a number
default for extension	xml	xml	do not translate

Editing an XML Filter

Selecting an XML Filter from the list and pressing the button Edit... also opens the XML Filter dialog. The user can also perform a double click on the XML Filter in the list. The button is disabled if no XML Filter is selected.

Deleting an XML Filter

Pressing the “delete” button removes the currently selected filter from the configuration. The button is disabled if no XML Filter is selected.

This action needs to be shielded by a warning dialog.(use exclamation mark icon with Yes/No buttons)

If a test window for the to be deleted XML Filter is open this window has to be closed.

String Table 8

Item	English	German	Comments
alert text	Do you really want to delete the XML Filter '%s'? This action cannot be undone.	Wollen Sie wirklich den XML-Filter '%s' löschen? Diese Aktion kann nicht rückgängig gemacht werden.	

Idea

Is it possible to undo a delete? In this case we do not need the alert.

For Q: allow deletion of multiselection.

Creating an XML Filter Package

Pressing the “Save as Package” button creates a zip archive of the currently selected filters that can be used to install the XML Filter into another StarOffice/OpenOffice.org installation using the SO/OOo package tool. The package contains the XSLT stylesheet files for import and/or export, the template (optional) and the configuration data stored in a xcu file. The button is disabled if no XML Filter is selected.

After creating a package a note alert tells the user that the package has been successfully been created.

String Table 3

Item	English	German	Comments
alert text	The XML filter '%s' has been saved as package '%s'.	Der XML-Filter '%s' wurde als Paket '%s' gesichert.	'%s' is the name of the filter; This alert shows up when only one filter was saved.
alert text	%n XML filters have been saved in the package '%s'.	%n XML-Filter wurden in dem Paket '%s' gesichert.	%n is the number of filters; This alert shows up when more than one filter is saved.

Installing an XML Filter Package

Pressing the “Open Package” button opens a File Select dialog to select an XML Filter package. Then the package gets extracted and installed.

A note alert tells the user that the content of the package has successfully been installed. Errors are presented to the user with stop alerts.

The new filters are selected in the list of XML Filters.

String Table 4

Item	English	German	Comments
alert text	The XML filter '%s' has been installed successfully.	Der XML-Filter '%s' wurde erfolgreich installiert.	
alert text	%n XML filters have been installed successfully.	%n XML-Filter wurden erfolgreich installiert.	%n is the number of filters
alert text	No XML filter could be installed because the package '%s' does not contain any XML filters.	Es wurde kein XML-Filter installiert, weil das Paket '%s' keine XML-Filter enthält.	

Note

The way of installing packages in OOo 1.1 would be to copy the archive into <OFFICE_HOME>/shared/uno_packages/ and run pkgchk with a bunch of parameters.

Idea

Drag and drop an XML Filter package to the list of XML filters.

Do we need the notification alerts? Selecting the new filters in the list of XML Filters might provide sufficient feedback.

Testing an XML Filter

If one filter is selected pressing the “Test XSLTs” button opens a modeless test window for the selected filter.

If the user selects another filter B and presses the “Test XSLTs” again the Test dialog works on filter B.

XML Filter Dialog

When pushing the “edit” or “new” buttons in the XML Filter Settings dialog, the XML Filter dialog appears. The window title is “XML Filter: name”, with name being the name of the XML Filter. If a new XML Filter is created the default name is “New Filter”. The dialog is modal.

of XML Filter dialog. Basic tab selected.(v9)

XML Filter dialog. Transformation tab selected.(v10)

The following information needs to be gathered:

The filter name will be displayed in the List of Filters in the XML Filter Settings dialog. It has to be non-empty and unique. If the user deletes the name the former content will be reentered automatically.

The application to be used with the filter (Writer, Calc, Impress, ...).

The interface name will be displayed in the “type” listbox of file dialogs. It has to be non-empty and unique. If the user deletes the name the former content will be reentered automatically.

The extension for files saved with the filter. The extension will be the default extension for new files and will be used to detect the filter to use when loading files without specifying a filter. The extension value has to be non-empty. The default value is “xml”. If the user deletes the name the former content will be reentered automatically.

Comments

The DocType of the XML file.

Optionally, The public/system identifier of the DTD to be used.

If present, both identifiers will be put in the doctype declaration of saved XML files. The public identifier will also be used to detect the filter to use when loading files without specifying a filter.

Whether the filter can be used to save files; if yes, the XSLT stylesheet that should be used for export.

Whether the filter can be used to load files; if yes, the XSLT stylesheet that should be used for import.

Whether a document template should be assigned to filter; if yes, the document template that should be used.

For XSLT based filters, styles are very often used to identify XML tags. These styles on the one hand are used by the export filters to generate certain XML tags, and on the other hand specify how certain tags are displayed on the screen. A document can be used on the one hand to create new documents that contain already the styles used by a certain XSLT based filter, and on the other hand a document template can be loaded by the XSLT based filter before it actually loads the document. This way, style information can be assigned to XML tags without having the style information either in the source document or hard coded in the XSLT stylesheet.

The document template either is already installed in the template path, or it needs to be copied into it.

XSLT Import and Export stylesheets reside externally, i.e. somewhere in the file system.

If the user presses OK in the XML Filter editor the following happens:

create the filter specific configuration file.

Change the TypeDetection.xcu configuration file.

Optionally copy the selected template into the template folder. (TBD)

Type Detection

For user-friendly operation, it is important that StarOffice/OpenOffice.org is able to automatically choose the correct filter whenever the user selects a file which is to be transformed using one of the registered XSLT filter. The built-in filter detection mechanism uses the file extension as the main mechanism, and for XML files it uses the public identifier from the XML DOCTYPE declaration as a backup.

Because the filter extension is the primary mechanism, it's best practice to always associate XSLT filters with a unique file extension.

If use of a generic file extension (like .xml) or an already used file extension can't be avoided, the DOCTYPE mechanism should be used. To do so, the XSLT developer should make sure that the output transformation (if present) generates a suitable DOCTYPE using a public identifier. This public identifier can then be specified in the XML Filter Dialog, causing StarOffice/OpenOffice.org to correctly identify the proper transformation when the user loads an XML file with a suitable DOCTYPE declaration.

String Table 5

Item	English	German	Comments
window title	XML Filter: %s	XML-Filter: %s	%s is the name of the XML Filter; DEVELOPER:The string must include the colon---it cannot be hard-coded!
tab label	General	Allgemein	
tab label	Transformation	Transformation	
text label	Filter name	Filtername	
text label	Application	Anwendung	
text label	Name of file type	Name des Dateityps	The name entered in this list box will appear on the GUI, e.g. under File - Open in filter list box.
text label	Comments	Kommentar	
text label	DTD	DTD	Do Not Translate; this is a w3c term.
text label	File extension	Dateiendung	
text label	DocType	DocType	Do Not Translate; this is a w3c term
text label	XSLT for import	Import-XSLT	
text label	XSLT for export	Export-XSLT	
text label	Template for import	Import-Dokumentvorlage	
button label	Browse...	Auswählen...	
button label	~OK	OK	
button label	~Cancel	Abbrechen	
button label	~Help	Hilfe	
text	New Filter	Neuer Filter	default name for new XML Fitlers
text	.xml	.xml	default extension – do not translate

Dropped Ideas

The New/Edit XML Filter dialog will not be implemented as an AutoPilot/Wizard. XML Filters are created by developers and XML experts. It is a task that requires many turn around cycles. A wizard would slow down this process.

Testing / Debugging

In the XML Settings window the “Test” button opens a modeless dialog that can be used to test the XSLT stylesheets of the selected XML Filter. The dialog is divided into an import and an export filter part. Two alternative layouts are currently being proposed: (TBD, Christian Jansen's input needed)

Export Current Document Transform document Help Test XML Filter: Filter Name Close Browse... export.xslt Import import.xslt Transform file Browse... Recent File (Name of current document) Display source XSLT for export XSLT for import Not specified Template for import (Name of recent file)

mockup of Test dialog (v5)

Export Current Document Transform document Help Test XML Filter: Filter Name Close Browse... export.xslt Import import.xslt Transform file Browse... Recent File (Name of current document) Display source XSLT for export XSLT for import Not specified Template for import (Name of recent file)

design for Test dialog (v1)

Test dialog

Export

The XSLT export transformation of the XML Filter can be tested with the first “Browse...” button. The user has to select a file. The export XSLT stylesheet transform this file and the resulting XML source code is displayed in new window. The window has a “Validate” button to validate the displayed document against a DTD.
The Browse button is disabled if no XSLT stylesheet is specified for exporting.

As a shortcut “Current Document” can be used to apply the XSLT stylesheet to the front most document that matches the XML Filter criteria. The name of the document is displayed right to the button.
The button is disabled if no XSLT stylesheet is specified for exporting or if no SO/OOo document matches the XML Filter type. In this case the space for the current document name is left empty.

Import

To test the XSLT import transformation of the XML Filter, the name of an XML file has to be selected. The “Browse” button of the Import section opens the File Select dialog, starts the transformation of the selected file and displays the result (in the current document window??). If the option “Display Source” is marked the XML source of the document will be displayed in a new window. This window carries a “Validate” button to validate the displayed document against the OpenOffice.org DTD. Editing the XML source is not possible.

The Browse button is disabled if no XSLT stylesheet is specified for importing.

The Display Source check box is marked and disabled, if no template file is specified.

The Recent File button is disabled as long as no file has been selected by the Browse button above. Then the recent used file is stored for easy use “in” this button. The file name is displayed to the right of the button.

Source Window

Layout discussed with Christian Lippka.

The Source window is basically a plain document window, that displays the XML source code. It is divided into a source area and a error message are at the lower quarter of the window. Error messages are displayed in the message area in the form: “Warning in row n: errortext”

(TBD with Christian Jansen: the position of the “Validate” button)

String Table 6

Item	English	German	Comments
window title	Test XML Filter: %s	XML-Filter testen: %s	%s is the name of the XML Filter
static text	Export	Exportieren	
static text	Import	Importieren	
text label	XSLT for import	Import-XSLT	
text label	XSLT for export	Export-XSLT	
text label	Template for import	Import-Dokumentvorlage	
text label	Transform document	Dokument transformieren	
text label	Transform file	Datei transformieren	
button label	~Browse...	~Auswählen...	
button label	B~rowse...	A~uswählen...	
button label	~Current Document	A~ktuelles Dokument	
button label	~Recent File	~Letzte Datei	
check box	~Display source	Quelltext anzeigen	
text label	Not specified	Nicht spezifiziert	
button label	~Close	~Schließen	
button label	~Help	~Hilfe	
title of source window	XML Filter output	XML-Filter-Ausgabe	
button label	~Validate	~Validieren	
error string for message area	Warning in row %n: %s		do not translate, because the error strings cannot be translated either.
dto.	Error in row %n: %s		dto.
dto.	Fatal error in row %n: %s		dto.
dto.	No errors found.		dto.

Idea

add functionality to open (and edit) the XSLT and template files. The following mockup shows a possible layout:

Export Current Document Transform Document Help Test XML Filter: Filter Name Close Browse... export.xslt Import Transform File Browse... Recent File (Name of current document) (Name of recent file) Display Source Export XSLT Open XSLT Open XSLT Import XSLT Import Template Open Template import.xslt import.stw

mockup of Test dialog (v4b)

File Menu and Filing Dialogs

In general, the end user should not edit XML Filters with the XML Filter Settings dialog. Someone else, e.g. the administrator or an experienced user install new XML Filters. For the user the filters show up in the standard Open, Save and Export dialogs. Depending on the type of the XML Filter they are offered in different dialogs.

Import-only XML Filters are listed in the type menu of the Open dialog.

Import/Export XML Filters are listed in the type menus of the Open and Save/SaveAs dialogs

Export-only XML Filters are listed in the type menu of the Export dialog.

The PDF Export Specification has been changed to v.1.1 in order to define an general Export menu item and dialog for all StarOffice/OpenOffice.org applications.

<http://ui.openoffice.org/proposals/PDFExport.sxw>

Error Conditions

Creating/Editing an XML Filter

Filter names have to be unique. If the user closes the XML editor this condition is tested.

Filter UI names have to be unique. If the user closes the XML editor this condition is tested.

Installing an XML Filter Package

The selected package might not contain valid XML Filter data. A stop alert informs the user on this situation.

TBD

Testing

Many errors can occur during testing the XSLTs. The error condition and messages need to be specified.

TBD

String Table 9

Item	English	German	Comments
	An XML filter with the name '%s' already exists. Please enter a different name.	Es existiert bereits ein XML-Filter mit dem Namen '%s'. Bitte geben Sie einen anderen Namen ein.	Error Message
	The name for the user interface '%s1' is already used by the XML filter '%s2'. Please enter a different name.	Der Name für die Benutzeroberfläche '%s1' wird bereits von dem XML-Filter '%s2' verwendet. Bitte geben Sie einen anderen Namen ein.	Error Message
	The DTD could not be found. Please enter a valid path.	Die DTD konnte nicht gefunden werden. Bitte geben Sie einen gültigen Pfad ein.	Error Message
	The XSLT for export could not be found. Please enter a valid path.	Die Export-XSLT konnte nicht gefunden werden. Bitte geben Sie einen gültigen Pfad ein.	Error Message
	The XSLT for import cannot be found. Please enter a valid path.	Die Import-XSLT konnte nicht gefunden werden. Bitte geben Sie einen gültigen Pfad ein.	Error Message
	The given import template cannot be found. Please enter a valid path.	Die angegebene Import-Dokumentvorlage konnte nicht gefunden werden. Bitte geben Sie einen gültigen Pfad ein.	Error Message

Regular use

String Table 10

Item	English	German	Comments
list box	XSLT filter package	XSLT-Filterpaket	string that is shown in the file open/save dialog when a package will be saved or opened inside the type listbox
	XSLT Sample Filters	XSLT-Beispielfilter	Tree entry in custom setup; needed inside the setup to add an entry inside the optional writer components where the user can select if he likes the example xslt filters ( currently docbook and xhtml) to be installed
	DocBook (simplified)	DocBook (vereinfacht)	File name to appear in the file type list box in the Save dialog. This is not a complete DocBook filter however, but rather only as much as we presently support, that is why it says “(simplified)”.
	Microsoft Word 2003 XML	Microsoft Word 2003 XML	File name to appear in the file type list box in the Save dialog.
	Microsoft Excel 2003 XML	Microsoft Excel 2003 XML	File name to appear in the file type list box in the Save dialog.

Setup

The default setup does not install any XSLT Filters. The customized setup installs the “XSLT Sample Filters” module:

DocBook File (Writer import/export)

Microsoft Word 2003 XML (Writer import)

XHTML File (Writer export)

The setup of SO 7 PP1 / OOo 1.1.1 additionally contains

Microsoft Excel 2003 XML (Calc import)

OpenOffice.org 2.0

The setup of OOo2.0 will exchange 'XHTML File (Writer export)' to:

XHTML Calc File (Calc export)

XHTML Draw File (Draw export)

XHTML Impress File (Impress export)

XHTML Writer File (Writer export)

Furthermore, Ooo2.0 will contain:

Microsoft Word 2003 XML (Writer export)

Microsoft Excel 2003 XML (Calc export)

Details and Problems of Implementation

XMerge technology

The implementation of XSLT based filters in OOo 1.0 is is based on the <XMerge> project and requires a jar file that contains the XSLT stylesheet as well as an XML configuration file. This has to be changed for OOo 1.1.

It has to be clarified how StarOffice' configuration management can manage all files for an XML Filter.

Future Tasks

Tag the documents

How does the user assign XML tags to her documents and templates?

register filetypes according to installed XSLT filters

The Setup should offer the option to register “xml” as well as other filetypes for StarOffice/OpenOffice.org. This opens the way for a desktop integration for XML files, i.e. XML files like ExcelML or WordML will open in SO/OOo with a double click in the file system.

Notes

JS-1, 10-Nov-03: Does it make sense to create a 'XML'-area in our Templates-dialog? IMHO yes! If so we should copy the *.stw from DocBook XML sample filter to it otherwise it will be displayed under "Default" are which is from my perspective not a nice place.

SUS-2, 06-Apr-04: If an XSL Transformation fails, the thrown exception can currently only be seen by setting up a line in java.ini/javarc with '-DXSLTransformer.statsfile=<LOGFILEPATH>'. In the test environment of the XML Filter settings would be a 'debug output' tab very helpful for the common user. (#i27616)

SUS-3, 06-Apr-04: It should be specified that all dependent stylesheets will be ex-/imported by the GUI not only the starting stylesheet (e.g. relative links would be resolved). (#i27325)

SUS-4, 06-Apr-04: The exported JAR should be able to be installed in the same way as other filters (e.g. FlatXMLFilter with a pkgchk. DBO stated that the filter need to be deployed under 'uno_packages'. Both deployments by GUI and by pkgchk should result into the same path. (#i27312)

SUS-5, 08-Apr-04: Reference to a spec of creation of import and export filters. Usage of shared stylesheet components for import and export filter as started with XHTML filter. Furthermore the usage of Office flat XML 'templates' for direct use of XSL import filter.

SUS-6, 24-Sep-04: The specification should define how to handle the problem of choosing existing file formats for the text field 'Name of file Type'. In a scenario of adding the same XSLT stylesheet already used by the Writer XHTML export for Calc XHTML export the same file format should be used.
In our case 'XHTML'. When typing 'XHTML' as 'Name of file Type' an exception that the 'User interface XHTML' would already be in use (#i33361).

Addressed Issues

SUS-1, 06-Apr-04: The specification is ambiguous. Not only the main application (Writer, Impress, Draw, Calc), but also Math, Master, Web (as stated by radio buttons on the first page of the spec), should be allowed as input of an XSLT transformation. XSLT uses the same XML file format as input, which has the same spec for all document types. We shouldn't make any restriction for usage (e.g. It makes sense for an Master document to be exported to XHTML by the Office, as for the SDK documentation) (#i27614)

XML Filter Configuration

23

http://ui.openoffice.org/proposals/XMLFilterSpec.sxw

XML Filter Configuration

Matthias Müller-Prove

2003-01-23T16:05:42

Matthias Müller-Prove