org.umber.catalan.transform.xform
Class ToAttributeProcessor
java.lang.Object
org.umber.catalan.transform.BaseNodeProcessor
org.umber.catalan.transform.xform.XFormProcessor
org.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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
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 uponroot
- the root of the entire XML tree
- Returns:
- the new root Datum object (usually the same one)