org.umber.catalan.transform.xform
Class ToAttributeProcessor

java.lang.Object
  extended byorg.umber.catalan.transform.BaseNodeProcessor
      extended byorg.umber.catalan.transform.xform.XFormProcessor
          extended byorg.umber.catalan.transform.xform.ToAttributeProcessor
All Implemented Interfaces:
INodeProcessor

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(Datum xml)
          Creates a new instance of ToAttributeProcessor from the XML spec.
ToAttributeProcessor(java.lang.String query, java.lang.String propertyName)
          Creates a new instance of ToAttributeProcessor.
 
Method Summary
protected  Datum transformNode(Datum node, Datum root)
          Performs an in-place transformation on the supplied Datum tree.
 
Methods inherited from class org.umber.catalan.transform.xform.XFormProcessor
getQuery, getQueryNodes, processNode
 
Methods inherited from class org.umber.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(Datum xml)
Creates a new instance of ToAttributeProcessor from the XML spec.

Parameters:
xml - XML initializing spec

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 Datum transformNode(Datum node,
                              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
Returns:
the new root Datum object (usually the same one)