FileDocCategorySizeDatePackage
FuncHereContext.javaAPI DocJava SE 6 API4642Tue Jun 10 00:23:04 BST 2008com.sun.org.apache.xml.internal.security.transforms.implementations

FuncHereContext

public class FuncHereContext extends XPathContext
{@link FuncHereContext} extends {@link XPathContext} for supplying context for the here() function. The here() function needs to know where in an XML instance the XPath text string appeared. This can be in {@link org.w3c.dom.Text}, {@link org.w3c.dom.Attr}ibutes and {@ProcessingInstrinction} nodes. The correct node must be supplied to the constructor of {@link FuncHereContext}. The supplied Node MUST contain the XPath which is to be executed.
From: Scott_Boag\@lotus.com
To: Christian Geuer-Pollmann 
CC: xalan-dev@xml.apache.org
Subject: Re: Cleanup of XPathContext & definition of XSLTContext
Date: Tue, 21 Aug 2001 18:36:24 -0400

> My point is to say to get this baby to run, the XPath must have a
> possibility to retrieve the information where itself occured in a
> document.

It sounds to me like you have to derive an XMLSigContext from the
XPathContext?

> and supplied the Node which contains the xpath string as "owner". Question:
> Is this the correct use of the owner object? It works, but I don't know
> whether this is correct from the xalan-philosophy...

Philosophically it's fine. The owner is the TransformerImpl if XPath is
running under XSLT. If it is not running under XSLT, it can be whatever
you want.

-scott
author
$Author: raul $
see
com.sun.org.apache.xml.internal.security.transforms.implementations.FuncHere
see
com.sun.org.apache.xml.internal.security.utils.XPathFuncHereAPI
see
XML Signature - The here() function

Fields Summary
Constructors Summary
private FuncHereContext()
This constuctor is disabled because if we use the here() function we always need to know in which node the XPath occured.

public FuncHereContext(Node owner)
Constructor FuncHereContext

param
owner

      super(owner);
   
public FuncHereContext(Node owner, XPathContext xpathContext)
Constructor FuncHereContext

param
owner
param
xpathContext


      super(owner);

      try {
         super.m_dtmManager = xpathContext.getDTMManager();
      } catch (IllegalAccessError iae) {
         throw new IllegalAccessError(I18n.translate("endorsed.jdk1.4.0")
                                      + " Original message was \""
                                      + iae.getMessage() + "\"");
      }
   
public FuncHereContext(Node owner, CachedXPathAPI previouslyUsed)
Constructor FuncHereContext

param
owner
param
previouslyUsed


      super(owner);

      try {
         super.m_dtmManager = previouslyUsed.getXPathContext().getDTMManager();
      } catch (IllegalAccessError iae) {
         throw new IllegalAccessError(I18n.translate("endorsed.jdk1.4.0")
                                      + " Original message was \""
                                      + iae.getMessage() + "\"");
      }
   
public FuncHereContext(Node owner, DTMManager dtmManager)
Constructor FuncHereContext

param
owner
param
dtmManager


      super(owner);

      try {
         super.m_dtmManager = dtmManager;
      } catch (IllegalAccessError iae) {
         throw new IllegalAccessError(I18n.translate("endorsed.jdk1.4.0")
                                      + " Original message was \""
                                      + iae.getMessage() + "\"");
      }
   
Methods Summary