コード例 #1
0
 protected void setVariable(String name, ResultSequence values) {
   if (useNewApi) {
     staticContextBuilder.withVariable(
         new javax.xml.namespace.QName(name),
         new SimpleAtomicItemTypeImpl(
             BuiltinTypeLibrary.XS_ANYATOMICTYPE, ItemType.OCCURRENCE_NONE_OR_MANY));
     dynamicContextBuilder.withVariable(new javax.xml.namespace.QName(name), values);
   } else {
     dynamicContext.set_variable(new QName(name), values);
   }
 }
コード例 #2
0
 protected void setVariable(String name, AnyType value) {
   if (useNewApi) {
     String ns = staticContextBuilder.getDefaultNamespace();
     if (value != null) {
       staticContextBuilder.withVariable(
           new javax.xml.namespace.QName(ns, name),
           new SimpleAtomicItemTypeImpl(value.getTypeDefinition(), ItemType.OCCURRENCE_ONE));
     } else {
       staticContextBuilder.withVariable(
           new javax.xml.namespace.QName(ns, name),
           new SimpleAtomicItemTypeImpl(
               BuiltinTypeLibrary.XS_UNTYPEDATOMIC, ItemType.OCCURRENCE_OPTIONAL));
     }
     dynamicContextBuilder.withVariable(new javax.xml.namespace.QName(ns, name), value);
   } else {
     dynamicContext.set_variable(new QName(name), value);
   }
 }