Examples of XhtmlBaseParser


Examples of org.apache.maven.doxia.parser.XhtmlBaseParser

        FoSink fosink = new FoSink( getTestWriter( fileName ) );
        fosink.beginDocument();
        SinkTestDocument.generateHead( fosink );

        fosink.body();
        XhtmlBaseParser parser = new XhtmlBaseParser();
        parser.parse( new StringReader( html.toString() ), fosink );
        fosink.body_();

        fosink.endDocument();
        fosink.close();
View Full Code Here

Examples of org.apache.maven.doxia.parser.XhtmlBaseParser

        FoSink fosink = new FoSink( getTestWriter( fileName ) );
        fosink.beginDocument();
        SinkTestDocument.generateHead( fosink );

        fosink.body();
        XhtmlBaseParser parser = new XhtmlBaseParser();
        parser.parse( new StringReader( html.toString() ), fosink );
        fosink.body_();

        fosink.endDocument();
        fosink.close();
View Full Code Here

Examples of org.apache.maven.doxia.parser.XhtmlBaseParser

    public void testExecute()
        throws MacroExecutionException
    {
        String sourceContent = "<div><h2>h21</h2><h2>h22</h2><h3>h3</h3><h4>h4</h4><h2>h23</h2></div>";

        XhtmlBaseParser parser = new XhtmlBaseParser();
        parser.setSecondParsing( true );

        Map<String, Object> macroParameters = new HashMap<String, Object>();
        macroParameters.put( "parser", parser );
        macroParameters.put( "sourceContent", sourceContent );
        macroParameters.put( "section", "sec1" );

        File basedir = new File( "" );

        SinkEventTestingSink sink = new SinkEventTestingSink();
        MacroRequest request = new MacroRequest( macroParameters, basedir );
        TocMacro macro = new TocMacro();
        macro.execute( sink, request );

        Iterator<SinkEventElement> it = sink.getEventList().iterator();
        assertEquals( "list", ( it.next() ).getName() );
        assertEquals( "listItem", ( it.next() ).getName() );
        assertEquals( "link", ( it.next() ).getName() );
        assertEquals( "text", ( it.next() ).getName() );
        assertEquals( "link_", ( it.next() ).getName() );
        assertEquals( "listItem_", ( it.next() ).getName() );
        assertEquals( "listItem", ( it.next() ).getName() );
        assertEquals( "link", ( it.next() ).getName() );
        assertEquals( "text", ( it.next() ).getName() );
        assertEquals( "link_", ( it.next() ).getName() );
        assertEquals( "list", ( it.next() ).getName() );
        assertEquals( "listItem", ( it.next() ).getName() );
        assertEquals( "link", ( it.next() ).getName() );
        assertEquals( "text", ( it.next() ).getName() );
        assertEquals( "link_", ( it.next() ).getName() );
        assertEquals( "list", ( it.next() ).getName() );
        assertEquals( "listItem", ( it.next() ).getName() );
        assertEquals( "link", ( it.next() ).getName() );
        assertEquals( "text", ( it.next() ).getName() );
        assertEquals( "link_", ( it.next() ).getName() );
        assertEquals( "listItem_", ( it.next() ).getName() );
        assertEquals( "list_", ( it.next() ).getName() );
        assertEquals( "listItem_", ( it.next() ).getName() );
        assertEquals( "list_", ( it.next() ).getName() );
        assertEquals( "listItem_", ( it.next() ).getName() );
        assertEquals( "listItem", ( it.next() ).getName() );
        assertEquals( "link", ( it.next() ).getName() );
        assertEquals( "text", ( it.next() ).getName() );
        assertEquals( "link_", ( it.next() ).getName() );
        assertEquals( "listItem_", ( it.next() ).getName() );
        assertEquals( "list_", ( it.next() ).getName() );
        assertFalse( it.hasNext() );

        // test parameters

        parser = new XhtmlBaseParser();
        parser.setSecondParsing( true );
        macroParameters.put( "parser", parser );
        macroParameters.put( "section", "2" );
        macroParameters.put( "fromDepth", "1" );
        macroParameters.put( "toDepth", "2" );
        macroParameters.put( "class", "myClass" );
View Full Code Here

Examples of org.apache.maven.doxia.parser.XhtmlBaseParser

        throws MacroExecutionException
    {
        String sourceContent =
            "<div><h2>h<b>21</b></h2><h2>h<i>22</i></h2><h3>h<tt>3</tt></h3><h4>h4</h4><h2>h23</h2></div>";

        XhtmlBaseParser parser = new XhtmlBaseParser();
        parser.setSecondParsing( true );

        Map<String, Object> macroParameters = new HashMap<String, Object>();
        macroParameters.put( "parser", parser );
        macroParameters.put( "sourceContent", sourceContent );
        macroParameters.put( "section", "sec1" );
View Full Code Here

Examples of org.apache.maven.doxia.parser.XhtmlBaseParser

        FoSink fosink = new FoSink( getTestWriter( fileName ) );
        fosink.beginDocument();
        SinkTestDocument.generateHead( fosink );

        fosink.body();
        XhtmlBaseParser parser = new XhtmlBaseParser();
        parser.parse( new StringReader( html.toString() ), fosink );
        fosink.body_();

        fosink.endDocument();
        fosink.close();
View Full Code Here

Examples of org.apache.maven.doxia.parser.XhtmlBaseParser

        FoSink fosink = new FoSink( getTestWriter( fileName ) );
        fosink.beginDocument();
        SinkTestDocument.generateHead( fosink );

        fosink.body();
        XhtmlBaseParser parser = new XhtmlBaseParser();
        parser.parse( new StringReader( html.toString() ), fosink );
        fosink.body_();

        fosink.endDocument();
        fosink.close();
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.