org.ejen.ext
Class XMLInclude

java.lang.Object
  |
  +--org.ejen.ext.XMLInclude

public class XMLInclude
extends Object

XML file include utility (static methods).

Usage (XSL stylesheet)

  <?xml version="1.0" encoding="iso-8859-1"?>

  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                  ...
                  xmlns:xin="org.ejen.ext.XMLInclude"
                  version="1.0">

    <xsl:output method="xml" encoding="iso-8859-1"/>

    <xsl:template match="ejen">

      <xsl:copy-of select="xin:load('{$name}.xml')"/>

    </xsl:template>

  </xsl:stylesheet>
 

Version:
1.0
Author:
F. Wolff

Constructor Summary
protected XMLInclude()
          Protected constructor (prevents instanciation).
 
Method Summary
static Node load(ExpressionContext context, String fileName)
          Returns the root Node of an XML file (with all descendants).
protected static Node load(String fileName)
          Returns the root Node of an XML file (with all descendants).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLInclude

protected XMLInclude()
Protected constructor (prevents instanciation).

Method Detail

load

public static Node load(ExpressionContext context,
                        String fileName)
Returns the root Node of an XML file (with all descendants).


  <xsl:copy-of select="xin:load('{$name}.xml')"/>
 

XSLT parameters:
[Mandatory/AVT] name of the XML file to be loaded.

Parameters:
context - automatically passed by the xalan extension mechanism.
fileName - name of the XML file.
Returns:
the root Node of the XML file.
Throws:
WrappedRuntimeException - errors (file not found...).

load

protected static Node load(String fileName)
Returns the root Node of an XML file (with all descendants).

Parameters:
fileName - name of the XML file.
Returns:
the root Node of the XML file.
Throws:
WrappedRuntimeException - errors (file not found...).