org.writersforge.catalan.transform.xform
Class ToAttributeProcessor

java.lang.Object
  |
  +--org.writersforge.catalan.transform.BaseNodeProcessor
        |
        +--org.writersforge.catalan.transform.xform.XFormProcessor
              |
              +--org.writersforge.catalan.transform.xform.ToAttributeProcessor
All Implemented Interfaces:
org.writersforge.bellows.traverse.NodeProcessor

public class ToAttributeProcessor
extends XFormProcessor

A Datum-only NodeProcessor for converting element content into attribute content. Gathers all PCDATA content in all of the queried content and appends it to the named attribute. If the attribute already exists, the element content will be appended to it. All converted elements are deleted.

Author:
jsheets

Constructor Summary
ToAttributeProcessor(java.lang.String query, java.lang.String propertyName)
          Creates a new instance of ToAttributeProcessor.
 
Method Summary
protected  void transformNode(org.writersforge.bellows.Datum node, org.writersforge.bellows.Datum root)
          Performs an in-place transformation on the supplied Datum tree.
 
Methods inherited from class org.writersforge.catalan.transform.xform.XFormProcessor
getQuery, getQueryNodes, processNode
 
Methods inherited from class org.writersforge.catalan.transform.BaseNodeProcessor
addLeftover, end, getLeftovers, getNodes, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToAttributeProcessor

public ToAttributeProcessor(java.lang.String query,
                            java.lang.String propertyName)
Creates a new instance of ToAttributeProcessor.

Parameters:
query - Bellows query path to select the source node(s)
propertyName - the attribute to store the content in
Method Detail

transformNode

protected void transformNode(org.writersforge.bellows.Datum node,
                             org.writersforge.bellows.Datum root)
Performs an in-place transformation on the supplied Datum tree.

Specified by:
transformNode in class XFormProcessor
Parameters:
node - the current node to operate upon
root - the root of the entire XML tree