/** * Starts document parsing. This method initiates parsing of the COLLADA document and returns when * the full document has been parsed. * * @param args optional arguments to pass to parsers of sub-elements. * @return <code>this</code> if parsing is successful, otherwise null. * @throws XMLStreamException if an exception occurs while attempting to read the event stream. */ public ColladaRoot parse(Object... args) throws XMLStreamException { ColladaParserContext ctx = this.parserContext; try { for (XMLEvent event = ctx.nextEvent(); ctx.hasNext(); event = ctx.nextEvent()) { if (event == null) continue; // Allow a <COLLADA> element in any namespace if (event.isStartElement() && event.asStartElement().getName().getLocalPart().equals("COLLADA")) { super.parse(ctx, event, args); return this; } } } finally { ctx.getEventReader().close(); this.closeEventStream(); } return null; }