use of org.eclipse.wst.xml.xpath2.processor.internal.types.QName in project webtools.sourceediting by eclipse.
the class Normalizer method make_root_self_node.
private XPathExpr make_root_self_node() {
// self::node()
Step self_node = new ForwardStep(ForwardStep.SELF, new AnyKindTest());
StepExpr self_node_expr = new AxisStep(self_node, new ArrayList());
XPathExpr self_node_xpath = new XPathExpr(0, self_node_expr);
// fn:root(self::node())
Collection args = new ArrayList();
args.add(self_node_xpath);
XPathExpr xpe = make_function(new QName("fn", "root", FnFunctionLibrary.XPATH_FUNCTIONS_NS), args);
return xpe;
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.QName in project webtools.sourceediting by eclipse.
the class StaticNameResolver method visit.
/**
* Validate an attribute test.
*
* @param e
* is the expression.
* @return null.
*/
// XXX NO CHECK ?
public Object visit(AttributeTest e) {
QName name = e.name();
if (name != null) {
if (!expandItemQName(name))
reportBadPrefix(name.prefix());
}
name = e.type();
if (name != null) {
if (!expandItemTypeQName(name))
reportBadPrefix(name.prefix());
}
return null;
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.QName in project webtools.sourceediting by eclipse.
the class StaticNameResolver method doForExpr.
// does a for and a quantified expression
// takes the iterator for var expr paris
private void doForExpr(Iterator iter, Expr expr) {
int scopes = 0;
// add variables to scope and check the binding sequence
while (iter.hasNext()) {
VarExprPair pair = (VarExprPair) iter.next();
QName var = pair.varname();
if (!expandVarQName(var))
reportBadPrefix(var.prefix());
Expr e = pair.expr();
e.accept(this);
pushScope(var, BuiltinTypeLibrary.XS_ANYTYPE);
scopes++;
}
expr.accept(this);
// kill the scopes
for (int i = 0; i < scopes; i++) popScope();
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.QName in project webtools.sourceediting by eclipse.
the class DefaultStaticContext method make_atomic.
/**
* Creates an atomic from a specific type name initialized with a default
* value.
*
* @param name
* name of type to create
* @return Atomic type of desired type.
*/
public AnyAtomicType make_atomic(QName name) {
String ns = name.namespace();
if (!_functions.containsKey(ns))
return null;
FunctionLibrary fl = (FunctionLibrary) _functions.get(ns);
if (!(fl instanceof ConstructorFL))
return null;
ConstructorFL cfl = (ConstructorFL) fl;
return cfl.atomic_type(name);
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.QName in project webtools.sourceediting by eclipse.
the class DefaultStaticContext method debug_print_vars.
/**
* Debug function which will print current variable scopes and info.
*/
// debug functions
public void debug_print_vars() {
int level = 0;
for (Iterator i = _scopes.iterator(); i.hasNext(); ) {
Map scope = (Map) i.next();
System.out.println("Scope level " + level);
// scope.entrySet().iterator();
for (Iterator j = scope.entrySet().iterator(); j.hasNext(); ) {
QName varname = (QName) j.next();
AnyType val = (AnyType) scope.get(varname);
String string_val = "null";
if (val != null)
string_val = val.getStringValue();
System.out.println("Varname: " + varname.string() + " expanded=" + varname.expanded() + " Value: " + string_val);
}
level++;
}
}
Aggregations