Package org.dom4j.rule

Examples of org.dom4j.rule.Rule


    public void registerMatch( String xpath, SimpleNode node )
    {
        //System.out.println("registering : " + xpath );

        Pattern pattern = DocumentHelper.createPattern( xpath );
        Rule rule = new Rule( pattern );
        Map foo = new HashMap();

        foo.put("rule", rule );
        foo.put("xpath", xpath );
        foo.put("ast", node );
View Full Code Here


        for( int i = 0; i < xpathList.size(); i++ )
        {
            Map m = (Map) xpathList.get(i);

            Rule xpathrule = (Rule) m.get("rule");

            if( xpathrule.matches( dom4jnode ) )
            {
                sn = (SimpleNode) m.get( "ast" );
                //System.out.println("using : " + (String) m.get("xpath") );

                break;
View Full Code Here

    public void registerMatch( String xpath, SimpleNode node )
    {
        //System.out.println("registering : " + xpath );

        Pattern pattern = DocumentHelper.createPattern( xpath );
        Rule rule = new Rule( pattern );
        Map foo = new HashMap();

        foo.put("rule", rule );
        foo.put("xpath", xpath );
        foo.put("ast", node );
View Full Code Here

        for( int i = 0; i < xpathList.size(); i++ )
        {
            Map m = (Map) xpathList.get(i);

            Rule xpathrule = (Rule) m.get("rule");

            if( xpathrule.matches( dom4jnode ) )
            {
                sn = (SimpleNode) m.get( "ast" );
                //System.out.println("using : " + (String) m.get("xpath") );
                          
                break;
View Full Code Here

        if ( log.isDebugEnabled() ) {       
            log.debug( "adding template rule for match: " + match );
        }
       
        Rule rule = createRule(tag, output);
        if ( rule != null && tag != null) {
            rule.setMode( mode );
            tag.addTemplate( rule );
        }
    }
View Full Code Here

   
   
    // Implementation methods
    //-------------------------------------------------------------------------
    protected Rule createRule(StylesheetTag tag, XMLOutput output) {
        return new Rule( match, createAction(tag, output) );
    }
View Full Code Here

    public Document filtering(org.dom4j.Document doc) throws Exception {
        Element resultRoot = DocumentHelper.createElement("result");
        this.resultDoc = DocumentHelper.createDocument(resultRoot);

        Rule songElementRule = new Rule();
        songElementRule.setPattern(DocumentHelper
                .createPattern("/Songs/song/mp3/id3"));
        songElementRule.setAction(new SongElementBuilder());

        Rule titleTextNodeFilter = new Rule();
        titleTextNodeFilter.setPattern(DocumentHelper
                .createPattern("/Songs/song/mp3/id3/title"));
        titleTextNodeFilter.setAction(new NodeTextFilter());

        this.style = new Stylesheet();
        this.style.addRule(songElementRule);
        this.style.addRule(titleTextNodeFilter);
View Full Code Here

        if ( log.isDebugEnabled() ) {       
            log.debug( "adding template rule for match: " + match );
        }
       
        Rule rule = getRule();
        if ( rule != null && tag != null) {
            rule.setMode( mode );
            tag.addTemplate( rule );
        }
    }
View Full Code Here

   
   
    // Implementation methods
    //-------------------------------------------------------------------------
    protected Rule createRule() {
        return new Rule( match, getAction() );
    }
View Full Code Here

TOP

Related Classes of org.dom4j.rule.Rule

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.