1. // $Id: Result.java,v 1.2 2003/10/22 03:53:16 jsuttor Exp $
  2. /*
  3. * @(#)Result.java 1.13 04/07/26
  4. *
  5. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  6. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  7. */
  8. package javax.xml.transform;
  9. /**
  10. * <p>An object that implements this interface contains the information
  11. * needed to build a transformation result tree.</p>
  12. *
  13. * @author <a href="Jeff.Suttor@Sun.com">Jeff Suttor</a>
  14. */
  15. public interface Result {
  16. /**
  17. * The name of the processing instruction that is sent if the
  18. * result tree disables output escaping.
  19. *
  20. * <p>Normally, result tree serialization escapes & and < (and
  21. * possibly other characters) when outputting text nodes.
  22. * This ensures that the output is well-formed XML. However,
  23. * it is sometimes convenient to be able to produce output that is
  24. * almost, but not quite well-formed XML; for example,
  25. * the output may include ill-formed sections that will
  26. * be transformed into well-formed XML by a subsequent non-XML aware
  27. * process. If a processing instruction is sent with this name,
  28. * serialization should be output without any escaping. </p>
  29. *
  30. * <p>Result DOM trees may also have PI_DISABLE_OUTPUT_ESCAPING and
  31. * PI_ENABLE_OUTPUT_ESCAPING inserted into the tree.</p>
  32. *
  33. * @see <a href="http://www.w3.org/TR/xslt#disable-output-escaping">disable-output-escaping in XSLT Specification</a>
  34. */
  35. public static final String PI_DISABLE_OUTPUT_ESCAPING =
  36. "javax.xml.transform.disable-output-escaping";
  37. /**
  38. * The name of the processing instruction that is sent
  39. * if the result tree enables output escaping at some point after having
  40. * received a PI_DISABLE_OUTPUT_ESCAPING processing instruction.
  41. *
  42. * @see <a href="http://www.w3.org/TR/xslt#disable-output-escaping">disable-output-escaping in XSLT Specification</a>
  43. */
  44. public static final String PI_ENABLE_OUTPUT_ESCAPING =
  45. "javax.xml.transform.enable-output-escaping";
  46. /**
  47. * Set the system identifier for this Result.
  48. *
  49. * <p>If the Result is not to be written to a file, the system identifier is optional.
  50. * The application may still want to provide one, however, for use in error messages
  51. * and warnings, or to resolve relative output identifiers.</p>
  52. *
  53. * @param systemId The system identifier as a URI string.
  54. */
  55. public void setSystemId(String systemId);
  56. /**
  57. * Get the system identifier that was set with setSystemId.
  58. *
  59. * @return The system identifier that was set with setSystemId,
  60. * or null if setSystemId was not called.
  61. */
  62. public String getSystemId();
  63. }