/** Fills in the list of declared prefixes. */ private void fillDeclaredPrefixes(StartElement event) { fillDeclaredPrefixes(event.getNamespaces()); }
/** Fills in a QName object. */ private void fillQName(QName toFill, javax.xml.namespace.QName toCopy) { fillQName(toFill, toCopy.getNamespaceURI(), toCopy.getLocalPart(), toCopy.getPrefix()); }
++fDepth; StartElement start = currentEvent.asStartElement(); fillQName(fElementQName, start.getName()); fLocationWrapper.setLocation(start.getLocation()); fNamespaceContext.setNamespaceContext(start.getNamespaceContext()); fillXMLAttributes(start); fillDeclaredPrefixes(start); addNamespaceDeclarations(); fNamespaceContext.pushContext(); fSchemaDOMParser.startElement(fElementQName, fAttributes, null); case XMLStreamConstants.END_ELEMENT: EndElement end = currentEvent.asEndElement(); fillQName(fElementQName, end.getName()); fillDeclaredPrefixes(end); fLocationWrapper.setLocation(end.getLocation()); fSchemaDOMParser.endElement(fElementQName, null); sendCharactersToSchemaParser(currentEvent.asCharacters().getData(), false); break; case XMLStreamConstants.SPACE: sendCharactersToSchemaParser(currentEvent.asCharacters().getData(), true); break; case XMLStreamConstants.CDATA: fSchemaDOMParser.startCDATA(null); sendCharactersToSchemaParser(currentEvent.asCharacters().getData(), false); fSchemaDOMParser.endCDATA(null); break; case XMLStreamConstants.PROCESSING_INSTRUCTION:
fStAXSchemaParser = new StAXSchemaParser(); fStAXSchemaParser.reset(fSchemaParser, fSymbolTable); fStAXSchemaParser.parse(streamReader); if (consumeRemainingContent) { while (streamReader.hasNext()) { fStAXSchemaParser.parse(eventReader); if (consumeRemainingContent) { while (eventReader.hasNext()) { Document schemaDocument = fStAXSchemaParser.getDocument(); schemaElement = schemaDocument != null ? DOMUtil.getRoot(schemaDocument) : null; return getSchemaDocument0(key, schemaId, schemaElement,
fLocationWrapper.setLocation(input.getLocation()); fNamespaceContext.setNamespaceContext(input.getNamespaceContext()); fillQName(fElementQName, input.getNamespaceURI(), input.getLocalName(), input.getPrefix()); fillXMLAttributes(input); fillDeclaredPrefixes(input); addNamespaceDeclarations(); fNamespaceContext.pushContext(); fSchemaDOMParser.startElement(fElementQName, fAttributes, null); fLocationWrapper.setLocation(input.getLocation()); fNamespaceContext.setNamespaceContext(input.getNamespaceContext()); fillQName(fElementQName, input.getNamespaceURI(), input.getLocalName(), input.getPrefix()); fillDeclaredPrefixes(input); fSchemaDOMParser.endElement(fElementQName, null); fNamespaceContext.popContext(); break; case XMLStreamConstants.PROCESSING_INSTRUCTION: fillProcessingInstruction(input.getPIData()); fSchemaDOMParser.processingInstruction(input.getPITarget(), fTempString, null); break;
private void fillXMLAttributes(XMLStreamReader input) { fAttributes.removeAllAttributes(); final int len = input.getAttributeCount(); for (int i = 0; i < len; ++i) { fillQName(fAttributeQName, input.getAttributeNamespace(i), input.getAttributeLocalName(i), input.getAttributePrefix(i)); String type = input.getAttributeType(i); fAttributes.addAttributeNS(fAttributeQName, (type != null) ? type : XMLSymbols.fCDATASymbol, input.getAttributeValue(i)); fAttributes.setSpecified(i, input.isAttributeSpecified(i)); } }
/** Fills in the list of declared prefixes. */ private void fillDeclaredPrefixes(EndElement event) { fillDeclaredPrefixes(event.getNamespaces()); }
private void fillXMLAttributes(StartElement event) { fAttributes.removeAllAttributes(); final Iterator attrs = event.getAttributes(); while (attrs.hasNext()) { Attribute attr = (Attribute) attrs.next(); fillQName(fAttributeQName, attr.getName()); String type = attr.getDTDType(); int idx = fAttributes.getLength(); fAttributes.addAttributeNS(fAttributeQName, (type != null) ? type : XMLSymbols.fCDATASymbol, attr.getValue()); fAttributes.setSpecified(idx, attr.isSpecified()); } }