当前位置: 首页>>代码示例>>Java>>正文


Java Constants.DOM_SPLIT_CDATA属性代码示例

本文整理汇总了Java中com.sun.org.apache.xerces.internal.impl.Constants.DOM_SPLIT_CDATA属性的典型用法代码示例。如果您正苦于以下问题:Java Constants.DOM_SPLIT_CDATA属性的具体用法?Java Constants.DOM_SPLIT_CDATA怎么用?Java Constants.DOM_SPLIT_CDATA使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.sun.org.apache.xerces.internal.impl.Constants的用法示例。


在下文中一共展示了Constants.DOM_SPLIT_CDATA属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: DOMParserImpl

/**
 * Constructs a DOM Builder using the specified parser configuration.
 */
public DOMParserImpl (XMLParserConfiguration config) {
    super (config);

    // add recognized features
    final String[] domRecognizedFeatures = {
        Constants.DOM_CANONICAL_FORM,
        Constants.DOM_CDATA_SECTIONS,
        Constants.DOM_CHARSET_OVERRIDES_XML_ENCODING,
        Constants.DOM_INFOSET,
        Constants.DOM_NAMESPACE_DECLARATIONS,
        Constants.DOM_SPLIT_CDATA,
        Constants.DOM_SUPPORTED_MEDIATYPES_ONLY,
        Constants.DOM_CERTIFIED,
        Constants.DOM_WELLFORMED,
        Constants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS,
    };

    fConfiguration.addRecognizedFeatures (domRecognizedFeatures);

    // turn off deferred DOM
    fConfiguration.setFeature (DEFER_NODE_EXPANSION, false);

    // Set values so that the value of the
    // infoset parameter is true (its default value).
    //
    // true: namespace-declarations, well-formed,
    // element-content-whitespace, comments, namespaces
    //
    // false: validate-if-schema, entities,
    // datatype-normalization, cdata-sections

    fConfiguration.setFeature(Constants.DOM_NAMESPACE_DECLARATIONS, true);
    fConfiguration.setFeature(Constants.DOM_WELLFORMED, true);
    fConfiguration.setFeature(INCLUDE_COMMENTS_FEATURE, true);
    fConfiguration.setFeature(INCLUDE_IGNORABLE_WHITESPACE, true);
    fConfiguration.setFeature(NAMESPACES, true);

    fConfiguration.setFeature(DYNAMIC_VALIDATION, false);
    fConfiguration.setFeature(CREATE_ENTITY_REF_NODES, false);
    fConfiguration.setFeature(CREATE_CDATA_NODES_FEATURE, false);

    // set other default values
    fConfiguration.setFeature (Constants.DOM_CANONICAL_FORM, false);
    fConfiguration.setFeature (Constants.DOM_CHARSET_OVERRIDES_XML_ENCODING, true);
    fConfiguration.setFeature (Constants.DOM_SPLIT_CDATA, true);
    fConfiguration.setFeature (Constants.DOM_SUPPORTED_MEDIATYPES_ONLY, false);
    fConfiguration.setFeature (Constants.DOM_IGNORE_UNKNOWN_CHARACTER_DENORMALIZATIONS, true);

    // REVISIT: by default Xerces assumes that input is certified.
    //          default is different from the one specified in the DOM spec
    fConfiguration.setFeature (Constants.DOM_CERTIFIED, true);

    // Xerces datatype-normalization feature is on by default
    // This is a recognized feature only for XML Schemas. If the
    // configuration doesn't support this feature, ignore it.
    try {
        fConfiguration.setFeature ( NORMALIZE_DATA, false );
    }
    catch (XMLConfigurationException exc) {}

}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:64,代码来源:DOMParserImpl.java


注:本文中的com.sun.org.apache.xerces.internal.impl.Constants.DOM_SPLIT_CDATA属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。