1 package org.relaxng.datatype; 2 3 /** 4 * An interface that must be implemented by caller to 5 * provide context information that is necessary to 6 * perform validation of some Datatypes. 7 * 8 * @author <a HREF="mailto:jjc@jclark.com">James Clark</a> 9 * @author <a HREF="mailto:kohsuke.kawaguchi@sun.com">Kohsuke KAWAGUCHI</a> 10 */ 11 public interface ValidationContext { 12 13 /** 14 * Resolves a namespace prefix to the corresponding namespace URI. 15 * 16 * This method is used for validating the QName type, for example. 17 * 18 * <p> 19 * If the prefix is "" (empty string), it indicates 20 * an unprefixed value. The callee 21 * should resolve it as for an unprefixed 22 * element, rather than for an unprefixed attribute. 23 * 24 * <p> 25 * If the prefix is "xml", then the callee must resolve 26 * this prefix into "http://www.w3.org/XML/1998/namespace", 27 * as defined in the XML Namespaces Recommendation. 28 * 29 * @return 30 * namespace URI of this prefix. 31 * If the specified prefix is not declared, 32 * the implementation must return null. 33 */ 34 String resolveNamespacePrefix( String prefix ); 35 36 /** 37 * Returns the base URI of the context. The null string may be returned 38 * if no base URI is known. 39 */ 40 String getBaseUri(); 41 42 /** 43 * Checks if an unparsed entity is declared with the 44 * specified name. 45 * 46 * @return 47 * true 48 * if the DTD has an unparsed entity declaration for 49 * the specified name. 50 * false 51 * otherwise. 52 */ 53 boolean isUnparsedEntity( String entityName ); 54 55 /** 56 * Checks if a notation is declared with the 57 * specified name. 58 * 59 * @return 60 * true 61 * if the DTD has a notation declaration for the specified name. 62 * false 63 * otherwise. 64 */ 65 boolean isNotation( String notationName ); 66 } 67