use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSNCName in project webtools.sourceediting by eclipse.
the class FnLocalNameFromQName method local_name.
/**
* Local-Name-from-QName operation.
*
* @param args
* Result from the expressions evaluation.
* @throws DynamicError
* Dynamic error.
* @return Result of fn:local-name-from-QName operation.
*/
public static ResultSequence local_name(Collection args) throws DynamicError {
Collection cargs = Function.convert_arguments(args, expected_args());
// get arg
ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
if (arg1.empty())
return ResultBuffer.EMPTY;
QName qname = (QName) arg1.first();
return new XSNCName(qname.local());
}
use of org.eclipse.wst.xml.xpath2.processor.internal.types.XSNCName in project webtools.sourceediting by eclipse.
the class FnPrefixFromQName method prefix.
/**
* Prefix-from-QName operation.
*
* @param args
* Result from the expressions evaluation.
* @throws DynamicError
* Dynamic error.
* @return Result of fn:prefix-from-QName operation.
*/
public static ResultSequence prefix(Collection args, StaticContext sc) throws DynamicError {
Collection cargs = Function.convert_arguments(args, expected_args());
// get arg
ResultSequence arg1 = (ResultSequence) cargs.iterator().next();
if (arg1.empty())
return ResultBuffer.EMPTY;
QName qname = (QName) arg1.first();
String prefix = qname.prefix();
if (prefix != null) {
if (!XMLConstants.NULL_NS_URI.equals(sc.getNamespaceContext().getNamespaceURI(prefix))) {
return new XSNCName(prefix);
} else {
throw DynamicError.invalidPrefix();
}
}
return ResultBuffer.EMPTY;
}
Aggregations