1. /*
  2. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  3. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  4. */
  5. /*
  6. * @(#)URIResolver.java 1.8 03/01/23
  7. */
  8. package javax.xml.transform;
  9. /**
  10. * <p>An object that implements this interface that can be called by the processor
  11. * to turn a URI used in document(), xsl:import, or xsl:include into a Source object.
  12. */
  13. public interface URIResolver {
  14. /**
  15. * Called by the processor when it encounters
  16. * an xsl:include, xsl:import, or document() function.
  17. *
  18. * @param href An href attribute, which may be relative or absolute.
  19. * @param base The base URI in effect when the href attribute
  20. * was encountered.
  21. *
  22. * @return A Source object, or null if the href cannot be resolved,
  23. * and the processor should try to resolve the URI itself.
  24. *
  25. * @throws TransformerException if an error occurs when trying to
  26. * resolve the URI.
  27. */
  28. public Source resolve(String href, String base)
  29. throws TransformerException;
  30. }