Package org.codehaus.plexus.util.xml.pull

Examples of org.codehaus.plexus.util.xml.pull.XmlPullParser


    public void parse(Reader reader, Sink sink)
        throws ParseException
    {
        try
        {
            XmlPullParser parser = new MXParser();

            parser.setInput(reader);

            parseXdoc(parser, sink);
        }
        catch (Exception ex)
        {
View Full Code Here


        Reader reader = null;
        try
        {
            reader = ReaderFactory.newXmlReader( xmlFile );
            XmlPullParser parser = new MXParser();
            parser.setInput( reader );
            int eventType = parser.getEventType();
            while ( eventType != XmlPullParser.END_DOCUMENT )
            {
                if ( eventType == XmlPullParser.START_TAG )
                {
                    return parser.getName();
                }
                eventType = parser.nextToken();
            }
        }
        catch ( FileNotFoundException e )
        {
            return null;
View Full Code Here

        Reader reader = null;
        try
        {
            reader = ReaderFactory.newXmlReader( f );
            XmlPullParser parser = new MXParser();
            parser.setInput( reader );
            parser.nextToken();

            return true;
        }
        catch ( Exception e )
        {
View Full Code Here

        PrettyPrintXMLWriter xmlWriter = new PrettyPrintXMLWriter( writer );
        xmlWriter.setLineIndenter( StringUtils.repeat( " ", indentSize ) );
        xmlWriter.setLineSeparator( lineSeparator );

        XmlPullParser parser = new MXParser();
        try
        {
            parser.setInput( reader );

            prettyFormatInternal( parser, xmlWriter );
        }
        catch ( XmlPullParserException e )
        {
View Full Code Here

        Writer out = new OutputStreamWriter( os );
        PrettyPrintXMLWriter xmlWriter = new PrettyPrintXMLWriter( out );
        xmlWriter.setLineIndenter( StringUtils.repeat( " ", indentSize ) );
        xmlWriter.setLineSeparator( lineSeparator );

        XmlPullParser parser = new MXParser();
        try
        {
            reader = ReaderFactory.newXmlReader( is );

            parser.setInput( reader );

            prettyFormatInternal( parser, xmlWriter );
        }
        catch ( XmlPullParserException e )
        {
View Full Code Here

    }

    public static Xpp3Dom build( InputStream is, String encoding, boolean trim )
        throws XmlPullParserException, IOException
    {
        XmlPullParser parser = new MXParser();

        parser.setInput( is, encoding );

        try
        {
            return build( parser, trim );
        }
View Full Code Here

    }

    public static Xpp3Dom build( Reader reader, boolean trim )
        throws XmlPullParserException, IOException
    {
        XmlPullParser parser = new MXParser();

        parser.setInput( reader );

        try
        {
            return build( parser, trim );
        }
View Full Code Here

        }

        // 2 second parsing to process
        try
        {
            XmlPullParser parser = new MXParser();

            parser.setInput( src );
           
            // allow parser initialization, e.g. for additional entities in XHTML
            // Note: do it after input is set, otherwise values are reset
            initXmlParser( parser );
View Full Code Here

                return;
            }

            try
            {
                XmlPullParser xpp = new MXParser();
                Reader freader = ReaderFactory.newXmlReader( outputFile );
                BufferedReader breader = new BufferedReader( freader );
                xpp.setInput( breader );

                int violations = countViolations( xpp );
                if ( violations > maxAllowedViolations )
                {
                    if ( failOnViolation )
View Full Code Here

    }

    public static Xpp3Dom build( InputStream is, String encoding, boolean trim )
        throws XmlPullParserException, IOException
    {
        XmlPullParser parser = new MXParser();

        parser.setInput( is, encoding );

        try
        {
            return build( parser, trim );
        }
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.util.xml.pull.XmlPullParser

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.