Package org.apache.vxquery.xmlparser

Examples of org.apache.vxquery.xmlparser.XMLParser


                    throw new SystemException(ErrorCode.FORG0006);
                }
                tvp.getValue(stringp);
                try {
                    // Only one document should be parsed so its ok to have a unique parser.
                    XMLParser parser = new XMLParser(false, nodeIdProvider);
                    FunctionHelper.readInDocFromPointable(stringp, in, bbis, di, abvs, parser);
                } catch (Exception e) {
                    throw new SystemException(ErrorCode.SYSE0001, e);
                }
                result.set(abvs);
View Full Code Here


                    throw new SystemException(ErrorCode.FORG0006);
                }
                tvp.getValue(stringp);
                try {
                    // Only one document should be parsed so its ok to have a unique parser.
                    XMLParser parser = new XMLParser(false, nodeIdProvider, nodeId);
                    FunctionHelper.readInDocFromPointable(stringp, bbis, di, abvs, parser);
                } catch (Exception e) {
                    throw new SystemException(ErrorCode.SYSE0001, e);
                }
                result.set(abvs);
View Full Code Here

                if (tvp.getTag() != ValueTag.XS_STRING_TAG) {
                    throw new SystemException(ErrorCode.FORG0006);
                }
                tvp.getValue(stringp);
                try {
                    XMLParser parser = new XMLParser(false, nodeIdProvider, nodeId);
                    FunctionHelper.readInDocFromPointable(stringp, bbis, di, abvs, parser);
                    XDMConstants.setTrue(result);
                } catch (Exception e) {
                    XDMConstants.setFalse(result);
                }
View Full Code Here

        final ITreeNodeIdProvider nodeIdProvider = new TreeNodeIdProvider(partitionId, dataSourceId, totalDataSources);
        final String nodeId = ctx.getJobletContext().getApplicationContext().getNodeId();
        final DynamicContext dCtx = (DynamicContext) ctx.getJobletContext().getGlobalJobData();

        final String collectionName = collectionPartitions[partition % collectionPartitions.length];
        final XMLParser parser = new XMLParser(false, nodeIdProvider, nodeId, frame, appender, childSeq,
                dCtx.getStaticContext());

        return new AbstractUnaryInputUnaryOutputOperatorNodePushable() {
            @Override
            public void open() throws HyracksDataException {
                appender.reset(frame, true);
                writer.open();
            }

            @Override
            public void nextFrame(ByteBuffer buffer) throws HyracksDataException {
                fta.reset(buffer);
                String collectionModifiedName = collectionName.replace("${nodeId}", nodeId);
                File collectionDirectory = new File(collectionModifiedName);

                // Go through each tuple.
                if (collectionDirectory.isDirectory()) {
                    for (int tupleIndex = 0; tupleIndex < fta.getTupleCount(); ++tupleIndex) {
                        @SuppressWarnings("unchecked")
                        Iterator<File> it = FileUtils.iterateFiles(collectionDirectory, new VXQueryIOFileFilter(),
                                TrueFileFilter.INSTANCE);
                        while (it.hasNext()) {
                            File xmlDocument = it.next();
                            if (LOGGER.isLoggable(Level.FINE)) {
                                LOGGER.fine("Starting to read XML document: " + xmlDocument.getAbsolutePath());
                            }
                            parser.parseElements(xmlDocument, writer, fta, tupleIndex);
                        }
                    }
                } else {
                    throw new HyracksDataException("Invalid directory parameter (" + nodeId + ":"
                            + collectionDirectory.getAbsolutePath() + ") passed to collection.");
View Full Code Here

TOP

Related Classes of org.apache.vxquery.xmlparser.XMLParser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.