nu.xom.samples
Class AttributesToElements

java.lang.Object
  extended by nu.xom.NodeFactory
      extended by nu.xom.samples.AttributesToElements

public class AttributesToElements
extends nu.xom.NodeFactory

A filter that converts attributes to child elements. This does not apply to namespace declaration attributes such as xmlns and xmlns:prefix.

Version:
1.0
Author:
Elliotte Rusty Harold

Constructor Summary
AttributesToElements()
           
AttributesToElements(boolean maintainTypes)
           
 
Method Summary
static void main(java.lang.String[] args)
           
 nu.xom.Nodes makeAttribute(java.lang.String name, java.lang.String URI, java.lang.String value, nu.xom.Attribute.Type type)
           Returns a new Nodes object containing an attribute in the specified namespace with the specified name and type.
 
Methods inherited from class nu.xom.NodeFactory
finishMakingDocument, finishMakingElement, makeComment, makeDocType, makeProcessingInstruction, makeRootElement, makeText, startMakingDocument, startMakingElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributesToElements

public AttributesToElements()

AttributesToElements

public AttributesToElements(boolean maintainTypes)
Method Detail

makeAttribute

public nu.xom.Nodes makeAttribute(java.lang.String name,
                                  java.lang.String URI,
                                  java.lang.String value,
                                  nu.xom.Attribute.Type type)
Description copied from class: nu.xom.NodeFactory

Returns a new Nodes object containing an attribute in the specified namespace with the specified name and type.

Subclasses may change the nodes returned from this method. They may return a Nodes object containing any number of children and attributes which are appended and added to the current parent element. This Nodes object may not contain any Document objects. All of the nodes returned must be parentless. Subclasses may return an empty Nodes to indicate the attribute should not be created.

Overrides:
makeAttribute in class nu.xom.NodeFactory
Parameters:
name - the prefixed name of the attribute
URI - the namespace URI
value - the attribute value
type - the attribute type
Returns:
the nodes to be added to the tree

main

public static void main(java.lang.String[] args)


Copyright 2002-2005 Elliotte Rusty Harold
elharo@metalab.unc.edu