📄 domconfiguration.hpp
字号:
/* * The Apache Software License, Version 1.1 * * Copyright (c) 2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. The end-user documentation included with the redistribution, * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * * 4. The names "Xerces" and "Apache Software Foundation" must * not be used to endorse or promote products derived from this * software without prior written permission. For written * permission, please contact apache\@apache.org. * * 5. Products derived from this software may not be called "Apache", * nor may "Apache" appear in their name, without prior written * permission of the Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation, and was * originally based on software copyright (c) 2001, International * Business Machines, Inc., http://www.ibm.com . For more information * on the Apache Software Foundation, please see * <http://www.apache.org/>. */#if !defined(DOMCONFIGURATION_HPP)#define DOMCONFIGURATION_HPP//------------------------------------------------------------------------------------// Includes//------------------------------------------------------------------------------------#include <xercesc/util/XMLString.hpp>XERCES_CPP_NAMESPACE_BEGIN/** * The DOMConfiguration interface represents the configuration of * a document and maintains a table of recognized parameters. * using the configuration, it is possible to change * Document.normalizeDocument behavior, such as replacing * CDATASection nodes with Text nodes or * specifying the type of the schema that must be used when the * validation of the Document is requested. DOMConfiguration * objects are also used in [DOM Level 3 Load and Save] in * the DOMBuilder and DOMWriter interfaces. * * The DOMConfiguration distinguish two types of parameters: * boolean (boolean parameters) and DOMUserData * (parameters). The names used by the DOMConfiguration object are * defined throughout the DOM Level 3 specifications. Names are * case-insensitives. To avoid possible conflicts, as a * convention, names referring to boolean parameters and * parameters defined outside the DOM specification should be made * unique. Names are recommended to follow the XML name * production rule but it is not enforced by the DOM * implementation. DOM Level 3 Core Implementations are required * to recognize all boolean parameters and parameters defined in * this specification. Each boolean parameter state or parameter * value may then be supported or not by the implementation. Refer * to their definition to know if a state or a value must be * supported or not. * * Note: Parameters are similar to features and properties used in * SAX2 [SAX]. * * Issue DOMConfiguration-1: * Can we rename boolean parameters to "flags"? * * Issue DOMConfiguration-2: * Are boolean parameters and parameters within the same * scope for uniqueness? Which exception should be raised by * setBooleanParameter("error-handler", true)? * * The following list of parameters defined in the DOM: * * "error-handler" * [required] * A DOMErrorHandler object. If an error is * encountered in the document, the implementation will call * back the DOMErrorHandler registered using this * parameter. * When called, DOMError.relatedData will contain the * closest node to where the error occured. If the * implementation is unable to determine the node where the * error occurs, DOMError.relatedData will contain the * Document node. Mutations to the document from * within an error handler will result in implementation * dependent behaviour. * * Issue DOMConfiguration-4: * Should we say non "readonly" operations are * implementation dependent instead? * Resolution: Removed: "or re-invoking a validation * operation". * * "schema-type" * [optional] * A DOMString object containing an absolute URI and * representing the type of the schema language used to * validate a document against. Note that no lexical * checking is done on the absolute URI. * If this parameter is not set, a default value may be * provided by the implementation, based on the schema * languages supported and on the schema language used at * load time. * * Note: For XML Schema [XML Schema Part 1], * applications must use the value * "http://www.w3.org/2001/XMLSchema". For XML DTD * [XML 1.0], applications must use the value * "http://www.w3.org/TR/REC-xml". Other schema languages * are outside the scope of the W3C and therefore should * recommend an absolute URI in order to use this method. * * "schema-location" * [optional] * A DOMString object containing a list of URIs, * separated by white spaces (characters matching the * nonterminal production S defined in section 2.3 * [XML 1.0]), that represents the schemas against * which validation should occur. The types of schemas * referenced in this list must match the type specified * with schema-type, otherwise the behaviour of an * implementation is undefined. If the schema type is XML * Schema [XML Schema Part 1], only one of the XML * Schemas in the list can be with no namespace. * If validation occurs against a namespace aware schema, * i.e. XML Schema, and the targetNamespace of a schema * (specified using this property) matches the * targetNamespace of a schema occurring in the instance * document, i.e in schemaLocation attribute, the schema * specified by the user using this property will be used * (i.e., in XML Schema the schemaLocation attribute in the * instance document or on the import element will be * effectively ignored). * * Note: It is illegal to set the schema-location parameter * if the schema-type parameter value is not set. It is * strongly recommended that DOMInputSource.baseURI will be * set, so that an implementation can successfully resolve * any external entities referenced. * * The following list of boolean parameters (features) defined in * the DOM: * * "canonical-form" * * true * [optional] * Canonicalize the document according to the rules * specified in [Canonical XML]. Note that this * is limited to what can be represented in the DOM. * In particular, there is no way to specify the order * of the attributes in the DOM. * * Issue normalizationFeature-14: * What happen to other features? are they * ignored? if yes, how do you know if a feature * is ignored? * * false * [required] (default) * Do not canonicalize the document. * * "cdata-sections" * * true * [required] (default) * Keep CDATASection nodes in the document. * * Issue normalizationFeature-11: * Name does not work really well in this case. * ALH suggests renaming this to * "cdata-sections". It works for both load and * save. * Resolution: Renamed as suggested. (Telcon 27 * Jan 2002). * * false * [required] * Transform CDATASection nodes in the document * into Text nodes. The new Text node is * then combined with any adjacent Text node. * * "comments" * * true * [required] (default) * Keep Comment nodes in the document. * * false * [required] * Discard Comment nodes in the Document. * * "datatype-normalization" * * true * [required] * Exposed normalized values in the tree. * * Issue normalizationFeature-8: * We should define "datatype normalization". * Resolution: DTD normalization always apply * because it's part of XML 1.0. Clarify the * spec. (Telcon 27 Jan 2002). * * false * [required] (default) * Do not perform normalization on the tree. * * "discard-default-content" * * true * [required] (default) * Use whatever information available to the * implementation (i.e. XML schema, DTD, the specified * flag on Attr nodes, and so on) to decide what * attributes and content should be discarded or not. * Note that the specified flag on Attr nodes in * itself is not always reliable, it is only reliable * when it is set to false since the only case where * it can be set to false is if the attribute was * created by the implementation. The default content * won't be removed if an implementation does not have * any information available. * * Issue normalizationFeature-2: * How does exactly work? What's the comment * about level 1 implementations? * Resolution: Remove "Level 1" (Telcon 16 Jan * 2002). * * false * [required] * Keep all attributes and all content. * * "entities" * * true * [required] * Keep EntityReference and Entity nodes * in the document. *
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -