return lVar;
}
private LogicalVariable translateDirectElementConstructorNode(TranslationContext tCtx,
DirectElementConstructorNode decNode) throws SystemException {
QNameNode startName = decNode.getStartTagName();
QNameNode endName = decNode.getEndTagName();
if (endName != null
&& (!startName.getPrefix().equals(endName.getPrefix()) || !startName.getLocalName().equals(
endName.getLocalName()))) {
throw new SystemException(ErrorCode.XPST0003, endName.getSourceLocation());
}
pushContext();
for (DirectAttributeConstructorNode acNode : decNode.getAttributes()) {
QNameNode aName = acNode.getName();
if ("xmlns".equals(aName.getPrefix())) {
List<ASTNode> values = acNode.getValue();
if (values.size() != 1 || !ASTTag.CONTENT_CHARS.equals(values.get(0).getTag())) {
throw new SystemException(ErrorCode.XQST0022, acNode.getSourceLocation());
}
currCtx.registerNamespaceUri(aName.getLocalName(),
unquote(((ContentCharsNode) values.get(0)).getContent()));
}
}
List<ILogicalExpression> content = new ArrayList<ILogicalExpression>();
for (DirectAttributeConstructorNode acNode : decNode.getAttributes()) {
QNameNode aName = acNode.getName();
if (!"xmlns".equals(aName.getPrefix())) {
content.add(vre(translateExpression(acNode, tCtx)));
}
}
ILogicalExpression name = ce(SequenceType.create(BuiltinTypeRegistry.XS_QNAME, Quantifier.QUANT_ONE),
createQName(startName, moduleCtx.getDefaultElementNamespaceUri()));