XSLT Execution (User View)

Status: Public Review #2 | Changes: available in CVS | Issue: #19439

This document describes user view of XSLT Execution action.

Introduction

Users must cycle between command line where they execute XSLT processor, text editor window with opened XML source or XSLT script and an external browser to see the results. IDE miss even basic XSLT execution support eliminating described tools switching.

Requirements

This requirement will be addressed by Transform action which will take input XML document, XSLT script and will generate output which could be opened in browser.

Invocation

User should be able to invoke Transform action on any XML document. Such action should be available in XML Node Po-pup Menu, as well as in XML Source Editor Pop-up Menu. This action opens dialog with specified transformation inputs and outputs. User should be able to invoke last used transformation action without transformation dialog opening. Such direct transformation could be invoked by shortcut key, e.g. F6.

Inputs

Types of inputs (both accepts URL, e.g. http://somewhere.com/something.xml):

  • XML document - source of data. (If the action is invoked on XML document this field is read-only. User can specify just XSLT document.)
  • XSLT document - transformation script. (If the action is invoked on XSLT document this field is read-only. User can specify just XML document.)

Outputs

Types of outputs:

  • File - XML, text or HTML output file.
  • External browser - transformation preview. No file will be generated, used as preview.

Process output

What to do with output file - this option is available when user selects File as output.

  • Open in external browser. - browse output document with IDE assigned external browser.
  • Apply default action. - perform output document IDE assigned default action, e.g. Open in Source Editor.
  • Do nothing. - Leave output document with no action.

Extensibility

Requirements above describes the simplest use case, i.e. one XML source, one XSLT script, one Output. Current proposal should be enhanced by XSL Executor API which will be introduced after NetBeans 3.4 release and will be included in NetBeans 4.0 release. See enhancement request - #21968.

XSL Executor API will be similar to Java Executor API. Each XML document will have associated XSL Executor instance (XML node's property). Default implementation will be JAXP XSL Executor (current proposal).

FOP support could be realized as another XSL Executor implementation. Cocoon framework uses XML document to describe sequence of transformations. I can imagine Cocoon XSL Executor implementation which will support this Cocoon Map format.

User Interface

Transform dialog is accessible from XML documents as well as from XSLT documents. You can also select more than one of mentioned documents. Following table describes action behavior in specific situations.

XSLT \ XML A) No XML selected B) One XML selected (i.xml) C) Set of XML selected (j.xml, k.xml, l.xml, ...)
1) No XSLT selected Action was invoked from menu and user will specify XML source as well as XSLT script in the dialog. User will specify XSLT script for selected a.xml XML document.
  • User probably wants just use same XSLT script with all selected XML sources. User will specify one XSLT script. [95%]
  • User also could want to transform all selected XML sources with different XSLT scripts in one step. User will specify list of XSLT scripts (for each XML source). [5%] This situation is not supported, use single selection instead.
2) One XSLT selected (s.xsl) User will specify XML source which will be transformed with selected s.xsl XSLT script. User has already selected i.xml XML source and also s.xsl XSLT script. Just output will be specified by user in the dialog. User wants to transform all selected XML sources with same selected s.xsl XSLT script. Just list of output files (for each XML source) will be specified by user in the dialog.
3) Set of XSLTs selected (t.xsl, u.xsl, v.xsl, ...)
  • User probably wants just use all selected XSLT scripts with same XML sources. User will specify one XML source. [99.999%]
  • User also could want to use all selected XSLT scripts to transform different XML sources in one step. User will specify list of XML sources (for each XSLT script). [0.001%] This situation is not supported, use single selection instead.
User wants to transform i.xml XML document with all selected XSLT scripts. Just list of output files (for each XSLT script) will be specified by user in the dialog. Warning! This situation is not supported. Warning dialog will display message: "You have selected 3 XML sources and also 3 XSLT scripts. Not sure, what you want to do. You can select just 0-1, 1-0, 1-1, 1-* or *-1 at once (selected XMLs - selected XSLTs)."

Legend:

  • Different colors signify different behavior: single selection dialog, multiple selection dialog (will be solved in next release), warning dialog.
  • In regular situations bold text describes what kind of files have to user specify in the transform dialog (which are not known from previous selection).
  • In situation the selection is not unambiguous I has written use case estimate in percentage (i.e. 99,999%, 95%, 5%, 0.001% - I estimate nobody wants such behavior).

Invocation



XML Node Pop-up Menu:
XML Source Editor Pop-up Menu:

Transform Dialog (single selection)

This dialog will be displayed in bright green situations, i.e. A1, A2, B1, B2.

XML Source - source of data.
If the action is invoked on XML document, combo box is disabled (read-only) and Browse...1 button is hidden.
Otherwise, if the action is invoked on XSLT document, combo box offers last 5 [PENDING] XML documents processed by appropriate XSLT script. User has also possibility to select new input XML document with Browse...1 button.

XSLT Script - transformation script.
If the action is invoked on XSLT document, combo box is disabled (read-only) and Browse...2 button is hidden.
Otherwise, if the action is invoked on XML document, combo box offers last 3 [PENDING] XSLT scripts used with appropriate XML document and also 5 [PENDING] globally used XSLT scripts. The difference between those two kinds of scripts could be indicated with different icons. User has also possibility to select new XSLT script with Browse...2 button.

Output - file or Preview only.
Meaning is described above. If user select Preview in external browser option then transformation output will be just opened in external browser (no file is generated). Browse...3 button is disabled.
Otherwise, combo box offers last 1 [PENDING] output file generated from current source XML by XSLT script. User has also possibility to select output file with Browse...3 button.

Overwrite Output
Available if Output is any file (not Preview). If output file already exists and Overwrite Output is selected then output file will be automatically overwritten (no question dialog).

Process Output - output file action.
Available if Output is any file (not Preview). Meaning is described above.

Transform Dialog (multiple selection)

Multiple selection will be solved in next release by XSLT Wizard.

Project Features

About this Project

XML was started in November 2009, is owned by dstrupl, and has 58 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20160708.bf2ac18). © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close