Java Code Examples for org.apache.xpath.XPathContext#getDTM()

The following examples show how to use org.apache.xpath.XPathContext#getDTM() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FuncNormalizeSpace.java    From j2objc with Apache License 2.0 6 votes vote down vote up
/**
 * Execute an expression in the XPath runtime context, and return the 
 * result of the expression.
 *
 *
 * @param xctxt The XPath runtime context.
 *
 * @return The result of the expression in the form of a <code>XObject</code>.
 *
 * @throws javax.xml.transform.TransformerException if a runtime exception 
 *         occurs.
 */
public void executeCharsToContentHandler(XPathContext xctxt, 
                                            ContentHandler handler)
  throws javax.xml.transform.TransformerException,
         org.xml.sax.SAXException
{
  if(Arg0IsNodesetExpr())
  {
    int node = getArg0AsNode(xctxt);
    if(DTM.NULL != node)
    {
      DTM dtm = xctxt.getDTM(node);
      dtm.dispatchCharactersEvents(node, handler, true);
    }
  }
  else
  {
    XObject obj = execute(xctxt);
    obj.dispatchCharactersEvents(handler);
  }
}
 
Example 2
Source File: FunctionDef1Arg.java    From j2objc with Apache License 2.0 6 votes vote down vote up
/**
 * Execute the first argument expression that is expected to return a
 * string.  If the argument is null, then get the string value from the
 * current context node.
 *
 * @param xctxt Runtime XPath context.
 *
 * @return The string value of the first argument, or the string value of the
 *         current context node if the first argument is null.
 *
 * @throws javax.xml.transform.TransformerException if an error occurs while
 *                                   executing the argument expression.
 */
protected XMLString getArg0AsString(XPathContext xctxt)
        throws javax.xml.transform.TransformerException
{
  if(null == m_arg0)
  {
    int currentNode = xctxt.getCurrentNode();
    if(DTM.NULL == currentNode)
      return XString.EMPTYSTRING;
    else
    {
      DTM dtm = xctxt.getDTM(currentNode);
      return dtm.getStringValue(currentNode);
    }
    
  }
  else
    return m_arg0.execute(xctxt).xstr();   
}
 
Example 3
Source File: AxesWalker.java    From j2objc with Apache License 2.0 6 votes vote down vote up
/**
 * Set the root node of the TreeWalker.
 * (Not part of the DOM2 TreeWalker interface).
 *
 * @param root The context node of this step.
 */
public void setRoot(int root)
{
  // %OPT% Get this directly from the lpi.
  XPathContext xctxt = wi().getXPathContext();
  m_dtm = xctxt.getDTM(root);
  m_traverser = m_dtm.getAxisTraverser(m_axis);
  m_isFresh = true;
  m_foundLast = false;
  m_root = root;
  m_currentNode = root;

  if (DTM.NULL == root)
  {
    throw new RuntimeException(
      XSLMessages.createXPATHMessage(XPATHErrorResources.ER_SETTING_WALKER_ROOT_TO_NULL, null)); //"\n !!!! Error! Setting the root of a walker to null!!!");
  }

  resetProximityPositions();
}
 
Example 4
Source File: LocPathIterator.java    From j2objc with Apache License 2.0 6 votes vote down vote up
/**
 * Initialize the context values for this expression
 * after it is cloned.
 *
 * @param context The XPath runtime context for this
 * transformation.
 */
public void setRoot(int context, Object environment)
{

  m_context = context;
  
  XPathContext xctxt = (XPathContext)environment;
  m_execContext = xctxt;
  m_cdtm = xctxt.getDTM(context);
  
  m_currentContextNode = context; // only if top level?
  
  // Yech, shouldn't have to do this.  -sb
  if(null == m_prefixResolver)
  	m_prefixResolver = xctxt.getNamespaceContext();
      
  m_lastFetched = DTM.NULL;
  m_foundLast = false;
  m_pos = 0;
  m_length = -1;

  if (m_isTopLevel)
    this.m_stackFrame = xctxt.getVarStack().getStackFrame();
    
  // reset();
}
 
Example 5
Source File: TransformerHandlerImpl.java    From j2objc with Apache License 2.0 6 votes vote down vote up
/**
 * Construct a TransformerHandlerImpl.
 *
 * @param transformer Non-null reference to the Xalan transformer impl.
 * @param doFragment True if the result should be a document fragement.
 * @param baseSystemID  The system ID to use as the base for relative URLs.
 */
public TransformerHandlerImpl(TransformerImpl transformer,
                              boolean doFragment, String baseSystemID)
{

  super();

  m_transformer = transformer;
  m_baseSystemID = baseSystemID;

  XPathContext xctxt = transformer.getXPathContext();
  DTM dtm = xctxt.getDTM(null, true, transformer, true, true);
  
  m_dtm = dtm;
  dtm.setDocumentBaseURI(baseSystemID);

  m_contentHandler = dtm.getContentHandler();
  m_dtdHandler = dtm.getDTDHandler();
  m_entityResolver = dtm.getEntityResolver();
  m_errorHandler = dtm.getErrorHandler();
  m_lexicalHandler = dtm.getLexicalHandler();
  m_incremental = transformer.getIncremental();
  m_optimizer = transformer.getOptimize();
  m_source_location = transformer.getSource_location();
}
 
Example 6
Source File: FuncLang.java    From j2objc with Apache License 2.0 5 votes vote down vote up
/**
 * Execute the function.  The function must return
 * a valid object.
 * @param xctxt The current execution context.
 * @return A valid XObject.
 *
 * @throws javax.xml.transform.TransformerException
 */
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
{

  String lang = m_arg0.execute(xctxt).str();
  int parent = xctxt.getCurrentNode();
  boolean isLang = false;
  DTM dtm = xctxt.getDTM(parent);

  while (DTM.NULL != parent)
  {
    if (DTM.ELEMENT_NODE == dtm.getNodeType(parent))
    {
      int langAttr = dtm.getAttributeNode(parent, "http://www.w3.org/XML/1998/namespace", "lang");

      if (DTM.NULL != langAttr)
      {
        String langVal = dtm.getNodeValue(langAttr);
        // %OPT%
        if (langVal.toLowerCase().startsWith(lang.toLowerCase()))
        {
          int valLen = lang.length();

          if ((langVal.length() == valLen)
                  || (langVal.charAt(valLen) == '-'))
          {
            isLang = true;
          }
        }

        break;
      }
    }

    parent = dtm.getParent(parent);
  }

  return isLang ? XBoolean.S_TRUE : XBoolean.S_FALSE;
}
 
Example 7
Source File: FuncDoclocation.java    From j2objc with Apache License 2.0 5 votes vote down vote up
/**
   * Execute the function.  The function must return
   * a valid object.
   * @param xctxt The current execution context.
   * @return A valid XObject.
   *
   * @throws javax.xml.transform.TransformerException
   */
  public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
  {

    int whereNode = getArg0AsNode(xctxt);
    String fileLocation = null;

    if (DTM.NULL != whereNode)
    {
      DTM dtm = xctxt.getDTM(whereNode);
      
      // %REVIEW%
      if (DTM.DOCUMENT_FRAGMENT_NODE ==  dtm.getNodeType(whereNode))
      {
        whereNode = dtm.getFirstChild(whereNode);
      }

      if (DTM.NULL != whereNode)
      {        
        fileLocation = dtm.getDocumentBaseURI();
//        int owner = dtm.getDocument();
//        fileLocation = xctxt.getSourceTreeManager().findURIFromDoc(owner);
      }
    }

    return new XString((null != fileLocation) ? fileLocation : "");
  }
 
Example 8
Source File: FuncNamespace.java    From j2objc with Apache License 2.0 5 votes vote down vote up
/**
 * Execute the function.  The function must return
 * a valid object.
 * @param xctxt The current execution context.
 * @return A valid XObject.
 *
 * @throws javax.xml.transform.TransformerException
 */
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
{

  int context = getArg0AsNode(xctxt);
  
  String s;
  if(context != DTM.NULL)
  {
    DTM dtm = xctxt.getDTM(context);
    int t = dtm.getNodeType(context);
    if(t == DTM.ELEMENT_NODE)
    {
      s = dtm.getNamespaceURI(context);
    }
    else if(t == DTM.ATTRIBUTE_NODE)
    {

      // This function always returns an empty string for namespace nodes.
      // We check for those here.  Fix inspired by Davanum Srinivas.

      s = dtm.getNodeName(context);
      if(s.startsWith("xmlns:") || s.equals("xmlns"))
        return XString.EMPTYSTRING;

      s = dtm.getNamespaceURI(context);
    }
    else
      return XString.EMPTYSTRING;
  }
  else 
    return XString.EMPTYSTRING;
  
  return ((null == s) ? XString.EMPTYSTRING : new XString(s));
}
 
Example 9
Source File: XRTreeFrag.java    From j2objc with Apache License 2.0 5 votes vote down vote up
private final void initDTM(int root, XPathContext xctxt){
  m_dtmRoot = root;
  final DTM dtm = xctxt.getDTM(root);
  if(dtm != null){
    m_DTMXRTreeFrag = xctxt.getDTMXRTreeFrag(xctxt.getDTMIdentity(dtm));
  }
}
 
Example 10
Source File: ElemNumber.java    From j2objc with Apache License 2.0 5 votes vote down vote up
/**
 * Given a 'from' pattern (ala xsl:number), a match pattern
 * and a context, find the first ancestor that matches the
 * pattern (including the context handed in).
 *
 * @param xctxt The XPath runtime state for this.
 * @param fromMatchPattern The ancestor must match this pattern.
 * @param countMatchPattern The ancestor must also match this pattern.
 * @param context The node that "." expresses.
 * @param namespaceContext The context in which namespaces in the
 * queries are supposed to be expanded.
 *
 * @return the first ancestor that matches the given pattern
 *
 * @throws javax.xml.transform.TransformerException
 */
int findAncestor(
        XPathContext xctxt, XPath fromMatchPattern, XPath countMatchPattern, 
        int context, ElemNumber namespaceContext)
          throws javax.xml.transform.TransformerException
{
  DTM dtm = xctxt.getDTM(context);
  while (DTM.NULL != context)
  {
    if (null != fromMatchPattern)
    {
      if (fromMatchPattern.getMatchScore(xctxt, context)
              != XPath.MATCH_SCORE_NONE)
      {

        //context = null;
        break;
      }
    }

    if (null != countMatchPattern)
    {
      if (countMatchPattern.getMatchScore(xctxt, context)
              != XPath.MATCH_SCORE_NONE)
      {
        break;
      }
    }

    context = dtm.getParent(context);
  }

  return context;
}
 
Example 11
Source File: ChildIterator.java    From j2objc with Apache License 2.0 5 votes vote down vote up
/**
 * Return the first node out of the nodeset, if this expression is 
 * a nodeset expression.  This is the default implementation for 
 * nodesets.
 * <p>WARNING: Do not mutate this class from this function!</p>
 * @param xctxt The XPath runtime context.
 * @return the first node out of the nodeset, or DTM.NULL.
 */
public int asNode(XPathContext xctxt)
  throws javax.xml.transform.TransformerException
{
  int current = xctxt.getCurrentNode();
  
  DTM dtm = xctxt.getDTM(current);
  
  return dtm.getFirstChild(current);
}
 
Example 12
Source File: DescendantIterator.java    From j2objc with Apache License 2.0 5 votes vote down vote up
/**
 * Return the first node out of the nodeset, if this expression is 
 * a nodeset expression.  This is the default implementation for 
 * nodesets.
 * <p>WARNING: Do not mutate this class from this function!</p>
 * @param xctxt The XPath runtime context.
 * @return the first node out of the nodeset, or DTM.NULL.
 */
public int asNode(XPathContext xctxt)
  throws javax.xml.transform.TransformerException
{
  if(getPredicateCount() > 0)
    return super.asNode(xctxt);

  int current = xctxt.getCurrentNode();
  
  DTM dtm = xctxt.getDTM(current);
  DTMAxisTraverser traverser = dtm.getAxisTraverser(m_axis);
  
  String localName = getLocalName();
  String namespace = getNamespace();
  int what = m_whatToShow;
  
  // System.out.print(" (DescendantIterator) ");
  
  // System.out.println("what: ");
  // NodeTest.debugWhatToShow(what);
  if(DTMFilter.SHOW_ALL == what
     || localName == NodeTest.WILD
     || namespace == NodeTest.WILD)
  {
    return traverser.first(current);
  }
  else
  {
    int type = getNodeTypeTest(what);
    int extendedType = dtm.getExpandedTypeID(namespace, localName, type);
    return traverser.first(current, extendedType);
  }
}
 
Example 13
Source File: FuncLocalPart.java    From j2objc with Apache License 2.0 5 votes vote down vote up
/**
 * Execute the function.  The function must return
 * a valid object.
 * @param xctxt The current execution context.
 * @return A valid XObject.
 *
 * @throws javax.xml.transform.TransformerException
 */
public XObject execute(XPathContext xctxt) throws javax.xml.transform.TransformerException
{

  int context = getArg0AsNode(xctxt);
  if(DTM.NULL == context)
    return XString.EMPTYSTRING;
  DTM dtm = xctxt.getDTM(context);
  String s = (context != DTM.NULL) ? dtm.getLocalName(context) : "";
  if(s.startsWith("#") || s.equals("xmlns"))
    return XString.EMPTYSTRING;

  return new XString(s);
}
 
Example 14
Source File: SerializerUtils.java    From j2objc with Apache License 2.0 5 votes vote down vote up
/**
 * Given a result tree fragment, walk the tree and
 * output it to the SerializationHandler.
 *
 * @param obj Result tree fragment object
 * @param support XPath context for the result tree fragment
 *
 * @throws org.xml.sax.SAXException
 */
public static void outputResultTreeFragment(
    SerializationHandler handler,
    XObject obj,
    XPathContext support)
    throws org.xml.sax.SAXException
{

    int doc = obj.rtf();
    DTM dtm = support.getDTM(doc);

    if (null != dtm)
    {
        for (int n = dtm.getFirstChild(doc);
            DTM.NULL != n;
            n = dtm.getNextSibling(n))
        {
            handler.flushPending();

            // I think. . . . This used to have a (true) arg
            // to flush prefixes, will that cause problems ???
            if (dtm.getNodeType(n) == DTM.ELEMENT_NODE
                    && dtm.getNamespaceURI(n) == null)
                handler.startPrefixMapping("", "");
            dtm.dispatchToEvents(n, handler);
        }
    }
}
 
Example 15
Source File: ElemNumber.java    From j2objc with Apache License 2.0 4 votes vote down vote up
/**
 * Get the previous node to be counted.
 *
 * @param xctxt The XPath runtime state for this.
 * @param pos The current node
 *
 * @return the previous node to be counted.
 *
 * @throws TransformerException
 */
public int getPreviousNode(XPathContext xctxt, int pos)
        throws TransformerException
{

  XPath countMatchPattern = getCountMatchPattern(xctxt, pos);
  DTM dtm = xctxt.getDTM(pos);

  if (Constants.NUMBERLEVEL_ANY == m_level)
  {
    XPath fromMatchPattern = m_fromMatchPattern;

    // Do a backwards document-order walk 'till a node is found that matches 
    // the 'from' pattern, or a node is found that matches the 'count' pattern, 
    // or the top of the tree is found.
    while (DTM.NULL != pos)
    {

      // Get the previous sibling, if there is no previous sibling, 
      // then count the parent, but if there is a previous sibling, 
      // dive down to the lowest right-hand (last) child of that sibling.
      int next = dtm.getPreviousSibling(pos);

      if (DTM.NULL == next)
      {
        next = dtm.getParent(pos);

        if ((DTM.NULL != next) && ((((null != fromMatchPattern) && (fromMatchPattern.getMatchScore(
                xctxt, next) != XPath.MATCH_SCORE_NONE))) 
            || (dtm.getNodeType(next) == DTM.DOCUMENT_NODE)))
        {
          pos = DTM.NULL;  // return null from function.

          break;  // from while loop
        }
      }
      else
      {

        // dive down to the lowest right child.
        int child = next;

        while (DTM.NULL != child)
        {
          child = dtm.getLastChild(next);

          if (DTM.NULL != child)
            next = child;
        }
      }

      pos = next;

      if ((DTM.NULL != pos)
              && ((null == countMatchPattern)
                  || (countMatchPattern.getMatchScore(xctxt, pos)
                      != XPath.MATCH_SCORE_NONE)))
      {
        break;
      }
    }
  }
  else  // NUMBERLEVEL_MULTI or NUMBERLEVEL_SINGLE
  {
    while (DTM.NULL != pos)
    {
      pos = dtm.getPreviousSibling(pos);

      if ((DTM.NULL != pos)
              && ((null == countMatchPattern)
                  || (countMatchPattern.getMatchScore(xctxt, pos)
                      != XPath.MATCH_SCORE_NONE)))
      {
        break;
      }
    }
  }

  return pos;
}
 
Example 16
Source File: ElemNumber.java    From j2objc with Apache License 2.0 4 votes vote down vote up
/**
 * Get the ancestors, up to the root, that match the
 * pattern.
 * 
 * @param xctxt The XPath runtime state for this.
 * @param node Count this node and it's ancestors.
 * @param stopAtFirstFound Flag indicating to stop after the
 * first node is found (difference between level = single
 * or multiple)
 * @return The number of ancestors that match the pattern.
 *
 * @throws javax.xml.transform.TransformerException
 */
NodeVector getMatchingAncestors(
        XPathContext xctxt, int node, boolean stopAtFirstFound)
          throws javax.xml.transform.TransformerException
{

  NodeSetDTM ancestors = new NodeSetDTM(xctxt.getDTMManager());
  XPath countMatchPattern = getCountMatchPattern(xctxt, node);
  DTM dtm = xctxt.getDTM(node);

  while (DTM.NULL != node)
  {
    if ((null != m_fromMatchPattern)
            && (m_fromMatchPattern.getMatchScore(xctxt, node)
                != XPath.MATCH_SCORE_NONE))
    {

      // The following if statement gives level="single" different 
      // behavior from level="multiple", which seems incorrect according 
      // to the XSLT spec.  For now we are leaving this in to replicate 
      // the same behavior in XT, but, for all intents and purposes we 
      // think this is a bug, or there is something about level="single" 
      // that we still don't understand.
      if (!stopAtFirstFound)
        break;
    }

    if (null == countMatchPattern)
      System.out.println(
        "Programmers error! countMatchPattern should never be null!");

    if (countMatchPattern.getMatchScore(xctxt, node)
            != XPath.MATCH_SCORE_NONE)
    {
      ancestors.addElement(node);

      if (stopAtFirstFound)
        break;
    }

    node = dtm.getParent(node);
  }

  return ancestors;
}
 
Example 17
Source File: ElemNumber.java    From j2objc with Apache License 2.0 4 votes vote down vote up
/**
 * Given a 'from' pattern (ala xsl:number), a match pattern
 * and a context, find the first ancestor that matches the
 * pattern (including the context handed in).
 * @param xctxt The XPath runtime state for this.
 * @param fromMatchPattern The ancestor must match this pattern.
 * @param countMatchPattern The ancestor must also match this pattern.
 * @param context The node that "." expresses.
 * @param namespaceContext The context in which namespaces in the
 * queries are supposed to be expanded.
 *
 * @return the first preceding, ancestor or self node that 
 * matches the given pattern
 *
 * @throws javax.xml.transform.TransformerException
 */
private int findPrecedingOrAncestorOrSelf(
        XPathContext xctxt, XPath fromMatchPattern, XPath countMatchPattern, 
        int context, ElemNumber namespaceContext)
          throws javax.xml.transform.TransformerException
{
  DTM dtm = xctxt.getDTM(context);
  while (DTM.NULL != context)
  {
    if (null != fromMatchPattern)
    {
      if (fromMatchPattern.getMatchScore(xctxt, context)
              != XPath.MATCH_SCORE_NONE)
      {
        context = DTM.NULL;

        break;
      }
    }

    if (null != countMatchPattern)
    {
      if (countMatchPattern.getMatchScore(xctxt, context)
              != XPath.MATCH_SCORE_NONE)
      {
        break;
      }
    }

    int prevSibling = dtm.getPreviousSibling(context);

    if (DTM.NULL == prevSibling)
    {
      context = dtm.getParent(context);
    }
    else
    {

      // Now go down the chain of children of this sibling 
      context = dtm.getLastChild(prevSibling);

      if (context == DTM.NULL)
        context = prevSibling;
    }
  }

  return context;
}
 
Example 18
Source File: DTMXRTreeFrag.java    From j2objc with Apache License 2.0 4 votes vote down vote up
public DTMXRTreeFrag(int dtmIdentity, XPathContext xctxt){
  m_xctxt = xctxt;
  m_dtmIdentity = dtmIdentity;
  m_dtm = xctxt.getDTM(dtmIdentity); 
}
 
Example 19
Source File: ElemCopy.java    From j2objc with Apache License 2.0 4 votes vote down vote up
/**
 * The xsl:copy element provides an easy way of copying the current node.
 * Executing this function creates a copy of the current node into the
 * result tree.
 * <p>The namespace nodes of the current node are automatically
 * copied as well, but the attributes and children of the node are not
 * automatically copied. The content of the xsl:copy element is a
 * template for the attributes and children of the created node;
 * the content is instantiated only for nodes of types that can have
 * attributes or children (i.e. root nodes and element nodes).</p>
 * <p>The root node is treated specially because the root node of the
 * result tree is created implicitly. When the current node is the
 * root node, xsl:copy will not create a root node, but will just use
 * the content template.</p>
 *
 * @param transformer non-null reference to the the current transform-time state.
 *
 * @throws TransformerException
 */
public void execute(
        TransformerImpl transformer)
          throws TransformerException
{
              XPathContext xctxt = transformer.getXPathContext();
    
  try
  {
    int sourceNode = xctxt.getCurrentNode();
    xctxt.pushCurrentNode(sourceNode);
    DTM dtm = xctxt.getDTM(sourceNode);
    short nodeType = dtm.getNodeType(sourceNode);

    if ((DTM.DOCUMENT_NODE != nodeType) && (DTM.DOCUMENT_FRAGMENT_NODE != nodeType))
    {
      SerializationHandler rthandler = transformer.getSerializationHandler();

      // TODO: Process the use-attribute-sets stuff
      ClonerToResultTree.cloneToResultTree(sourceNode, nodeType, dtm, 
                                           rthandler, false);

      if (DTM.ELEMENT_NODE == nodeType)
      {
        super.execute(transformer);
        SerializerUtils.processNSDecls(rthandler, sourceNode, nodeType, dtm);
        transformer.executeChildTemplates(this, true);
        
        String ns = dtm.getNamespaceURI(sourceNode);
        String localName = dtm.getLocalName(sourceNode);
        transformer.getResultTreeHandler().endElement(ns, localName,
                                                      dtm.getNodeName(sourceNode));
      }
    }
    else
    {
      super.execute(transformer);
      transformer.executeChildTemplates(this, true);
    }
  }
  catch(org.xml.sax.SAXException se)
  {
    throw new TransformerException(se);
  }
  finally
  {
    xctxt.popCurrentNode();
  }
}
 
Example 20
Source File: FuncId.java    From j2objc with Apache License 2.0 4 votes vote down vote up
/**
   * Fill in a list with nodes that match a space delimited list if ID 
   * ID references.
   *
   * @param xctxt The runtime XPath context.
   * @param docContext The document where the nodes are being looked for.
   * @param refval A space delimited list of ID references.
   * @param usedrefs List of references for which nodes were found.
   * @param nodeSet Node set where the nodes will be added to.
   * @param mayBeMore true if there is another set of nodes to be looked for.
   *
   * @return The usedrefs value.
   */
  private StringVector getNodesByID(XPathContext xctxt, int docContext,
                                    String refval, StringVector usedrefs,
                                    NodeSetDTM nodeSet, boolean mayBeMore)
  {

    if (null != refval)
    {
      String ref = null;
//      DOMHelper dh = xctxt.getDOMHelper();
      StringTokenizer tokenizer = new StringTokenizer(refval);
      boolean hasMore = tokenizer.hasMoreTokens();
      DTM dtm = xctxt.getDTM(docContext);

      while (hasMore)
      {
        ref = tokenizer.nextToken();
        hasMore = tokenizer.hasMoreTokens();

        if ((null != usedrefs) && usedrefs.contains(ref))
        {
          ref = null;

          continue;
        }

        int node = dtm.getElementById(ref);

        if (DTM.NULL != node)
          nodeSet.addNodeInDocOrder(node, xctxt);

        if ((null != ref) && (hasMore || mayBeMore))
        {
          if (null == usedrefs)
            usedrefs = new StringVector();

          usedrefs.addElement(ref);
        }
      }
    }

    return usedrefs;
  }