public void onChildText(SAXElement element, SAXText text, ExecutionContext executionContext)
     throws SmooksException, IOException {
   writeStartElement(element);
   if (element.isWriterOwner(writerOwner)) {
     text.toWriter(element.getWriter(writerOwner), rewriteEntities);
   }
 }
 protected void writeEnd(SAXElement element) throws IOException {
   if (!isStartWritten(element)) {
     // It's an empty element...
     SAXElementWriterUtil.writeEmptyElement(
         element, element.getWriter(writerOwner), rewriteEntities);
   } else {
     SAXElementWriterUtil.writeEndElement(element, element.getWriter(writerOwner));
   }
 }
 public void writeStartElement(SAXElement element) throws IOException {
   // We set a flag in the cache so as to mark the fact that the start element has been writen
   if (element.isWriterOwner(writerOwner)) {
     if (!isStartWritten(element)) {
       element.setCache(this, true);
       writeStart(element);
     }
   }
 }
  private void bindSaxDataValue(SAXElement element, ExecutionContext executionContext) {
    String dataString;

    if (isAttribute) {
      dataString = SAXUtil.getAttribute(valueAttributeName, element.getAttributes());
    } else {
      dataString = element.getTextContent();
    }

    if (expression != null) {
      bindExpressionValue(executionContext);
    } else {
      populateAndSetPropertyValue(dataString, executionContext);
    }
  }
  public void visitBefore(SAXElement element, ExecutionContext executionContext)
      throws SmooksException, IOException {

    if (!isAttribute) {
      // It's not an attribute binding i.e. it's the element's text.
      // Turn on Text Accumulation...
      element.accumulateText();
    }

    if (beanWiring) {
      bindBeanValue(executionContext);
    } else if (isAttribute) {
      // Bind attribute (i.e. selectors with '@' prefix) values on the visitBefore...
      bindSaxDataValue(element, executionContext);
    }
  }
 protected void writeStart(SAXElement element) throws IOException {
   SAXElementWriterUtil.writeStartElement(
       element, element.getWriter(writerOwner), rewriteEntities);
 }
 public void writeEndElement(SAXElement element) throws IOException {
   if (element.isWriterOwner(writerOwner)) {
     writeEnd(element);
   }
 }
 public void visitBefore(SAXElement element, ExecutionContext executionContext)
     throws SmooksException, IOException {
   // Do nothing here apart from acquiring ownership of the element writer.
   // See is there any child text/elements first...
   element.getWriter(writerOwner);
 }
 public boolean isStartWritten(SAXElement element) {
   return element.getCache(this) != null;
 }