Examples of XMLInputStream


Examples of org.apache.xmlbeans.xml.stream.XMLInputStream

                "<any " + ns + " xsi:type='kindaPrime'>100</any>",
                null, null );

        // Make sure the unvalidated stream is OK

        XMLInputStream xis = x.newXMLInputStream();

        while ( xis.hasNext() )
            xis.next();

        // Make sure the validated stream fails

        boolean blewChunks = false;

        xis =
            stl.newValidatingXMLInputStream(
                x.newXMLInputStream(), null, null );

        try
        {
            while ( xis.hasNext() )
                xis.next();
        }
        catch ( XMLStreamValidationException e )
        {
            blewChunks = true;
        }
View Full Code Here

Examples of org.apache.xmlbeans.xml.stream.XMLInputStream

    private void xmlInputStream ( ) throws Exception
    {
        if (rnd( 5 ) != 0)
            return;
       
        XMLInputStream xis;
       
        try
        {
            xis = getCursor().newXMLInputStream();
        }
        catch ( IllegalStateException e )
        {
            return;
        }

        while ( xis.next() != null )
            ;
    }
View Full Code Here

Examples of org.apache.xmlbeans.xml.stream.XMLInputStream

            reader2 = new FileReader(args[0]);
        }

        System.out.println("reader ...");
        XmlStreamSource source = new XppXmlStreamImpl(reader1);
        XMLInputStream myStream = XmlStreamFactory.
                createXmlInputStream( source );

        XMLInputStream babelStream = XMLInputStreamFactory.newInstance().
            newInputStream(reader2);

        System.out.println("myStream ...");
        for(int i=0; myStream.hasNext() && i<3; i++)
        {
            System.out.println( "my: " + myStream.hasNext() + " '" +
                myStream.next() + "'");
            System.out.println( "bb: " + babelStream.hasNext() + " '" +
                    babelStream.next() + "'");
        }

        XMLInputStream myss = myStream.getSubStream();
        XMLInputStream bbss = babelStream.getSubStream();

        for(int i=0; (myss.hasNext() || bbss.hasNext()) && i<3; i++)
        {
            System.out.println( "my SUBStream: " + myss.hasNext() + " '" +
                    myss.next() + "'");
            System.out.println( "bb SUBStream: " + bbss.hasNext() + " '" +
                    bbss.next() + "'");
        }

        XMLInputStream myss2 = myss.getSubStream();
        XMLInputStream bbss2 = myss.getSubStream();
        for(; myss2.hasNext() || bbss2.hasNext() ;)
        {
            System.out.println( "my SubSUBStream 2: " + myss2.hasNext() +
                    " '" + myss2.next() + "'");
            System.out.println( "bb SubSUBStream 2: " + bbss2.hasNext() +
                    " '" + bbss2.next() + "'");
        }
        myss2.close();
        bbss2.close();

        for(; myss.hasNext() || bbss.hasNext() ;)
        {
            System.out.println( "my SUBStream: " + myss.hasNext() + " '" +
                    myss.next() + "'");
View Full Code Here

Examples of org.apache.xmlbeans.xml.stream.XMLInputStream

            reader1 = new StringReader(s);
            reader2 = new StringReader(s);

        System.out.println("reader ...");
        XmlStreamSource source = new XppXmlStreamImpl(reader1);
        XMLInputStream myStream = XmlStreamFactory.
                createXmlInputStream( source );

        XMLInputStream babelStream = XMLInputStreamFactory.newInstance().
            newInputStream(reader2);

        System.out.println("myStream ...");
        for(int i=0; myStream.hasNext() && i<3; i++)
        {
            System.out.println( "my: " + " '" +
                myStream.next() + "'");
            System.out.println( "bb: " + " '" +
                    babelStream.next() + "'");
        }

        XMLInputStream myss = myStream.getSubStream();
        XMLInputStream bbss = babelStream.getSubStream();

        for(int i=0; myss.hasNext() && i<3; i++)
        {
            System.out.println( "my SUBStream: " + " '" +
                    myss.next() + "'");
            System.out.println( "bb SUBStream: " + " '" +
                    bbss.next() + "'");
        }

        XMLInputStream myss2 = myss.getSubStream();
        XMLInputStream bbss2 = myss.getSubStream();
        for(; myss2.hasNext() ;)
        {
            System.out.println( "my SubSUBStream 2: " +
                    " '" + myss2.next() + "'");
            System.out.println( "bb SubSUBStream 2: " +
                    " '" + bbss2.next() + "'");
        }
        myss2.close();
        bbss2.close();

        for(; myss.hasNext() || bbss.hasNext() ;)
        {
            System.out.println( "my SUBStream: " + " '" +
                    myss.next() + "'");
View Full Code Here

Examples of org.apache.xmlbeans.xml.stream.XMLInputStream

        reader1 = new StringReader(s);
        reader2 = new StringReader(s);

        System.out.println("reader ... in main3");
        XmlStreamSource source = new XppXmlStreamImpl(reader1);
        XMLInputStream myStream = XmlStreamFactory.
                createXmlInputStream( source );

        //XMLInputStream babelStream = XMLInputStreamFactory.newInstance().
        //    newInputStream(reader2);

        System.out.println("myStream ...");
        for(int i=0; myStream.hasNext() && i<0; i++)
        {
            System.out.println( "my: " + " '" +
                myStream.next() + "'");
            //System.out.println( "bb: " + " '" +
            //        babelStream.next() + "'");
        }

        XMLInputStream myss = myStream.getSubStream();
        //XMLInputStream bbss = babelStream.getSubStream();

        for(int i=0; myss.hasNext() && i<3; i++)
        {
            System.out.println( "my SUBStream: " + " '" +
                    myss.next() + "'");
            //System.out.println( "bb SUBStream: " + " '" +
            //        bbss.next() + "'");
        }

        XMLInputStream myss2 = myss.getSubStream();
        //XMLInputStream bbss2 = myss.getSubStream();
        for(; myss2.hasNext() ;)
        {
            System.out.println( "my SubSUBStream 2: " +
                    " '" + myss2.next() + "'");
            //System.out.println( "bb SubSUBStream 2: " +
            //        " '" + bbss2.next() + "'");
        }
        myss2.close();
        //bbss2.close();

        for(; myss.hasNext() /*|| bbss.hasNext()*/ ;)
        {
            System.out.println( "my SUBStream: " + " '" +
View Full Code Here

Examples of org.apache.xmlbeans.xml.stream.XMLInputStream

            return;

        Reader r1 = new BufferedReader( new FileReader(file));
        Reader r2 = new BufferedReader( new FileReader(file));

        XMLInputStream xpp = XmlStreamFactory.
                createXmlInputStream(new XppXmlStreamImpl(r2));
        XMLInputStream babel = XMLInputStreamFactory.newInstance().
            newInputStream(r1);

        while( xpp.hasNext() || babel.hasNext() )
        {
            XMLEvent xppevent = xpp.peek();
            XMLEvent babelevent = babel.peek();

            if( !(""+xppevent).equals((""+babelevent)) )
                printError(xppevent, babelevent);
            else
            {
                //System.out.println("   `" + xppevent + "'\n   `" + babelevent +
                //                   "'"); System.out.flush();
            }

            xppevent = xpp.next();
            babelevent = babel.next();
        }

        //System.out.println("   xpp   overlimit: " + xpp.next() );
        //System.out.println("   babel overlimit: " + babel.next() );
View Full Code Here

Examples of org.apache.xmlbeans.xml.stream.XMLInputStream

            //throw new Exception("compareFile: file not a File");
            return;

        Reader r2 = new BufferedReader( new FileReader(file));

        XMLInputStream xpp = XmlStreamFactory.
                createXmlInputStream(new XppXmlStreamImpl(r2));
        XMLInputStream morphedStream;
        try
        {
            System.out.println("Starting xquery");
            XmlObject xmlObj = XmlObject.Factory.parse(xpp);
            XmlCursor crs = xmlObj.newCursor();
View Full Code Here

Examples of org.apache.xmlbeans.xml.stream.XMLInputStream

        //babel
        for( int i=0; i<TIMES; i++ )
        {
            Reader r = new BufferedReader( new FileReader(file));
            start = new Date().getTime();
            XMLInputStream babel = XMLInputStreamFactory.newInstance().
                newInputStream(r);
            while( babel.hasNext() )
            {
                XMLEvent babelevent = babel.peek();
                babelevent = babel.next();
            }
            babeltime += new Date().getTime() - start;
            r.close();
            //System.out.print(".");
        }

        //xpp with direct acces to the xpp parser
        for( int i=0; i<TIMES; i++ )
        {
            Reader r = new BufferedReader( new FileReader(file));
            start = new Date().getTime();
            MXParser xpp = (MXParser) new MXParserCachingStrings();
            xpp.setFeature( MXParser.FEATURE_PROCESS_NAMESPACES, true);
            xpp.setInput( r );
            int eventType = xpp.getEventType();
            while ( eventType != xpp.END_DOCUMENT )
            {
                eventType = xpp.nextToken();
            }
            xrtime += new Date().getTime() - start;
            r.close();
            //System.out.print("'");
        }

        //xpp with XppXmlStreamImpl
        for( int i=0; i<TIMES; i++ )
        {
            Reader r = new BufferedReader( new FileReader(file));
            //XMLInputStream xpp = new XppAdaptor().getStream(r2);
            start = new Date().getTime();
            XMLInputStream xpp = (XMLInputStream) new XppXmlStreamImpl(r);

            while( xpp.hasNext() )
            {
                XMLEvent xppevent = xpp.peek();
                xppevent = xpp.next();
            }
            xstime += new Date().getTime() - start;
            r.close();
            //System.out.print("`");
        }
View Full Code Here

Examples of org.netbeans.modules.dbschema.migration.archiver.XMLInputStream

            // if the file is empty, the archiver prints an
            // exception, so protect against that case and
            // return null without updating either cache
            if (stream.available() > 0)
            {
              XMLInputStream xmlInput = new XMLInputStream(stream,
                getClass().getClassLoader());

              mappingClass =
                (MappingClassElement)xmlInput.readObject();
              xmlInput.close();

              // postUnarchive performs version number checking
              // and possible format conversions
              mappingClass.postUnarchive();
View Full Code Here

Examples of org.netbeans.modules.dbschema.migration.archiver.XMLInputStream

            // if the file is empty, the archiver prints an
            // exception, so protect against that case and
            // return null without updating either cache
            if (stream.available() > 0)
            {
              XMLInputStream xmlInput = new XMLInputStream(stream,
                getClass().getClassLoader());

              mappingClass =
                (MappingClassElement)xmlInput.readObject();
              xmlInput.close();

              // postUnarchive performs version number checking
              // and possible format conversions
              mappingClass.postUnarchive();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.