gpt4 book ai didi

org.apache.xerces.impl.XMLErrorReporter.setDocumentLocator()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-23 16:53:05 27 4
gpt4 key购买 nike

本文整理了Java中org.apache.xerces.impl.XMLErrorReporter.setDocumentLocator()方法的一些代码示例,展示了XMLErrorReporter.setDocumentLocator()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLErrorReporter.setDocumentLocator()方法的具体详情如下:
包路径:org.apache.xerces.impl.XMLErrorReporter
类名称:XMLErrorReporter
方法名:setDocumentLocator

XMLErrorReporter.setDocumentLocator介绍

[英]Sets the document locator.
[中]设置文档定位器。

代码示例

代码示例来源:origin: com.rackspace.apache/xerces2-xsd11

private void setErrorReporter(XMLErrorReporter reporter) {
  fErrorReporter = reporter;
  if (fErrorReporter != null) {
    fErrorReporter.putMessageFormatter(
      XIncludeMessageFormatter.XINCLUDE_DOMAIN, fXIncludeMessageFormatter);
    // this ensures the proper location is displayed in error messages
    if (fDocLocation != null) {
      fErrorReporter.setDocumentLocator(fDocLocation);
    }
  }
}

代码示例来源:origin: com.rackspace.apache/xerces2-xsd11

/** Setup for validation. **/
final void setup(Location location, StAXResult result, boolean stringsInternalized) {
  fDepth = 0;
  fComponentManager.reset();
  setupStAXResultHandler(result);
  fValidationManager.setEntityState(this);
  if (fEntities != null && !fEntities.isEmpty()) {
    // should only clear this if the last document contained unparsed entities
    fEntities.clear();
  }
  fStAXLocationWrapper.setLocation(location);
  fErrorReporter.setDocumentLocator(fStAXLocationWrapper);
  fStringsInternalized = stringsInternalized;
}

代码示例来源:origin: com.rackspace.apache/xerces2-xsd11

protected void reset() {
  super.reset();
  fDTDScanner.reset();
  fEntityManager.reset();
  fErrorReporter.setDocumentLocator(fEntityManager.getEntityScanner());
}

代码示例来源:origin: com.rackspace.apache/xerces2-xsd11

fErrorReporter.setDocumentLocator(fEntityManager.getEntityScanner());
fProperties.put(ERROR_REPORTER, fErrorReporter);
addCommonComponent(fErrorReporter);

代码示例来源:origin: com.rackspace.apache/xerces2-xsd11

public void startDocument() throws SAXException {
  fComponentManager.reset();
  fSchemaValidator.setDocumentHandler(this);
  fValidationManager.setEntityState(this);
  fTypeInfoProvider.finishStartElement(); // cleans up TypeInfoProvider
  fNeedPushNSContext = true;
  if (fUnparsedEntities != null && !fUnparsedEntities.isEmpty()) {
    // should only clear this if the last document contained unparsed entities
    fUnparsedEntities.clear();
  }
  fErrorReporter.setDocumentLocator(fSAXLocatorWrapper);
  try {
    fSchemaValidator.startDocument(fSAXLocatorWrapper, fSAXLocatorWrapper.getEncoding(), fNamespaceContext, null);
  }
  catch (XMLParseException e) {
    throw Util.toSAXParseException(e);
  }
  catch (XNIException e) {
    throw Util.toSAXException(e);
  }
}

代码示例来源:origin: com.rackspace.apache/xerces2-xsd11

fErrorReporter.setDocumentLocator(fEntityManager.getEntityScanner());
fProperties.put(ERROR_REPORTER, fErrorReporter);
addCommonComponent(fErrorReporter);

代码示例来源:origin: com.rackspace.apache/xerces2-xsd11

fErrorReporter.setDocumentLocator(fEntityManager.getEntityScanner());
fProperties.put(ERROR_REPORTER, fErrorReporter);
addCommonComponent(fErrorReporter);

代码示例来源:origin: com.rackspace.apache/xerces2-xsd11

fXMLLocator.setLiteralSystemId(systemId);
fXMLLocator.setExpandedSystemId(systemId);
fErrorReporter.setDocumentLocator(fXMLLocator);
try {

代码示例来源:origin: com.rackspace.apache/xerces2-xsd11

fErrorReporter.setDocumentLocator(fEntityManager.getEntityScanner());
fProperties.put(ERROR_REPORTER, fErrorReporter);
addComponent(fErrorReporter);

代码示例来源:origin: com.rackspace.apache/xerces2-xsd11

/**
 * Reset the reference to the appropriate scanner given the version of the
 * document and start document scanning.
 * @param scanner - the scanner to use
 * @param version - the version of the document (XML 1.1 or XML 1.0).
 */
public void startDocumentParsing(XMLEntityHandler scanner, short version){
  if (version == Constants.XML_VERSION_1_0){
    fEntityManager.setScannerVersion(Constants.XML_VERSION_1_0);
  }
  else {
    fEntityManager.setScannerVersion(Constants.XML_VERSION_1_1);
  }
  // Make sure the locator used by the error reporter is the current entity scanner.
  fErrorReporter.setDocumentLocator(fEntityManager.getEntityScanner());
  
  // Note: above we reset fEntityScanner in the entity manager, thus in startEntity
  // in each scanner fEntityScanner field must be reset to reflect the change.
  // 
  fEntityManager.setEntityHandler(scanner);
  
  scanner.startEntity(fXMLSymbol, fEntityManager.getCurrentResourceIdentifier(), fEncoding, null);        
}

代码示例来源:origin: com.rackspace.apache/xerces2-xsd11

fErrorReporter.setDocumentLocator(fEntityManager.getEntityScanner());
fProperties.put(ERROR_REPORTER, fErrorReporter);
addComponent(fErrorReporter);

代码示例来源:origin: com.rackspace.apache/xerces2-xsd11

fErrorReporter.setDocumentLocator(locator);

代码示例来源:origin: com.thaiopensource/jing

ValidatorImpl(SymbolTable symbolTable, XMLGrammarPool grammarPool, PropertyMap properties) {
 this.symbolTable = symbolTable;
 XMLErrorHandler errorHandlerWrapper = new ErrorHandlerWrapper(properties.get(ValidateProperty.ERROR_HANDLER));
 components = new XMLComponent[] { errorReporter, schemaValidator };
 for (int i = 0; i < components.length; i++) {
  addRecognizedFeatures(components[i].getRecognizedFeatures());
  addRecognizedProperties(components[i].getRecognizedProperties());
 }
 addRecognizedFeatures(recognizedFeatures);
 addRecognizedProperties(recognizedProperties);
 setFeature(Features.SCHEMA_AUGMENT_PSVI, false);
 setFeature(Features.SCHEMA_FULL_CHECKING, true);
 setFeature(Features.VALIDATION, true);
 setFeature(Features.SCHEMA_VALIDATION, true);
 setProperty(Properties.XMLGRAMMAR_POOL, grammarPool);
 setProperty(Properties.SYMBOL_TABLE, symbolTable);
 errorReporter.setDocumentLocator(this);
 setProperty(Properties.ERROR_REPORTER, errorReporter);
 setProperty(Properties.ERROR_HANDLER, errorHandlerWrapper);
 setProperty(Properties.VALIDATION_MANAGER, validationManager);
 // In Xerces 2.4.0, XMLSchemaValidator uses ENTITY_MANAGER when
 // it should use ENTITY_RESOLVER
 // setProperty(Properties.ENTITY_MANAGER, this);
 setProperty(Properties.ENTITY_RESOLVER, this);
 reset();
}

代码示例来源:origin: org.daisy.libs/jing

ValidatorImpl(SymbolTable symbolTable, XMLGrammarPool grammarPool, PropertyMap properties) {
 this.symbolTable = symbolTable;
 XMLErrorHandler errorHandlerWrapper = new ErrorHandlerWrapper(properties.get(ValidateProperty.ERROR_HANDLER));
 components = new XMLComponent[] { errorReporter, schemaValidator, entityManager };
 for (int i = 0; i < components.length; i++) {
  addRecognizedFeatures(components[i].getRecognizedFeatures());
  addRecognizedProperties(components[i].getRecognizedProperties());
 }
 addRecognizedFeatures(recognizedFeatures);
 addRecognizedProperties(recognizedProperties);
 setFeature(Features.SCHEMA_AUGMENT_PSVI, false);
 setFeature(Features.SCHEMA_FULL_CHECKING, true);
 setFeature(Features.VALIDATION, true);
 setFeature(Features.SCHEMA_VALIDATION, true);
 setFeature(Features.ID_IDREF_CHECKING, true);
 setFeature(Features.IDC_CHECKING, true);
 setProperty(Properties.XMLGRAMMAR_POOL, grammarPool);
 setProperty(Properties.SYMBOL_TABLE, symbolTable);
 errorReporter.setDocumentLocator(this);
 setProperty(Properties.ERROR_REPORTER, errorReporter);
 setProperty(Properties.ERROR_HANDLER, errorHandlerWrapper);
 setProperty(Properties.VALIDATION_MANAGER, validationManager);
 setProperty(Properties.ENTITY_MANAGER, entityManager);
 setProperty(Properties.ENTITY_RESOLVER, this);
 reset();
}

代码示例来源:origin: com.rackspace.apache/xerces2-xsd11

fErrorReporter.setDocumentLocator(fDocLocation);
fErrorReporter.setDocumentLocator(fDocLocation);
fErrorReporter.setDocumentLocator(fDocLocation);

代码示例来源:origin: com.rackspace.apache/xerces2-xsd11

fErrorReporter.setDocumentLocator(fEntityManager.getEntityScanner());
setProperty(ERROR_REPORTER, fErrorReporter);
addComponent(fErrorReporter);

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com