blob: 1ee992ddd254d44de9d21c253607f9b8d75d2eb1 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2007 Chase Technology Ltd - http://www.chasetechnology.co.uk
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Doug Satchwell (Chase Technology Ltd) - initial API and implementation
*******************************************************************************/
package org.eclipse.wst.xsl.xalan.debugger;
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;
import org.apache.xalan.templates.ElemVariable;
import org.apache.xalan.templates.StylesheetRoot;
import org.apache.xalan.trace.TracerEvent;
import org.apache.xpath.VariableStack;
import org.eclipse.wst.xsl.debugger.Variable;
public class XalanRootStyleFrame extends XalanStyleFrame
{
private final List globals = new ArrayList();
public XalanRootStyleFrame(TracerEvent event)
{
super(null, event);
fillGlobals(event);
}
protected List getGlobals()
{
return globals;
}
private void fillGlobals(TracerEvent event)
{
VariableStack vs = event.m_processor.getXPathContext().getVarStack();
StylesheetRoot sr = event.m_styleNode.getStylesheetRoot();
Vector vars = sr.getVariablesAndParamsComposed();
int i = vars.size();
while (--i >= 0)
{
ElemVariable variable = (ElemVariable) vars.elementAt(i);
XalanVariable xvar = new XalanVariable(this,vs,Variable.GLOBAL_SCOPE,i,variable);
globals.add(xvar);
}
}
}