Package org.dom4j.rule

Examples of org.dom4j.rule.Stylesheet


    /**
     * Factory method to create a new stylesheet
     */
    protected Stylesheet createStylesheet(final XMLOutput output) {
        // add default actions
        Stylesheet answer = new Stylesheet();
        answer.setValueOfAction(
            new Action() {
                public void run(Node node) throws Exception {                   
                    String text = node.getStringValue();
                    if ( text != null && text.length() > 0 ) {
                        // #### should use an 'output' property
View Full Code Here


        if (tag == null) {
            throw new JellyException(
                "<applyTemplates> tag must be inside a <stylesheet> tag"
            );
        }
        Stylesheet stylesheet = tag.getStylesheet();               
        Object source = tag.getXPathSource();
        if ( select != null ) {
            stylesheet.applyTemplates( source, select );
        }
        else {
            stylesheet.applyTemplates( source );
        }
       
        // #### should support MODE!!!
       
    }
View Full Code Here

    }
       
  // Tag interface
  //-------------------------------------------------------------------------                   
  public void doTag(XMLOutput output) throws Exception {
    Stylesheet stylesheet = getStylesheet();
    if (stylesheet == null) {
      throw new MissingAttributeException("stylesheet");
    }
       
        Object source = getSource();           
    if (log.isDebugEnabled()) {
      log.debug("About to evaluate stylesheet on source: " + source);
    }

    stylesheet.run(source);
  }
View Full Code Here

        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);

        style.run(doc);
View Full Code Here

    //-------------------------------------------------------------------------                   
  public void doTag(XMLOutput output) throws Exception {
    // for use by inner classes
    this.output = output;

    Stylesheet stylesheet = getStylesheet();
    stylesheet.clear();

    // run the body to add the rules
    invokeBody(output);
    stylesheet.setModeName(getMode());

    if (var != null) {
      context.setVariable(var, stylesheet);
    }
        else {
      Object source = getSource();

      if (log.isDebugEnabled()) {
        log.debug("About to evaluate stylesheet on source: " + source);
      }

      stylesheet.run(source);
    }
  }
View Full Code Here

    /**
     * Factory method to create a new stylesheet
     */
    protected Stylesheet createStylesheet() {
        // add default actions
        Stylesheet answer = new Stylesheet();
        answer.setValueOfAction(
            new Action() {
                public void run(Node node) throws Exception {                   
                    String text = node.getStringValue();
                    if ( text != null && text.length() > 0 ) {
                        // #### should use an 'output' property
View Full Code Here

    // Tag interface
    //-------------------------------------------------------------------------
    /** By default just evaluate the body */
    public void doTag(XMLOutput output) throws Exception {
        Stylesheet stylesheet = getStylesheet();       
        if ( stylesheet == null ) {
            throw new JellyException(
                "<applyTemplates> tag must be inside a <stylesheet> tag"
            );
        }
        Object context = getXPathContext();
        if ( select != null ) {
            stylesheet.applyTemplates( context, select );
        }
        else {
            stylesheet.applyTemplates( context );
        }
       
        // #### should support MODE!!!
       
    }
View Full Code Here

TOP

Related Classes of org.dom4j.rule.Stylesheet

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.