本文整理汇总了Java中net.sf.saxon.om.StructuredQName类的典型用法代码示例。如果您正苦于以下问题:Java StructuredQName类的具体用法?Java StructuredQName怎么用?Java StructuredQName使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StructuredQName类属于net.sf.saxon.om包,在下文中一共展示了StructuredQName类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import net.sf.saxon.om.StructuredQName; //导入依赖的package包/类
public static boolean init(Transformer transformer, final LocalDebugger dbg) {
if (transformer instanceof Controller) {
System.out.println("SAXON 9");
final Controller controller = (Controller)transformer;
((Saxon9TraceListener)controller.getConfiguration().getTraceListener()).setDebugger(dbg);
controller.getConfiguration().setLineNumbering(true);
controller.getConfiguration().setCompileWithTracing(true);
controller.getConfiguration().setMultiThreading(false);
controller.getConfiguration().setSerializerFactory(new SerializerFactory(controller.getConfiguration()) {
@Override
protected Receiver createXMLSerializer(Emitter emitter,
Properties props,
PipelineConfiguration pipe,
CharacterMapExpander characterMapExpander,
ProxyReceiver normalizer) throws XPathException {
return super.createXMLSerializer(emitter, props, pipe, characterMapExpander, normalizer);
}
@Override
protected Emitter newXMLEmitter() {
return new TracingOutputter(dbg.getEventQueue(), super.newXMLEmitter());
}
});
controller.getConfiguration().setDebugger(new Debugger() {
public SlotManager makeSlotManager() {
return new SlotManager() {
@Override
public int allocateSlotNumber(StructuredQName qName) {
System.out.println("qName = " + qName);
return super.allocateSlotNumber(qName);
}
};
}
});
return true;
}
return false;
}
示例2: initializeAttributeLocation
import net.sf.saxon.om.StructuredQName; //导入依赖的package包/类
private void initializeAttributeLocation(@Nullable Object loc) {
if ((loc == null) || !(loc instanceof AttributeLocation)) {
return;
}
AttributeLocation attrLoc = ((AttributeLocation) loc);
StructuredQName nodeQname = attrLoc.getAttributeName();
if (nodeQname != null) {
this.attrQname = new QName(nodeQname);
}
if ((nodeQname = attrLoc.getElementName()) != null) {
this.elemQname = new QName(nodeQname);
}
}
示例3: bind
import net.sf.saxon.om.StructuredQName; //导入依赖的package包/类
public Expression bind(StructuredQName functionName, Expression[] staticArgs, StaticContext env, Container container)
throws XPathException {
final Expression call = myLibrary.bind(functionName, staticArgs, env, container);
if (call instanceof UserFunctionCall) {
final XSLFunction fn = getFunction(functionName, staticArgs);
if (fn != null) {
((UserFunctionCall)call).setFunction(fn.getCompiledFunction());
}
}
return call;
}
示例4: getFunction
import net.sf.saxon.om.StructuredQName; //导入依赖的package包/类
private XSLFunction getFunction(StructuredQName functionName, Expression[] staticArgs) {
if (myGetFunction == null) return null;
try {
return (XSLFunction)myGetFunction.invoke(myModule, functionName, staticArgs.length);
} catch (Exception e) {
debug(e);
return null;
}
}
示例5: getFunctionQName
import net.sf.saxon.om.StructuredQName; //导入依赖的package包/类
@Override
public StructuredQName getFunctionQName() {
return new StructuredQName("waag", "http://waag.org/saxon-extension",
"extract-street-number");
}
示例6: SdcctXpathSelector
import net.sf.saxon.om.StructuredQName; //导入依赖的package包/类
public SdcctXpathSelector(XPathExpression expr, StaticXpathOptions staticOpts, DynamicXpathOptions dynamicOpts, XPathDynamicContext dynamicContext,
Map<StructuredQName, XPathVariable> declaredVars) {
super(expr, declaredVars);
this.expr = expr;
this.staticOpts = staticOpts;
this.dynamicOpts = dynamicOpts;
this.dynamicContext = dynamicContext;
this.declaredVars = declaredVars;
}
示例7: load
import net.sf.saxon.om.StructuredQName; //导入依赖的package包/类
public SdcctXpathSelector load(@Nullable DynamicXpathOptions dynamicOpts) {
XPathExpression expr = this.getUnderlyingExpression();
IndependentContext staticContext = this.getUnderlyingStaticContext();
Map<StructuredQName, XPathVariable> declaredVars = SdcctIteratorUtils.stream(staticContext.iterateExternalVariables())
.collect(SdcctStreamUtils.toMap(XPathVariable::getVariableQName, Function.identity(), LinkedHashMap::new));
boolean staticOptsAvailable = (this.staticOpts != null), dynamicOptsAvailable = (dynamicOpts != null);
SdcctSaxonController controller = new SdcctSaxonController(this.proc.getUnderlyingConfiguration());
if (dynamicOptsAvailable && dynamicOpts.hasContextData()) {
controller.getContextData().putAll(dynamicOpts.getContextData());
}
try {
// noinspection ConstantConditions
XPathDynamicContext dynamicContext =
expr.createDynamicContext(controller, ((dynamicOptsAvailable && dynamicOpts.hasContextItem()) ? dynamicOpts.getContextItem() : null));
SdcctXpathSelector selector = new SdcctXpathSelector(expr, this.staticOpts, dynamicOpts, dynamicContext, declaredVars);
Map<QName, XdmValue> vars = new LinkedHashMap<>();
if (staticOptsAvailable && this.staticOpts.hasVariables()) {
vars.putAll(this.staticOpts.getVariables());
}
if (dynamicOptsAvailable && dynamicOpts.hasVariables()) {
vars.putAll(dynamicOpts.getVariables());
}
for (QName varQname : vars.keySet()) {
selector.setVariable(varQname, vars.get(varQname));
}
return selector;
} catch (SaxonApiException | XPathException e) {
throw new SaxonApiUncheckedException(e);
}
}
示例8: constructAtomicDatatype
import net.sf.saxon.om.StructuredQName; //导入依赖的package包/类
private Datatype constructAtomicDatatype(final QName qn, final boolean allowsEmpty, final boolean allowsMultiple) {
String localName = qn.getLocalName();
StructuredQName baseType = new StructuredQName(qn.getPrefix(), qn.getNamespaceURI(), (allowsMultiple|allowsEmpty) ? localName.substring(0, localName.length()-1) : localName);
BuiltInAtomicType theType = null;
for(BuiltInAtomicType type:ATOMIC_TYPES) {
if(type.getStructuredQName().equals(baseType)) {
theType = type;
break;
}
}
if(theType==null) {
throw new IllegalArgumentException("Unable to determine datatype of "+qn.getEQName());
}
final StringConverter converter = theType.getStringConverter(conversionRules);
return new Datatype() {
@Override
public boolean isAtomic() { return true; }
@Override
public boolean allowsMultiple() { return allowsMultiple; }
@Override
public boolean allowsEmpty() { return allowsEmpty; }
@Override
public XdmValue convert(String input, Configuration configuration) throws ValidationException {
if(input==null && allowsEmpty()) return XdmValue.wrap(null);
else if(input==null) throw new ValidationException(qn.toString()+" does not allow empty sequence");
if(allowsMultiple()) {
String sValue = input.trim();
if(sValue.startsWith("(") && sValue.endsWith(")")) {
sValue = sValue.substring(1, sValue.length()-1);
}
String[] values = sValue.split("[ ]*,[ ]*");
if(values.length>1) {
XdmValue xValue = null;
// certainly could be optimized, but I do not expect having 1000 values in a parameter definition...
for(String value:values) {
XdmValue ret = XdmValue.wrap(converter.convertString(value).asAtomic());
if(xValue==null) {
xValue = ret;
} else {
xValue= xValue.append(ret);
}
}
return xValue;
} else if(values.length==1) {
return XdmValue.wrap(converter.convertString(values[0]).asAtomic());
} else {
throw new ValidationException("can not cast "+input+" to "+qn);
}
} else {
return XdmValue.wrap(converter.convertString(input).asAtomic());
}
}
};
}
示例9: getFunctionSignature
import net.sf.saxon.om.StructuredQName; //导入依赖的package包/类
public SequenceType[] getFunctionSignature(StructuredQName functionName, int arity) {
return myLibrary.getFunctionSignature(functionName, arity);
}
示例10: getFunctionQName
import net.sf.saxon.om.StructuredQName; //导入依赖的package包/类
@Override
public StructuredQName getFunctionQName() {
return new StructuredQName("", "http://mytest/", "myExtensionFunction2");
}
示例11: getFunctionQName
import net.sf.saxon.om.StructuredQName; //导入依赖的package包/类
@Override
public StructuredQName getFunctionQName() {
return new StructuredQName("", "http://mytest/", "myExtensionFunction1");
}
示例12: getFunctionQName
import net.sf.saxon.om.StructuredQName; //导入依赖的package包/类
@Override
public StructuredQName getFunctionQName() {
return new StructuredQName("efx", "http://test/saxon/ext", "simple");
}
示例13: getFunctionQName
import net.sf.saxon.om.StructuredQName; //导入依赖的package包/类
@Override
public StructuredQName getFunctionQName() {
return new StructuredQName(SaxonEnvironment.FOX_NS_PREFIX, SaxonEnvironment.FOX_NS_URI, "pager-status");
}
示例14: getFunctionQName
import net.sf.saxon.om.StructuredQName; //导入依赖的package包/类
@Override
public StructuredQName getFunctionQName() {
return qName;
}
示例15: getFunctionQName
import net.sf.saxon.om.StructuredQName; //导入依赖的package包/类
@Override
public StructuredQName getFunctionQName() {
return new StructuredQName(SaxonEnvironment.FOX_NS_PREFIX, SaxonEnvironment.FOX_NS_URI, "pluralise");
}