jaxp/src/share/classes/javax/xml/transform/overview.html
author ohair
Mon, 14 Apr 2008 14:52:27 -0700
changeset 311 3c14f21bf3f7
parent 6 7f561c08de6b
permissions -rw-r--r--
6484686: The next directory looks like it is no longer part of the build (deploy makefiles) Summary: Getting rid of the _OUTPUTDIR settings. Using BUILD_PARENT_DIRECTORY instead. This solves problems with the "/build/windows-i586*" paths getting mangled on Windows builds (fastdebug builds in particular). Reviewed-by: tbell
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
7f561c08de6b Initial load
duke
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8"?>
7f561c08de6b Initial load
duke
parents:
diff changeset
     2
<!--
7f561c08de6b Initial load
duke
parents:
diff changeset
     3
Copyright 2000-2005 Sun Microsystems, Inc.  All Rights Reserved.
7f561c08de6b Initial load
duke
parents:
diff changeset
     4
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7f561c08de6b Initial load
duke
parents:
diff changeset
     5
7f561c08de6b Initial load
duke
parents:
diff changeset
     6
This code is free software; you can redistribute it and/or modify it
7f561c08de6b Initial load
duke
parents:
diff changeset
     7
under the terms of the GNU General Public License version 2 only, as
7f561c08de6b Initial load
duke
parents:
diff changeset
     8
published by the Free Software Foundation.  Sun designates this
7f561c08de6b Initial load
duke
parents:
diff changeset
     9
particular file as subject to the "Classpath" exception as provided
7f561c08de6b Initial load
duke
parents:
diff changeset
    10
by Sun in the LICENSE file that accompanied this code.
7f561c08de6b Initial load
duke
parents:
diff changeset
    11
7f561c08de6b Initial load
duke
parents:
diff changeset
    12
This code is distributed in the hope that it will be useful, but WITHOUT
7f561c08de6b Initial load
duke
parents:
diff changeset
    13
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
7f561c08de6b Initial load
duke
parents:
diff changeset
    14
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
7f561c08de6b Initial load
duke
parents:
diff changeset
    15
version 2 for more details (a copy is included in the LICENSE file that
7f561c08de6b Initial load
duke
parents:
diff changeset
    16
accompanied this code).
7f561c08de6b Initial load
duke
parents:
diff changeset
    17
7f561c08de6b Initial load
duke
parents:
diff changeset
    18
You should have received a copy of the GNU General Public License version
7f561c08de6b Initial load
duke
parents:
diff changeset
    19
2 along with this work; if not, write to the Free Software Foundation,
7f561c08de6b Initial load
duke
parents:
diff changeset
    20
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
7f561c08de6b Initial load
duke
parents:
diff changeset
    21
7f561c08de6b Initial load
duke
parents:
diff changeset
    22
Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
7f561c08de6b Initial load
duke
parents:
diff changeset
    23
CA 95054 USA or visit www.sun.com if you need additional information or
7f561c08de6b Initial load
duke
parents:
diff changeset
    24
have any questions.
7f561c08de6b Initial load
duke
parents:
diff changeset
    25
-->
7f561c08de6b Initial load
duke
parents:
diff changeset
    26
7f561c08de6b Initial load
duke
parents:
diff changeset
    27
<!DOCTYPE html
7f561c08de6b Initial load
duke
parents:
diff changeset
    28
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
7f561c08de6b Initial load
duke
parents:
diff changeset
    29
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
7f561c08de6b Initial load
duke
parents:
diff changeset
    30
7f561c08de6b Initial load
duke
parents:
diff changeset
    31
<html xmlns="http://www.w3.org/1999/xhtml">
7f561c08de6b Initial load
duke
parents:
diff changeset
    32
7f561c08de6b Initial load
duke
parents:
diff changeset
    33
<head>
7f561c08de6b Initial load
duke
parents:
diff changeset
    34
  <title>Transformation API For XML</title>
7f561c08de6b Initial load
duke
parents:
diff changeset
    35
7f561c08de6b Initial load
duke
parents:
diff changeset
    36
  <meta name="CVS"
7f561c08de6b Initial load
duke
parents:
diff changeset
    37
        content="$Id: overview.html,v 1.2 2005/06/10 03:50:39 jeffsuttor Exp $" />
7f561c08de6b Initial load
duke
parents:
diff changeset
    38
  <meta name="AUTHOR"
7f561c08de6b Initial load
duke
parents:
diff changeset
    39
        content="Jeff.Suttor@Sun.com" />
7f561c08de6b Initial load
duke
parents:
diff changeset
    40
</head>
7f561c08de6b Initial load
duke
parents:
diff changeset
    41
<body> 
7f561c08de6b Initial load
duke
parents:
diff changeset
    42
  
7f561c08de6b Initial load
duke
parents:
diff changeset
    43
<h2>Transformation API For XML</h2> 
7f561c08de6b Initial load
duke
parents:
diff changeset
    44
  
7f561c08de6b Initial load
duke
parents:
diff changeset
    45
  
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
<h3>Introduction</h3> 
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
  
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
<p>This overview describes the set of APIs contained in
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
	 javax.xml.transform. For the sake of brevity, these interfaces are referred to
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
	 as TrAX (Transformations for XML). </p> 
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
  
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
<p>There is a broad need for Java applications to be able to transform XML
7f561c08de6b Initial load
duke
parents:
diff changeset
    53
	 and related tree-shaped data structures. In fact, XML is not normally very
7f561c08de6b Initial load
duke
parents:
diff changeset
    54
	 useful to an application without going through some sort of transformation,
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
	 unless the semantic structure is used directly as data. Almost all XML-related
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
	 applications need to perform transformations. Transformations may be described
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
	 by Java code, Perl code, <A href="http://www.w3.org/TR/xslt">XSLT</A>
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
	 Stylesheets, other types of script, or by proprietary formats. The inputs, one
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
	 or multiple, to a transformation, may be a URL, XML stream, a DOM tree, SAX
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
	 Events, or a proprietary format or data structure. The output types are the
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
	 pretty much the same types as the inputs, but different inputs may need to be
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
	 combined with different outputs.</p> 
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
  
7f561c08de6b Initial load
duke
parents:
diff changeset
    64
<p>The great challenge of a transformation API is how to deal with all the
7f561c08de6b Initial load
duke
parents:
diff changeset
    65
	 possible combinations of inputs and outputs, without becoming specialized for
7f561c08de6b Initial load
duke
parents:
diff changeset
    66
	 any of the given types.</p> 
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
  
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
<p>The Java community will greatly benefit from a common API that will
7f561c08de6b Initial load
duke
parents:
diff changeset
    69
	 allow them to understand and apply a single model, write to consistent
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
	 interfaces, and apply the transformations polymorphically. TrAX attempts to
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
	 define a model that is clean and generic, yet fills general application
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
	 requirements across a wide variety of uses. </p> 
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
   
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
	 
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
<h3>General Terminology</h3> 
7f561c08de6b Initial load
duke
parents:
diff changeset
    76
	 
7f561c08de6b Initial load
duke
parents:
diff changeset
    77
<p>This section will explain some general terminology used in this
7f561c08de6b Initial load
duke
parents:
diff changeset
    78
		document. Technical terminology will be explained in the Model section. In many
7f561c08de6b Initial load
duke
parents:
diff changeset
    79
		cases, the general terminology overlaps with the technical terminology.</p> 
7f561c08de6b Initial load
duke
parents:
diff changeset
    80
	 
7f561c08de6b Initial load
duke
parents:
diff changeset
    81
<ul>
7f561c08de6b Initial load
duke
parents:
diff changeset
    82
<li>
7f561c08de6b Initial load
duke
parents:
diff changeset
    83
<p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    84
<b>Tree</b>
7f561c08de6b Initial load
duke
parents:
diff changeset
    85
<br>This term, as used within this document, describes an
7f561c08de6b Initial load
duke
parents:
diff changeset
    86
			 abstract structure that consists of nodes or events that may be produced by
7f561c08de6b Initial load
duke
parents:
diff changeset
    87
			 XML. A Tree physically may be a DOM tree, a series of well balanced parse
7f561c08de6b Initial load
duke
parents:
diff changeset
    88
			 events (such as those coming from a SAX2 ContentHander), a series of requests
7f561c08de6b Initial load
duke
parents:
diff changeset
    89
			 (the result of which can describe a tree), or a stream of marked-up
7f561c08de6b Initial load
duke
parents:
diff changeset
    90
			 characters.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    91
</li>
7f561c08de6b Initial load
duke
parents:
diff changeset
    92
<li>
7f561c08de6b Initial load
duke
parents:
diff changeset
    93
<p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    94
<b>Source Tree(s)</b>
7f561c08de6b Initial load
duke
parents:
diff changeset
    95
<br>One or more trees that are the inputs to the
7f561c08de6b Initial load
duke
parents:
diff changeset
    96
			 transformation.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
    97
</li>
7f561c08de6b Initial load
duke
parents:
diff changeset
    98
<li>
7f561c08de6b Initial load
duke
parents:
diff changeset
    99
<p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   100
<b>Result Tree(s)</b>
7f561c08de6b Initial load
duke
parents:
diff changeset
   101
<br>One or more trees that are the output of the
7f561c08de6b Initial load
duke
parents:
diff changeset
   102
			 transformation.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   103
</li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   104
<li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   105
<p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   106
<b>Transformation</b>
7f561c08de6b Initial load
duke
parents:
diff changeset
   107
<br>The processor of consuming a stream or tree to produce
7f561c08de6b Initial load
duke
parents:
diff changeset
   108
			 another stream or tree.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   109
</li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   110
<li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   111
<p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   112
<b>Identity (or Copy) Transformation</b>
7f561c08de6b Initial load
duke
parents:
diff changeset
   113
<br>The process of transformation from a source to a result,
7f561c08de6b Initial load
duke
parents:
diff changeset
   114
			 making as few structural changes as possible and no informational changes. The
7f561c08de6b Initial load
duke
parents:
diff changeset
   115
			 term is somewhat loosely used, as the process is really a copy. from one
7f561c08de6b Initial load
duke
parents:
diff changeset
   116
			 "format" (such as a DOM tree, stream, or set of SAX events) to
7f561c08de6b Initial load
duke
parents:
diff changeset
   117
			 another.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   118
</li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   119
<li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   120
<p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   121
<b>Serialization</b>
7f561c08de6b Initial load
duke
parents:
diff changeset
   122
<br>The process of taking a tree and turning it into a stream. In
7f561c08de6b Initial load
duke
parents:
diff changeset
   123
			 some sense, a serialization is a specialized transformation.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   124
</li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   125
<li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   126
<p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   127
<b>Parsing</b>
7f561c08de6b Initial load
duke
parents:
diff changeset
   128
<br>The process of taking a stream and turning it into a tree. In
7f561c08de6b Initial load
duke
parents:
diff changeset
   129
			 some sense, parsing is a specialized transformation.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   130
</li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   131
<li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   132
<p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   133
<b>Transformer</b>
7f561c08de6b Initial load
duke
parents:
diff changeset
   134
<br>A Transformer is the object that executes the transformation.
7f561c08de6b Initial load
duke
parents:
diff changeset
   135
			 </p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   136
</li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   137
<li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   138
<p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   139
<b>Transformation instructions</b>
7f561c08de6b Initial load
duke
parents:
diff changeset
   140
<br>Describes the transformation. A form of code, script, or
7f561c08de6b Initial load
duke
parents:
diff changeset
   141
			 simply a declaration or series of declarations.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   142
</li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   143
<li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   144
<p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   145
<b>Stylesheet</b>
7f561c08de6b Initial load
duke
parents:
diff changeset
   146
<br>The same as "transformation instructions," except it is
7f561c08de6b Initial load
duke
parents:
diff changeset
   147
			 likely to be used in conjunction with <A href="http://www.w3.org/TR/xslt">XSLT</A>.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   148
</li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   149
<li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   150
<p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   151
<b>Templates</b>
7f561c08de6b Initial load
duke
parents:
diff changeset
   152
<br>Another form of "transformation instructions." In the TrAX
7f561c08de6b Initial load
duke
parents:
diff changeset
   153
			 interface, this term is used to describe processed or compiled transformation
7f561c08de6b Initial load
duke
parents:
diff changeset
   154
			 instructions. The Source flows through a Templates object to be formed into the
7f561c08de6b Initial load
duke
parents:
diff changeset
   155
			 Result.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   156
</li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   157
<li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   158
<p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   159
<b>Processor</b>
7f561c08de6b Initial load
duke
parents:
diff changeset
   160
<br>A general term for the thing that may both process the
7f561c08de6b Initial load
duke
parents:
diff changeset
   161
			 transformation instructions, and perform the transformation.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   162
</li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   163
<li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   164
<p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   165
<b>DOM</b>
7f561c08de6b Initial load
duke
parents:
diff changeset
   166
<br>Document Object Model, specifically referring to the
7f561c08de6b Initial load
duke
parents:
diff changeset
   167
			 <A href="#http://www.w3.org/TR/DOM-Level-2%20">Document Object Model
7f561c08de6b Initial load
duke
parents:
diff changeset
   168
			 (DOM) Level 2 Specification</A>.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   169
</li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   170
<li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   171
	<p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   172
		<b>SAX</b><br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   173
		Simple API for XML, specifically referring to the <a href="http://sax.sourceforge.net/">SAX 2.0.2 release</a>.
7f561c08de6b Initial load
duke
parents:
diff changeset
   174
	</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   175
</li>
7f561c08de6b Initial load
duke
parents:
diff changeset
   176
</ul> 
7f561c08de6b Initial load
duke
parents:
diff changeset
   177
   
7f561c08de6b Initial load
duke
parents:
diff changeset
   178
  
7f561c08de6b Initial load
duke
parents:
diff changeset
   179
  
7f561c08de6b Initial load
duke
parents:
diff changeset
   180
<h3>Model</h3> 
7f561c08de6b Initial load
duke
parents:
diff changeset
   181
  
7f561c08de6b Initial load
duke
parents:
diff changeset
   182
<p>The section defines the abstract model for TrAX, apart from the details
7f561c08de6b Initial load
duke
parents:
diff changeset
   183
	 of the interfaces.</p> 
7f561c08de6b Initial load
duke
parents:
diff changeset
   184
  
7f561c08de6b Initial load
duke
parents:
diff changeset
   185
<p>A TRaX <A href="#pattern-TransformerFactory">TransformerFactory</A> is an object
7f561c08de6b Initial load
duke
parents:
diff changeset
   186
	 that processes transformation instructions, and produces
7f561c08de6b Initial load
duke
parents:
diff changeset
   187
	 <A href="#pattern-Templates">Templates</A> (in the technical
7f561c08de6b Initial load
duke
parents:
diff changeset
   188
	 terminology). A <A href="#pattern-Templates">Templates</A>
7f561c08de6b Initial load
duke
parents:
diff changeset
   189
	 object provides a <A href="#pattern-Transformer">Transformer</A>, which transforms one or
7f561c08de6b Initial load
duke
parents:
diff changeset
   190
	 more <A href="#pattern-Source">Source</A>s into one or more
7f561c08de6b Initial load
duke
parents:
diff changeset
   191
	 <A href="#pattern-Result">Result</A>s.</p> 
7f561c08de6b Initial load
duke
parents:
diff changeset
   192
  
7f561c08de6b Initial load
duke
parents:
diff changeset
   193
<p>To use the TRaX interface, you create a
7f561c08de6b Initial load
duke
parents:
diff changeset
   194
	 <A href="#pattern-TransformerFactory">TransformerFactory</A>,
7f561c08de6b Initial load
duke
parents:
diff changeset
   195
	 which may directly provide a <A href="#pattern-Transformers">Transformers</A>, or which can provide
7f561c08de6b Initial load
duke
parents:
diff changeset
   196
	 <A href="#pattern-Templates">Templates</A> from a variety of
7f561c08de6b Initial load
duke
parents:
diff changeset
   197
	 <A href="#pattern-Source">Source</A>s. The
7f561c08de6b Initial load
duke
parents:
diff changeset
   198
	 <A href="#pattern-Templates">Templates</A> object is a processed
7f561c08de6b Initial load
duke
parents:
diff changeset
   199
	 or compiled representation of the transformation instructions, and provides a
7f561c08de6b Initial load
duke
parents:
diff changeset
   200
	 <A href="#pattern-Transformer">Transformer</A>. The
7f561c08de6b Initial load
duke
parents:
diff changeset
   201
	 <A href="#pattern-Transformer">Transformer</A> processes a
7f561c08de6b Initial load
duke
parents:
diff changeset
   202
	 <A href="#pattern-Transformer">Source</A> according to the
7f561c08de6b Initial load
duke
parents:
diff changeset
   203
	 instructions found in the <A href="#pattern-Templates">Templates</A>, and produces a
7f561c08de6b Initial load
duke
parents:
diff changeset
   204
	 <A href="#pattern-Result">Result</A>.</p> 
7f561c08de6b Initial load
duke
parents:
diff changeset
   205
  
7f561c08de6b Initial load
duke
parents:
diff changeset
   206
<p>The process of transformation from a tree, either in the form of an
7f561c08de6b Initial load
duke
parents:
diff changeset
   207
	 object model, or in the form of parse events, into a stream, is known as
7f561c08de6b Initial load
duke
parents:
diff changeset
   208
	 <code>serialization</code>. We believe this is the most suitable term for
7f561c08de6b Initial load
duke
parents:
diff changeset
   209
	 this process, despite the overlap with Java object serialization.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   210
  
7f561c08de6b Initial load
duke
parents:
diff changeset
   211
<H3>TRaX Patterns</H3>
7f561c08de6b Initial load
duke
parents:
diff changeset
   212
<ul>
7f561c08de6b Initial load
duke
parents:
diff changeset
   213
<p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   214
<b><a name="pattern-Processor">Processor</a></b>
7f561c08de6b Initial load
duke
parents:
diff changeset
   215
<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   216
<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   217
<i>Intent: </i>Generic concept for the
7f561c08de6b Initial load
duke
parents:
diff changeset
   218
  set of objects that implement the TrAX interfaces.<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   219
<i>Responsibilities: </i>Create compiled transformation instructions, transform
7f561c08de6b Initial load
duke
parents:
diff changeset
   220
  sources, and manage transformation parameters and
7f561c08de6b Initial load
duke
parents:
diff changeset
   221
  properties.<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   222
<i>Thread safety: </i>Only the Templates object can be
7f561c08de6b Initial load
duke
parents:
diff changeset
   223
  used concurrently in multiple threads. The rest of the processor does not do
7f561c08de6b Initial load
duke
parents:
diff changeset
   224
  synchronized blocking, and so may not be used to perform multiple concurrent
7f561c08de6b Initial load
duke
parents:
diff changeset
   225
  operations. Different Processors can be used concurrently by different
7f561c08de6b Initial load
duke
parents:
diff changeset
   226
  threads.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   227
<p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   228
<b><a name="pattern-TransformerFactory">TransformerFactory</a></b>
7f561c08de6b Initial load
duke
parents:
diff changeset
   229
<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   230
<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   231
<i>Intent: </i>Serve as a vendor-neutral Processor interface for
7f561c08de6b Initial load
duke
parents:
diff changeset
   232
  <A href="http://www.w3.org/TR/xslt">XSLT</A> and similar
7f561c08de6b Initial load
duke
parents:
diff changeset
   233
  processors.<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   234
<i>Responsibilities: </i>Serve as a factory for a concrete
7f561c08de6b Initial load
duke
parents:
diff changeset
   235
  implementation of an TransformerFactory, serve as a direct factory for
7f561c08de6b Initial load
duke
parents:
diff changeset
   236
  Transformer objects, serve as a factory for Templates objects, and manage
7f561c08de6b Initial load
duke
parents:
diff changeset
   237
  processor specific features.<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   238
<i>Thread safety: </i>A
7f561c08de6b Initial load
duke
parents:
diff changeset
   239
  TransformerFactory may not perform mulitple concurrent
7f561c08de6b Initial load
duke
parents:
diff changeset
   240
  operations.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   241
<p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   242
<b><a name="pattern-Templates">Templates</a></b>
7f561c08de6b Initial load
duke
parents:
diff changeset
   243
<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   244
<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   245
<i>Intent: </i>The
7f561c08de6b Initial load
duke
parents:
diff changeset
   246
  runtime representation of the transformation instructions.<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   247
<i>Responsibilities: </i>A data bag for transformation instructions; act as a factory
7f561c08de6b Initial load
duke
parents:
diff changeset
   248
  for Transformers.<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   249
<i>Thread safety: </i>Threadsafe for concurrent
7f561c08de6b Initial load
duke
parents:
diff changeset
   250
  usage over multiple threads once construction is complete.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   251
<p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   252
<b><a name="pattern-Transformer">Transformer</a></b>
7f561c08de6b Initial load
duke
parents:
diff changeset
   253
<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   254
<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   255
<i>Intent: </i>Act as a per-thread
7f561c08de6b Initial load
duke
parents:
diff changeset
   256
  execution context for transformations, act as an interface for performing the
7f561c08de6b Initial load
duke
parents:
diff changeset
   257
  transformation.<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   258
<i>Responsibilities: </i>Perform the
7f561c08de6b Initial load
duke
parents:
diff changeset
   259
  transformation.<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   260
<i>Thread safety: </i>Only one instance per thread
7f561c08de6b Initial load
duke
parents:
diff changeset
   261
  is safe.<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   262
<i>Notes: </i>The Transformer is bound to the Templates
7f561c08de6b Initial load
duke
parents:
diff changeset
   263
  object that created it.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   264
<p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   265
<b><a name="pattern-Source">Source</a></b>
7f561c08de6b Initial load
duke
parents:
diff changeset
   266
<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   267
<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   268
<i>Intent: </i>Serve as a
7f561c08de6b Initial load
duke
parents:
diff changeset
   269
  single vendor-neutral object for multiple types of input.<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   270
<i>Responsibilities: </i>Act as simple data holder for System IDs, DOM nodes, streams,
7f561c08de6b Initial load
duke
parents:
diff changeset
   271
  etc.<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   272
<i>Thread safety: </i>Threadsafe concurrently over multiple
7f561c08de6b Initial load
duke
parents:
diff changeset
   273
  threads for read-only operations; must be synchronized for edit
7f561c08de6b Initial load
duke
parents:
diff changeset
   274
  operations.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   275
<p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   276
<b><a name="pattern-Result">Result</a></b>
7f561c08de6b Initial load
duke
parents:
diff changeset
   277
<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   278
<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   279
<i>Potential alternate name: </i>ResultTarget<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   280
<i>Intent: </i>Serve
7f561c08de6b Initial load
duke
parents:
diff changeset
   281
  as a single object for multiple types of output, so there can be simple process
7f561c08de6b Initial load
duke
parents:
diff changeset
   282
  method signatures.<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   283
<i>Responsibilities: </i>Act as simple data holder for
7f561c08de6b Initial load
duke
parents:
diff changeset
   284
  output stream, DOM node, ContentHandler, etc.<br>
7f561c08de6b Initial load
duke
parents:
diff changeset
   285
<i>Thread safety: </i>Threadsafe concurrently over multiple threads for read-only,
7f561c08de6b Initial load
duke
parents:
diff changeset
   286
  must be synchronized for edit.</p>
7f561c08de6b Initial load
duke
parents:
diff changeset
   287
</ul> 
7f561c08de6b Initial load
duke
parents:
diff changeset
   288
  
7f561c08de6b Initial load
duke
parents:
diff changeset
   289
7f561c08de6b Initial load
duke
parents:
diff changeset
   290
</body>
7f561c08de6b Initial load
duke
parents:
diff changeset
   291
</html>