sigmlgen.xslth4
Class H2SAccess

java.lang.Object
  extended by sigmlgen.xslth4.H2SAccess

public final class H2SAccess
extends java.lang.Object

This class provides access to the XSLT document files in its package in a manner that avoids a difficulty with XSLT document inclusion for a JNLP app running offline.

The problem arises like this. The natural way for us to support XSLT file inclusion is by accessing each top level XSLT document resource explicitly via its URL rather than directly via a resource stream: otherwise a relative path reference in an xsl:include element fails for lack of the appropriate base for resolution.

However, that technique results in the use of a jar:...!/... URL for each of our XSLT resources: and these (remote) URLs result in failure when they are used by a JNLP app running offline. (More precisely, they seem to fail with the Windows JNLP implementation, although not with the Mac OS X one.)

The solution provided by this class is to replace each xsl:include element in any of our top-level XSLT resources by the document it specifies for inclusion (and so on recursively for each subordinate xsl:include element), thereby providing a single self-contained text for any of these XSLT resources. See xsltText(String) for further details.


Constructor Summary
H2SAccess()
           
 
Method Summary
static java.io.Reader xsltReader(java.lang.String relpath)
          Convenience method: passes the given path to xsltText(String) and returns a string reader for the resulting text.
static java.lang.String xsltText(java.lang.String relpath)
          Generates and returns a single XSLT text for the XSLT document at the given path relative to the current base URL (typically the library's jar: URL).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

H2SAccess

public H2SAccess()
Method Detail

xsltReader

public static final java.io.Reader xsltReader(java.lang.String relpath)
Convenience method: passes the given path to xsltText(String) and returns a string reader for the resulting text.


xsltText

public static final java.lang.String xsltText(java.lang.String relpath)
Generates and returns a single XSLT text for the XSLT document at the given path relative to the current base URL (typically the library's jar: URL). This path must start with the present package's path, sigmlgen/xslth4. Each xsl:include element in the given XSLT resource is replaced with the actual text of the included resource, stripped of its xsl:transform element wrapper tags. This last rule is applied recursively to each included resource. In case of failure, an error message is logged and the result is null.