当前位置: 首页>>代码示例>>Java>>正文


Java StructuredQName类代码示例

本文整理汇总了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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:39,代码来源:Saxon9Support.java

示例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);
    }
}
 
开发者ID:esacinc,项目名称:sdcct,代码行数:17,代码来源:SdcctLocation.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:Saxon9StyleFrame.java

示例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;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:Saxon9StyleFrame.java

示例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");
}
 
开发者ID:erfgoed-en-locatie,项目名称:artsholland-platform,代码行数:6,代码来源:ExtractStreetNumberFunction.java

示例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;
}
 
开发者ID:esacinc,项目名称:sdcct,代码行数:11,代码来源:SdcctXpathSelector.java

示例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);
    }
}
 
开发者ID:esacinc,项目名称:sdcct,代码行数:38,代码来源:SdcctXpathExecutable.java

示例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());
            }
        }
    };
}
 
开发者ID:cmarchand,项目名称:gaulois-pipe,代码行数:55,代码来源:DatatypeFactory.java

示例9: getFunctionSignature

import net.sf.saxon.om.StructuredQName; //导入依赖的package包/类
public SequenceType[] getFunctionSignature(StructuredQName functionName, int arity) {
  return myLibrary.getFunctionSignature(functionName, arity);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:Saxon9StyleFrame.java

示例10: getFunctionQName

import net.sf.saxon.om.StructuredQName; //导入依赖的package包/类
@Override
public StructuredQName getFunctionQName() {
    return new StructuredQName("", "http://mytest/", "myExtensionFunction2");
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:5,代码来源:MyExtensionFunction2.java

示例11: getFunctionQName

import net.sf.saxon.om.StructuredQName; //导入依赖的package包/类
@Override
public StructuredQName getFunctionQName() {
    return new StructuredQName("", "http://mytest/", "myExtensionFunction1");
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:5,代码来源:MyExtensionFunction1.java

示例12: getFunctionQName

import net.sf.saxon.om.StructuredQName; //导入依赖的package包/类
@Override
public StructuredQName getFunctionQName() {
    return new StructuredQName("efx", "http://test/saxon/ext", "simple");
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:5,代码来源:XQueryWithExtensionTest.java

示例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");
}
 
开发者ID:Fivium,项目名称:FOXopen,代码行数:5,代码来源:PagerStatusFunction.java

示例14: getFunctionQName

import net.sf.saxon.om.StructuredQName; //导入依赖的package包/类
@Override
public StructuredQName getFunctionQName() {
  return qName;
}
 
开发者ID:Armatiek,项目名称:xslweb,代码行数:5,代码来源:AddRequest.java

示例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");
}
 
开发者ID:Fivium,项目名称:FOXopen,代码行数:5,代码来源:PluraliseFunction.java


注:本文中的net.sf.saxon.om.StructuredQName类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。