Beispiel #1
0
 public void setInitialTemplate(String template) {
   try {
     controller.setInitialTemplate(template);
   } catch (Exception e) {
     Xslt20ProcessorImpl.handleException(e, "setInitialTemplate");
   }
 }
Beispiel #2
0
 public void setInitialMode(String mode) {
   try {
     controller.setInitialMode(mode);
   } catch (Exception e) {
     Xslt20ProcessorImpl.handleException(e, "setInitialMode");
   }
 }
Beispiel #3
0
  /**
   * Deletes a parameter value set using the setParameter method
   *
   * @param namespaceURI the parameter namespace
   * @param localName the local name of the parameter
   */
  public void removeParameter(String namespaceURI, String localName) {
    String ns = (namespaceURI == null) ? "" : namespaceURI;
    try {

      StructuredQName qn = new StructuredQName("", ns, localName);
      controller.removeParameter(qn);
    } catch (Exception e) {
      Xslt20ProcessorImpl.handleException(e, "getParameter");
    }
  }
Beispiel #4
0
  // extension required to set any sequence of items (xdmValue) as a parameter as per XSLT2.0 spec
  // but emphasis initially on string, boolean and integer
  public void setParameter(String namespaceURI, String localName, Object value) {

    String ns = (namespaceURI == null) ? "" : namespaceURI;

    try {
      StructuredQName qn = new StructuredQName("", ns, localName);
      controller.setParameter(qn, getValue(value));
    } catch (Exception e) {
      Xslt20ProcessorImpl.handleException(e, "setParameter");
    }
  }
Beispiel #5
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;
  }
Beispiel #6
0
 public void setSuccess(JavaScriptObject success) {
   processor.setSuccess(success, this);
 }
Beispiel #7
0
 // what happens if the imported node is modified, do we use a
 // cached stylesheet?
 public void importStylesheet(JavaScriptObject stylesheet) {
   processor.importStylesheet(stylesheet);
 }
Beispiel #8
0
 public XSLT20Processor() {
   processor = new Xslt20ProcessorImpl();
   // get an 'inert' controller instance - used only for getting/setting controller properties
   controller = processor.getController();
   SaxonceApi.setProcessorWasJsInitiated();
 }
Beispiel #9
0
 public XSLT20Processor(JavaScriptObject stylesheet) {
   this(); // call constructor
   if (stylesheet != null) {
     processor.importStylesheet(stylesheet);
   }
 }
Beispiel #10
0
 // for XSLT 2.0 sourceNode may be null
 public Node transformToFragment(JavaScriptObject sourceNode, Document ownerDocument) {
   return processor.transformToFragment(sourceNode, ownerDocument);
 }
Beispiel #11
0
 // for XSLT 2.0 sourceNode may be null
 public Document transformToDocument(JavaScriptObject sourceNode) {
   return (Document) processor.transformToDocument(sourceNode);
 }
Beispiel #12
0
 public void transformToHTMLFragment(JavaScriptObject sourceObject, Document targetDocument) {
   processor.updateHTMLDocument(
       sourceObject, targetDocument, APIcommand.TRANSFORM_TO_HTML_FRAGMENT);
 }
Beispiel #13
0
 // for XSLT 2.0 sourceNode may be null
 public void updateHTMLDocument(JavaScriptObject sourceObject, Document targetDocument) {
   processor.updateHTMLDocument(sourceObject, targetDocument, APIcommand.UPDATE_HTML);
 }
Beispiel #14
0
 /** Restore the XSLTProcessor20 instance to its default state */
 public void reset() {
   controller.reset();
   processor.deregisterEventHandlers();
 }
Beispiel #15
0
 public JavaScriptObject getSuccess() {
   return processor.getSuccess();
 }