|
||||
File indexing completed on 2025-01-18 10:14:51
0001 /* 0002 * Licensed to the Apache Software Foundation (ASF) under one or more 0003 * contributor license agreements. See the NOTICE file distributed with 0004 * this work for additional information regarding copyright ownership. 0005 * The ASF licenses this file to You under the Apache License, Version 2.0 0006 * (the "License"); you may not use this file except in compliance with 0007 * the License. You may obtain a copy of the License at 0008 * 0009 * http://www.apache.org/licenses/LICENSE-2.0 0010 * 0011 * Unless required by applicable law or agreed to in writing, software 0012 * distributed under the License is distributed on an "AS IS" BASIS, 0013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 0014 * See the License for the specific language governing permissions and 0015 * limitations under the License. 0016 */ 0017 0018 /* 0019 * $Id$ 0020 */ 0021 0022 #if !defined(XERCESC_INCLUDE_GUARD_DOMLSRESOURCERESOLVER_HPP) 0023 #define XERCESC_INCLUDE_GUARD_DOMLSRESOURCERESOLVER_HPP 0024 0025 #include <xercesc/util/XercesDefs.hpp> 0026 0027 XERCES_CPP_NAMESPACE_BEGIN 0028 0029 0030 class DOMLSInput; 0031 0032 /** 0033 * DOMLSResourceResolver provides a way for applications to redirect references 0034 * to external entities. 0035 * 0036 * <p>Applications needing to implement customized handling for external 0037 * entities must implement this interface and register their implementation 0038 * by setting the entityResolver attribute of the DOMLSParser.</p> 0039 * 0040 * <p>The DOMLSParser will then allow the application to intercept any 0041 * external entities (including the external DTD subset and external parameter 0042 * entities) before including them.</p> 0043 * 0044 * <p>Many DOM applications will not need to implement this interface, but it 0045 * will be especially useful for applications that build XML documents from 0046 * databases or other specialized input sources, or for applications that use 0047 * URNs.</p> 0048 * 0049 * @see DOMLSParser#getDomConfig 0050 * @see DOMLSInput#DOMLSInput 0051 * @since DOM Level 3 0052 */ 0053 class CDOM_EXPORT DOMLSResourceResolver 0054 { 0055 protected: 0056 // ----------------------------------------------------------------------- 0057 // Hidden constructors 0058 // ----------------------------------------------------------------------- 0059 /** @name Hidden constructors */ 0060 //@{ 0061 DOMLSResourceResolver() {}; 0062 //@} 0063 0064 private: 0065 // ----------------------------------------------------------------------- 0066 // Unimplemented constructors and operators 0067 // ----------------------------------------------------------------------- 0068 /** @name Unimplemented constructors and operators */ 0069 //@{ 0070 DOMLSResourceResolver(const DOMLSResourceResolver &); 0071 DOMLSResourceResolver & operator = (const DOMLSResourceResolver &); 0072 //@} 0073 0074 public: 0075 // ----------------------------------------------------------------------- 0076 // All constructors are hidden, just the destructor is available 0077 // ----------------------------------------------------------------------- 0078 /** @name Destructor */ 0079 //@{ 0080 /** 0081 * Destructor 0082 * 0083 */ 0084 virtual ~DOMLSResourceResolver() {}; 0085 //@} 0086 0087 // ----------------------------------------------------------------------- 0088 // Virtual DOMLSResourceResolver interface 0089 // ----------------------------------------------------------------------- 0090 /** @name Functions introduced in DOM Level 3 */ 0091 //@{ 0092 /** 0093 * Allow the application to resolve external resources. 0094 * 0095 * The <code>DOMLSParser</code> will call this method before opening any external resource, 0096 * including the external DTD subset, external entities referenced within the DTD, and 0097 * external entities referenced within the document element (however, the top-level 0098 * document entity is not passed to this method). The application may then request that 0099 * the <code>DOMLSParser</code> resolve the external resource itself, that it use an 0100 * alternative URI, or that it use an entirely different input source. 0101 * 0102 * Application writers can use this method to redirect external system identifiers to 0103 * secure and/or local URI, to look up public identifiers in a catalogue, or to read 0104 * an entity from a database or other input source (including, for example, a dialog box). 0105 * 0106 * The returned DOMLSInput is owned by the DOMLSParser which is 0107 * responsible to clean up the memory. 0108 * 0109 * @param resourceType The type of the resource being resolved. For XML [XML 1.0] resources 0110 * (i.e. entities), applications must use the value "http://www.w3.org/TR/REC-xml". 0111 * For XML Schema [XML Schema Part 1], applications must use the value 0112 * "http://www.w3.org/2001/XMLSchema". Other types of resources are outside 0113 * the scope of this specification and therefore should recommend an absolute 0114 * URI in order to use this method. 0115 * @param namespaceUri The namespace of the resource being resolved, e.g. the target namespace 0116 * of the XML Schema [XML Schema Part 1] when resolving XML Schema resources. 0117 * @param publicId The public identifier of the external entity being referenced, or <code>null</code> 0118 * if no public identifier was supplied or if the resource is not an entity. 0119 * @param systemId The system identifier, a URI reference [IETF RFC 2396], of the external 0120 * resource being referenced, or <code>null</code> if no system identifier was supplied. 0121 * @param baseURI The absolute base URI of the resource being parsed, or <code>null</code> if 0122 * there is no base URI. 0123 * @return A DOMLSInput object describing the new input source, 0124 * or <code>null</code> to request that the parser open a regular 0125 * URI connection to the resource. 0126 * The returned DOMLSInput is owned by the DOMLSParser which is 0127 * responsible to clean up the memory. 0128 * @see DOMLSInput#DOMLSInput 0129 * @since DOM Level 3 0130 */ 0131 virtual DOMLSInput* resolveResource( const XMLCh* const resourceType 0132 , const XMLCh* const namespaceUri 0133 , const XMLCh* const publicId 0134 , const XMLCh* const systemId 0135 , const XMLCh* const baseURI) = 0; 0136 0137 //@} 0138 0139 }; 0140 0141 XERCES_CPP_NAMESPACE_END 0142 0143 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |