xalan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dles...@apache.org
Subject cvs commit: xml-xalan/java/samples/AppletXMLtoHTML get-trax.html spec.xsl trax.xml client.html
Date Fri, 18 Jan 2002 17:59:39 GMT
dleslie     02/01/18 09:59:39

  Modified:    java/samples/AppletXMLtoHTML client.html
  Added:       java/samples/AppletXMLtoHTML get-trax.html spec.xsl trax.xml
  1.Replaced get-todo.html with get-trax.html (i.e.replaced todo.xml/todo.xsl
  with trax.xml/spec.xsl.
  2. Updated applet archive setting in sample applets to point to xalan.jar,
  xml-apis.jar, xercesImpl.jar (for Xerces-J2) and xerces.jar (for Xerces-J1).
  Revision  Changes    Path
  1.4       +3 -2      xml-xalan/java/samples/AppletXMLtoHTML/client.html
  Index: client.html
  RCS file: /home/cvs/xml-xalan/java/samples/AppletXMLtoHTML/client.html,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- client.html	18 Dec 2000 12:57:03 -0000	1.3
  +++ client.html	18 Jan 2002 17:59:39 -0000	1.4
  @@ -107,11 +107,12 @@
       <!-- Be sure you have applet archive attribute set
  -         so the applet can find xalan.jar and xerces.jar -->  
  +         so the applet can find xalan.jar,xml-apis.jar, and xercesImpl.jar (for Xerces-J2)

  +         or xerces.jar (for Xerces-J1)-->  
  -      archive="../../bin/xalan.jar,../../bin/xerces.jar"
  +      archive="../../bin/xalan.jar,../../bin/xml-apis.jar,../../bin/xercesImpl.jar,../../bin/xerces.jar"
         <param name="documentURL" value="xalanApplets.xml"/>  <!--default setting-->
  1.1                  xml-xalan/java/samples/AppletXMLtoHTML/get-trax.html
  Index: get-trax.html
   <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  	<title>Draft of Xalan-Java 2 TrAX Spec</title>
    <script language="JavaScript"> 
      function transform()
        var traxspec = xslControl.getHtmlText();
    <body onLoad="transform();">
    <!-- The applet archive attribute is set to include xalan.jar, xml-apis.jar, and 
         xercesImpl.jar (for Xerces-J2) or xerces.jar (for Xerces-J1). -->
        <param name="documentURL" value="trax.xml"/> 
        <param name="styleURL" value="spec.xsl"/>
  1.1                  xml-xalan/java/samples/AppletXMLtoHTML/spec.xsl
  Index: spec.xsl
  <?xml version="1.0" encoding="ISO-8859-1" ?>
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html" doctype-public="-//W3C//DTD HTML 4.0 Transitional//EN"/>
    <xsl:template match="spec">
            <xsl:value-of select="title"/>
    <xsl:template match="spec/title">
    <xsl:template match="frontmatter">
      <p><b>Edit Date: </b><xsl:value-of select="./pubdate"/></p>
      <p><b>Author: </b>
        <xsl:element name="a">
          <xsl:attribute name="href">
            <xsl:value-of select="concat('mailto:', author/address/email)"/>
          <xsl:value-of select="concat(author/firstname,' ', author/surname, ', ', ./author/orgname)"/>
    <xsl:template match="spec/*/title">
          <xsl:when test="@id">
            <a name="@id">
    <xsl:template name="apply-id-templates">
        <xsl:when test="@id">
          <a name="{@id}">
    <xsl:template match="spec/*/*/title">
        <xsl:call-template name="apply-id-templates"/>
    <xsl:template match="para">
    <xsl:template match="variablelist">
      <xsl:for-each select="varlistentry">
          <p><b><xsl:apply-templates select="term"/></b><br/>
          <xsl:apply-templates select="listitem"/></p>
    <xsl:template match="orderedlist">
      <xsl:for-each select="listitem">
    <xsl:template match="patterns">
      <h2><xsl:value-of select="@module"/><xsl:text> </xsl:text>Patterns</h2>
        <xsl:for-each select="pattern">
              <xsl:for-each select="pattern-name">
                <xsl:call-template name="apply-id-templates"/>
          <xsl:apply-templates select="*[name() != 'pattern-name']"/></p>
    <xsl:template match="pattern/intent">
      <br/><i>Intent: </i><xsl:apply-templates/>
    <xsl:template match="pattern/responsibilities">
      <br/><i>Responsibilities: </i><xsl:apply-templates/>
    <xsl:template match="pattern/potential-alternate-name">
      <br/><i>Potential alternate name: </i><xsl:apply-templates/>
    <xsl:template match="pattern/thread-safety">
      <br/><i>Thread safety: </i><xsl:apply-templates/>
    <xsl:template match="pattern/notes">
      <br/><i>Notes: </i><xsl:apply-templates/>
    <xsl:template match="programlisting">
    <xsl:template match="link">
      <A href="#{@linkend}">
    <xsl:template match="ulink">
      <A href="{@url}">
    <xsl:template match="termref">
        <xsl:when test="@link-url">
          <A href="#{@link-url}">
            <xsl:value-of select="."/>
          <U><xsl:value-of select="."/></U>
  1.1                  xml-xalan/java/samples/AppletXMLtoHTML/trax.xml
  Index: trax.xml
  <?xml version="1.0"?>
    <title>Transformation API For XML (TrAX)</title>
    <pubdate>November 12, 2000</pubdate> 
           <orgname>IBM Research</orgname> 
    <para>This overview describes the set of APIs contained in
           <ulink url="http://xml.apache.org/xalan-j/apidocs/javax/xml/transform/package-summary.html">javax.xml.transform</ulink>,
<ulink url="http://xml.apache.org/xalan-j/apidocs/javax/xml/transform/stream/package-summary.html">javax.xml.transform.stream</ulink>,
<ulink url="http://xml.apache.org/xalan-j/apidocs/javax/xml/transform/dom/package-summary.html">javax.xml.transform.dom</ulink>,
and <ulink url="http://xml.apache.org/xalan-j/apidocs/javax/xml/transform/sax/package-summary.html">javax.xml.transform.sax</ulink>.
For the sake of brevity, these interfaces are referred to
           as TrAX (Transformation API for XML). </para> 
    <para>There is a broad need for Java applications to be able to transform XML
           and related tree-shaped data structures. In fact, XML is not normally very
           useful to an application without going through some sort of transformation,
           unless the semantic structure is used directly as data. Almost all XML-related
           applications need to perform transformations. Transformations may be described
           by Java code, Perl code, <ulink url="http://www.w3.org/TR/xslt">XSLT</ulink>
           Stylesheets, other types of script, or by proprietary formats. The inputs, one
           or multiple, to a transformation, may be a URL, XML stream, a DOM tree, SAX
           Events, or a proprietary format or data structure. The output types are the
           pretty much the same types as the inputs, but different inputs may need to be
           combined with different outputs.</para> 
    <para>The great challenge of a transformation API is how to deal with all the
           possible combinations of inputs and outputs, without becoming specialized for
           any of the given types.</para> 
    <para>The Java community will greatly benefit from a common API that will
           allow them to understand and apply a single model, write to consistent
           interfaces, and apply the transformations polymorphically. TrAX attempts to
           define a model that is clean and generic, yet fills general application
           requirements across a wide variety of uses. </para> 
           <title>General Terminology</title> 
           <para>This section will explain some general terminology used in this
                  document. Technical terminology will be explained in the Model section.
In many
                  cases, the general terminology overlaps with the technical terminology.</para>

                    <listitem>This term, as used within this document, describes an
                           abstract structure that consists of nodes or events that may be
produced by
                           XML. A Tree physically may be a DOM tree, a series of well balanced
                           events (such as those coming from a SAX2 ContentHander), a series
of requests
                           (the result of which can describe a tree), or a stream of marked-up
                    <term>Source Tree(s)</term> 
                    <listitem>One or more trees that are the inputs to the
                    <term>Result Tree(s)</term> 
                    <listitem>One or more trees that are the output of the
                    <listitem>The process of consuming a stream or tree to produce
                           another stream or tree.</listitem> 
                    <term>Identity (or Copy) Transformation</term> 
                    <listitem>The process of transformation from a source to a result,
                           making as few structural changes as possible and no informational
changes. The
                           term is somewhat loosely used, as the process is really a copy.
from one
                           "format" (such as a DOM tree, stream, or set of SAX events) to
                    <listitem>The process of taking a tree and turning it into a stream.
                           some sense, a serialization is a specialized transformation.</listitem>

                    <listitem>The process of taking a stream and turning it into a tree.
                           some sense, parsing is a specialized transformation.</listitem>

                    <listitem>A Transformer is the object that executes the transformation.
                    <term>Transformation instructions</term> 
                    <listitem>Describes the transformation. A form of code, script,
                           simply a declaration or series of declarations.</listitem>

                    <listitem>The same as "transformation instructions," except it is
                           likely to be used in conjunction with <ulink

                    <listitem>Another form of "transformation instructions." In the
                           interface, this term is used to describe processed or compiled
                           instructions. The Source flows through a Templates object to be
formed into the
                    <listitem>A general term for the thing that may both process the
                           transformation instructions, and perform the transformation.</listitem>

                    <listitem>Document Object Model, specifically referring to the
                           <termref link-url="http://www.w3.org/TR/DOM-Level-2 ">Document
Object Model
                           (DOM) Level 2 Specification</termref>.</listitem> 
                    <listitem>Simple API for XML, specifically referring to the
                           <termref link-url="http://www.megginson.com/SAX/SAX2">SAX
    <para>The following requirements have been determined from broad experience
           with XML projects from the various members participating on the JCP.</para>

           <listitem id="requirement-simple">TrAX must provide a clean, simple
                  interface for simple uses.</listitem> 
           <listitem id="requirement-general">TrAX must be powerful enough to be
                  applied to a wide range of uses, such as, e-commerce, content management,
                  server content delivery, and client applications.</listitem> 
           <listitem id="requirement-optimizeable">A processor that implements a TrAX
                  interface must be optimizeable. Performance is a critical issue for most
                  transformation use cases.</listitem> 
           <listitem id="requirement-compiled-model">As a specialization of the above
                  requirement, a TrAX processor must be able to support a compiled model,
so that
                  a single set of transformation instructions can be compiled, optimized,
                  applied to a large set of input sources.</listitem> 
           <listitem id="requirement-independence">TrAX must not be dependent an any
                  given type of transformation instructions. For instance, it must remain
                  independent of <ulink url="http://www.w3.org/TR/xslt">XSLT</ulink>.</listitem>

           <listitem id="requirement-from-dom">TrAX must be able to allow processors
                  to transform DOM trees.</listitem> 
           <listitem id="requirement-to-dom">TrAX must be able to allow processors to
                  produce DOM trees.</listitem> 
           <listitem id="requirement-from-sax">TrAX must allow processors to transform
                  SAX events.</listitem> 
           <listitem id="requirement-to-sax">TrAX must allow processors to produce SAX
           <listitem id="requirement-from-stream">TrAX must allow processors to
                  transform streams of XML.</listitem> 
           <listitem id="requirement-to-stream">TrAX must allow processors to produce
                  XML, HTML, and other types of streams.</listitem> 
           <listitem id="requirement-combo-input-output">TrAX must allow processors
                  implement the various combinations of inputs and outputs within a single
           <listitem id="requirement-limited-input-output">TrAX must allow processors
                  to implement only a limited set of inputs. For instance, it should be possible
                  to write a processor that implements the TrAX interfaces and that only
                  processes DOM trees, not streams or SAX events.</listitem> 
           <listitem id="requirement-proprietary-data-structures">TrAX should allow
                  processor to implement transformations of proprietary data structures. For
                  instance, it should be possible to implement a processor that provides TrAX
                  interfaces that performs transformation of JDOM trees.</listitem>

           <listitem id="requirement-serialization-props">TrAX must allow the setting
                  of serialization properties, without constraint as to what the details of
                  properties are.</listitem> 
           <listitem id="requirement-setting-parameters">TrAX must allow the setting
                  of parameters to the transformation instructions.</listitem> 
           <listitem id="requirement-namespaced-properties">TrAX must support the
                  setting of parameters and properties as XML Namespaced items (i.e., qualified
           <listitem id="requirement-relative-url-resolution">TrAX must support URL
                  resolution from within the transformation, and have it return the needed
           <listitem id="requirement-error-reporting">TrAX must have a mechanism for
                  reporting errors and warnings to the calling application.</listitem>

    </orderedlist> </requirements> 
    <para>The section defines the abstract model for TrAX, apart from the details
           of the interfaces.</para> 
    <para>A TRaX <termref
           link-url="pattern-TransformerFactory">TransformerFactory</termref> is
an object
           that processes transformation instructions, and produces
           <termref link-url="pattern-Templates">Templates</termref> (in the technical
           terminology). A <termref link-url="pattern-Templates">Templates</termref>
           object provides a <termref
           link-url="pattern-Transformer">Transformer</termref>, which transforms
one or
           more <termref link-url="pattern-Source">Source</termref>s into one
or more
           <termref link-url="pattern-Result">Result</termref>s.</para>

    <para>To use the TRaX interface, you create a
           <termref link-url="pattern-TransformerFactory">TransformerFactory</termref>,
           which may directly provide a <termref
           link-url="pattern-Transformers">Transformers</termref>, or which can provide
           <termref link-url="pattern-Templates">Templates</termref> from a variety
           <termref link-url="pattern-Source">Source</termref>s. The
           <termref link-url="pattern-Templates">Templates</termref> object is
a processed
           or compiled representation of the transformation instructions, and provides a
           <termref link-url="pattern-Transformer">Transformer</termref>. The
           <termref link-url="pattern-Transformer">Transformer</termref> processes
           <termref link-url="pattern-Transformer">Source</termref> according
to the
           instructions found in the <termref
           link-url="pattern-Templates">Templates</termref>, and produces a
           <termref link-url="pattern-Result">Result</termref>.</para> 
    <para>The process of transformation from a tree, either in the form of an
           object model, or in the form of parse events, into a stream, is known as
           <termref>serialization</termref>. We believe this is the most suitable
term for
           this process, despite the overlap with Java object serialization.</para>

    <patterns module="TRaX"> <pattern><pattern-name
    id="pattern-Processor">Processor</pattern-name><intent>Generic concept
for the
    set of objects that implement the TrAX interfaces.</intent>
    <responsibilities>Create compiled transformation instructions, transform
    sources, and manage transformation parameters and
    properties.</responsibilities><thread-safety>Only the Templates object can
    used concurrently in multiple threads. The rest of the processor does not do
    synchronized blocking, and so may not be used to perform multiple concurrent
    <pattern-name id="pattern-TransformerFactory">TransformerFactory</pattern-name>
    <intent>Serve as a vendor-neutral Processor interface for
    <ulink url="http://www.w3.org/TR/xslt">XSLT</ulink> and similar
    processors.</intent> <responsibilities>Serve as a factory for a concrete
    implementation of an TransformerFactory, serve as a direct factory for
    Transformer objects, serve as a factory for Templates objects, and manage
    processor specific features.</responsibilities> <thread-safety>A
    TransformerFactory may not perform mulitple concurrent
    operations.</thread-safety> </pattern> <pattern> 
    <pattern-name id="pattern-Templates">Templates</pattern-name> <intent>The
    runtime representation of the transformation instructions.</intent> 
    <responsibilities>A data bag for transformation instructions; act as a factory
    for Transformers.</responsibilities> <thread-safety>Threadsafe for concurrent
    usage over multiple threads once construction is complete.</thread-safety>
    </pattern> <pattern> <pattern-name
    id="pattern-Transformer">Transformer</pattern-name> <intent>Act as a per-thread
    execution context for transformations, act as an interface for performing the
    transformation.</intent><responsibilities>Perform the
    transformation.</responsibilities> <thread-safety>Only one instance per thread
    is safe.</thread-safety> <notes>The Transformer is bound to the Templates
    object that created it.</notes> </pattern> <pattern> 
    <pattern-name id="pattern-Source">Source</pattern-name> <intent>Serve
as a
    single vendor-neutral object for multiple types of input.</intent> 
    <responsibilities>Act as simple data holder for System IDs, DOM nodes, streams,
    etc.</responsibilities> <thread-safety>Threadsafe concurrently over multiple
    threads for read-only operations; must be synchronized for edit
    operations.</thread-safety> </pattern><pattern> 
    <pattern-name id="pattern-Result">Result</pattern-name> 
    <potential-alternate-name>ResultTarget</potential-alternate-name> <intent>Serve
    as a single object for multiple types of output, so there can be simple process
    method signatures.</intent> <responsibilities>Act as simple data holder for
    output stream, DOM node, ContentHandler, etc.</responsibilities> 
    <thread-safety>Threadsafe concurrently over multiple threads for read-only,
    must be synchronized for edit.</thread-safety> </pattern> </patterns>

To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org

View raw message