1. /*
  2. * Copyright 2000-2002,2004 The Apache Software Foundation
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. *
  16. */
  17. package org.apache.tools.ant.taskdefs;
  18. import java.io.File;
  19. /**
  20. * Proxy interface for XSLT processors.
  21. *
  22. * @see XSLTProcess
  23. * @since Ant 1.1
  24. */
  25. public interface XSLTLiaison {
  26. /**
  27. * the file protocol prefix for systemid.
  28. * This file protocol must be appended to an absolute path.
  29. * Typically: <tt>FILE_PROTOCOL_PREFIX + file.getAbsolutePath()</tt>
  30. * Note that on Windows, an extra '/' must be appended to the
  31. * protocol prefix so that there is always 3 consecutive slashes.
  32. * @since Ant 1.4
  33. */
  34. String FILE_PROTOCOL_PREFIX = "file://";
  35. /**
  36. * set the stylesheet to use for the transformation.
  37. * @param stylesheet the stylesheet to be used for transformation.
  38. * @throws Exception thrown if any problems happens.
  39. * @since Ant 1.4
  40. */
  41. void setStylesheet(File stylesheet) throws Exception;
  42. /**
  43. * Add a parameter to be set during the XSL transformation.
  44. * @param name the parameter name.
  45. * @param expression the parameter value as an expression string.
  46. * @throws Exception thrown if any problems happens.
  47. * @since Ant 1.3
  48. */
  49. void addParam(String name, String expression) throws Exception;
  50. /**
  51. * Perform the transformation of a file into another.
  52. * @param infile the input file, probably an XML one. :-)
  53. * @param outfile the output file resulting from the transformation
  54. * @throws Exception thrown if any problems happens.
  55. * @see #setStylesheet(File)
  56. * @since Ant 1.4
  57. */
  58. void transform(File infile, File outfile) throws Exception;
  59. } //-- XSLTLiaison