public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException { if (fNeedPushNSContext) { fNamespaceContext.pushContext(); } fNeedPushNSContext = true; // Fill element QName and XMLAttributes fillQName(fElementQName, uri, localName, qName); fillXMLAttributes(atts); // Add namespace declarations if necessary if (!fNamespacePrefixes) { final int prefixCount = fNamespaceContext.getDeclaredPrefixCount(); if (prefixCount > 0) { addNamespaceDeclarations(prefixCount); } } try { fSchemaDOMParser.startElement(fElementQName, fAttributes, null); } catch (XMLParseException e) { convertToSAXParseException(e); } catch (XNIException e) { convertToSAXException(e); } }
public void endElement(String uri, String localName, String qName) throws SAXException { fillQName(fElementQName, uri, localName, qName); try { fSchemaDOMParser.endElement(fElementQName, null); } catch (XMLParseException e) { convertToSAXParseException(e); } catch (XNIException e) { convertToSAXException(e); } finally { fNamespaceContext.popContext(); } }
public void characters(char[] ch, int start, int length) throws SAXException { try { fTempString.setValues(ch, start, length); fSchemaDOMParser.characters(fTempString, null); } catch (XMLParseException e) { convertToSAXParseException(e); } catch (XNIException e) { convertToSAXException(e); } }
fXSContentHandler = new SchemaContentHandler(); fXSContentHandler.reset(fSchemaParser, fSymbolTable, namespacePrefixes, stringsInternalized); parser.setContentHandler(fXSContentHandler); Document schemaDocument = fXSContentHandler.getDocument(); schemaElement = schemaDocument != null ? DOMUtil.getRoot(schemaDocument) : null; return getSchemaDocument0(key, schemaId, schemaElement,
private void fillXMLAttributes(Attributes atts) { fAttributes.removeAllAttributes(); final int attrCount = atts.getLength(); for (int i = 0; i < attrCount; ++i) { fillQName(fAttributeQName, atts.getURI(i), atts.getLocalName(i), atts.getQName(i)); String type = atts.getType(i); fAttributes.addAttributeNS(fAttributeQName, (type != null) ? type : XMLSymbols.fCDATASymbol, atts.getValue(i)); fAttributes.setSpecified(i, true); } }
public void processingInstruction(String target, String data) throws SAXException { try { fTempString.setValues(data.toCharArray(), 0, data.length()); fSchemaDOMParser.processingInstruction(target, fTempString, null); } catch (XMLParseException e) { convertToSAXParseException(e); } catch (XNIException e) { convertToSAXException(e); } }
public void endDocument() throws SAXException { fSAXLocatorWrapper.setLocator(null); try { fSchemaDOMParser.endDocument(null); } catch (XMLParseException e) { convertToSAXParseException(e); } catch (XNIException e) { convertToSAXException(e); } }
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException { try { fTempString.setValues(ch, start, length); fSchemaDOMParser.ignorableWhitespace(fTempString, null); } catch (XMLParseException e) { convertToSAXParseException(e); } catch (XNIException e) { convertToSAXException(e); } }
public void startDocument() throws SAXException { fNeedPushNSContext = true; fNamespaceContext.reset(); try { fSchemaDOMParser.startDocument(fSAXLocatorWrapper, null, fNamespaceContext, null); } catch (XMLParseException e) { convertToSAXParseException(e); } catch (XNIException e) { convertToSAXException(e); } }