예제 #1
0
  public void startElement(String uri, String localName, String qName, Attributes atts)
      throws SAXException {
    if (fNeedPushNSContext) {
      fNamespaceContext.pushContext();
    }
    fNeedPushNSContext = true;

    // Fill element QName
    fillQName(fElementQName, uri, localName, qName);

    // Fill XMLAttributes
    if (atts instanceof Attributes2) {
      fillXMLAttributes2((Attributes2) atts);
    } else {
      fillXMLAttributes(atts);
    }

    try {
      fSchemaValidator.startElement(fElementQName, fAttributes, null);
    } catch (XMLParseException e) {
      throw Util.toSAXParseException(e);
    } catch (XNIException e) {
      throw Util.toSAXException(e);
    }
  }
예제 #2
0
 public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
   try {
     fTempString.setValues(ch, start, length);
     fSchemaValidator.ignorableWhitespace(fTempString, null);
   } catch (XMLParseException e) {
     throw Util.toSAXParseException(e);
   } catch (XNIException e) {
     throw Util.toSAXException(e);
   }
 }
예제 #3
0
 public void endDocument() throws SAXException {
   fSAXLocatorWrapper.setLocator(null);
   try {
     fSchemaValidator.endDocument(null);
   } catch (XMLParseException e) {
     throw Util.toSAXParseException(e);
   } catch (XNIException e) {
     throw Util.toSAXException(e);
   }
 }
예제 #4
0
 public void endElement(String uri, String localName, String qName) throws SAXException {
   fillQName(fElementQName, uri, localName, qName);
   try {
     fSchemaValidator.endElement(fElementQName, null);
   } catch (XMLParseException e) {
     throw Util.toSAXParseException(e);
   } catch (XNIException e) {
     throw Util.toSAXException(e);
   } finally {
     fNamespaceContext.popContext();
   }
 }
예제 #5
0
 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);
   }
 }