BEA Systems, Inc.

WebLogic Server 6.0sp2 API Reference

weblogic.apache.xalan.xslt
Class ExtensionNSHandler

java.lang.Object
  |
  +--weblogic.apache.xalan.xpath.ExtensionFunctionHandler
        |
        +--weblogic.apache.xalan.xslt.ExtensionNSHandler

public class ExtensionNSHandler
extends ExtensionFunctionHandler

Represents an extension namespace. Provides functions to call into the extension via both element syntax and function syntax. Extends XPath's extension function capability to a full namespace extension model.

This class is based on an implementation from the Apache XML Project. In future releases the XML parser, XSLT processor, and associated classes will likely be updated to be based on a later version of the Apache implementations. Since Apache does not guarantee backwards compatibility between versions of their software, we cannot guarantee backwards compatibility of any of the classes contained in the weblogic.apache package or sub-packages.

Author:
Sanjiva Weerawarana (sanjiva@watson.ibm.com)
Copyright © 2001 BEA Systems, Inc. All Rights Reserved.

Inner classes inherited from class weblogic.apache.xalan.xpath.ExtensionFunctionHandler
ExtensionFunctionHandler.ExtensionLiaison
 
Fields inherited from class weblogic.apache.xalan.xpath.ExtensionFunctionHandler
componentStarted, DEFAULT_EXTENSION_LIAISON, elements, extensionLiaison, functions, namespaceUri, scriptLang, scriptSrc, scriptSrcURL
 
Constructor Summary
ExtensionNSHandler(XSLTEngineImpl xslp, java.lang.String namespaceUri)
          Construct a new extension namespace handler for a given extension NS.
ExtensionNSHandler(XSLTEngineImpl xslp, java.lang.String namespaceUri, java.lang.String elemNames, java.lang.String funcNames, java.lang.String lang, java.lang.String srcURL, java.lang.String src)
          Construct a new extension namespace handler given all the information needed.
 
Method Summary
 boolean isElementAvailable(java.lang.String element)
          Tests whether a certain element name is known within this namespace.
 void processElement(java.lang.String localPart, org.w3c.dom.Element element, XSLTEngineImpl processor, Stylesheet stylesheetTree, org.w3c.dom.Node sourceTree, org.w3c.dom.Node sourceNode, QName mode, java.lang.Class classObj, java.lang.Object methodKey)
          Process a call to this extension namespace via an element.
 void setElements(java.lang.String elemNames)
          Set element local parts of extension NS.
 void setFunctions(java.lang.String funcNames)
           
 void setScript(java.lang.String lang, java.lang.String srcURL, java.lang.String scriptSrc)
          Set the script data for this extension NS.
protected  void startupComponent(java.lang.Class classObj)
          Start the component up by executing any script that needs to run at startup time.
 
Methods inherited from class weblogic.apache.xalan.xpath.ExtensionFunctionHandler
callFunction, callJava, isFunctionAvailable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtensionNSHandler

public ExtensionNSHandler(XSLTEngineImpl xslp,
                          java.lang.String namespaceUri)
Construct a new extension namespace handler for a given extension NS. This doesn't do anything - just hang on to the namespace URI.

Parameters:
xslp - handle to the XSL processor that I'm working for
namespaceUri - the extension namespace URI that I'm implementing

ExtensionNSHandler

public ExtensionNSHandler(XSLTEngineImpl xslp,
                          java.lang.String namespaceUri,
                          java.lang.String elemNames,
                          java.lang.String funcNames,
                          java.lang.String lang,
                          java.lang.String srcURL,
                          java.lang.String src)
Construct a new extension namespace handler given all the information needed.

Parameters:
xslp - handle to the XSL processor that I'm working for
namespaceUri - the extension namespace URI that I'm implementing
elemNames - string containing list of elements of extension NS
funcNames - string containing list of functions of extension NS
lang - language of code implementing the extension
srcURL - value of src attribute (if any) - treated as a URL or a classname depending on the value of lang. If srcURL is not null, then scriptSrc is ignored.
scriptSrc - the actual script code (if any)
Method Detail

setFunctions

public void setFunctions(java.lang.String funcNames)

Overrides:
setFunctions in class ExtensionFunctionHandler

setScript

public void setScript(java.lang.String lang,
                      java.lang.String srcURL,
                      java.lang.String scriptSrc)
Set the script data for this extension NS. Deferred to super for actual work - I only record that a component desc has been loaded.

Parameters:
lang - language of the script.
srcURL - value of src attribute (if any) - treated as a URL or a classname depending on the value of lang. If srcURL is not null, then scriptSrc is ignored.
scriptSrc - the actual script code (if any)
Overrides:
setScript in class ExtensionFunctionHandler

setElements

public void setElements(java.lang.String elemNames)
Set element local parts of extension NS.

Parameters:
elemNames - whitespace separated list of element names defined by this extension namespace.
Overrides:
setElements in class ExtensionFunctionHandler

isElementAvailable

public boolean isElementAvailable(java.lang.String element)
Tests whether a certain element name is known within this namespace.

Parameters:
element - name of the element being tested
Returns:
true if its known, false if not.
Overrides:
isElementAvailable in class ExtensionFunctionHandler

processElement

public void processElement(java.lang.String localPart,
                           org.w3c.dom.Element element,
                           XSLTEngineImpl processor,
                           Stylesheet stylesheetTree,
                           org.w3c.dom.Node sourceTree,
                           org.w3c.dom.Node sourceNode,
                           QName mode,
                           java.lang.Class classObj,
                           java.lang.Object methodKey)
                    throws XSLProcessorException,
                           java.net.MalformedURLException,
                           java.io.FileNotFoundException,
                           java.io.IOException,
                           org.xml.sax.SAXException
Process a call to this extension namespace via an element. As a side effect, the results are sent to the XSLTEngineImpl's result tree.

Parameters:
localPart - Element name's local part.
element - The extension element being processed.
processor - Handle to XSLTEngineImpl.
stylesheetTree - The compiled stylesheet tree.
mode - The current mode.
sourceTree - The root of the source tree (but don't assume it's a Document).
sourceNode - The current context node.
Throws:
XSLProcessorException - thrown if something goes wrong while running the extension handler.
java.net.MalformedURLException - if loading trouble
java.io.FileNotFoundException - if loading trouble
java.io.IOException - if loading trouble
org.xml.sax.SAXException - if parsing trouble

startupComponent

protected void startupComponent(java.lang.Class classObj)
                         throws XPathProcessorException
Start the component up by executing any script that needs to run at startup time. This needs to happen before any functions can be called on the component.

Throws:
XPathProcessorException - if something bad happens.
Overrides:
startupComponent in class ExtensionFunctionHandler

Documentation is available at
http://download.oracle.com/docs/cd/E13222_01/wls/docs60