示例#1
0
 private ValueRepresentation getValue(Object jso) throws XPathException {
   SequenceIterator iterator = IXSLFunction.convertFromJavaScript(jso, processor.config);
   if (iterator instanceof JsArrayIterator) {
     return (ValueRepresentation) iterator;
   } else {
     return iterator.next();
   }
 }
示例#2
0
  /**
   * Returns the value of the parameter as a String.
   *
   * @param namespaceURI the parameter namespace
   * @param localName the local name of the parameter
   * @return the string value of the parameter
   */
  public Object getParameter(String namespaceURI, String localName) {
    String ns = (namespaceURI == null) ? "" : namespaceURI;
    try {

      StructuredQName qn = new StructuredQName("", ns, localName);
      ValueRepresentation vr = controller.getParameter(qn);
      return IXSLFunction.convertToJavaScript(vr);
    } catch (Exception e) {
      Xslt20ProcessorImpl.handleException(e, "getParameter");
    }
    return null;
  }