net.sf.vex
Class SpaceNormalizer

java.lang.Object
  |
  +--net.sf.vex.SpaceNormalizer

public class SpaceNormalizer
extends java.lang.Object

Normalizes the space in an XML document. A StyleSheet determines the elements for which it is acceptable to delete space.


Constructor Summary
SpaceNormalizer(StyleSheet styleSheet)
          Class constructor.
 
Method Summary
 StyleSheet getStyleSheet()
          Returns the style sheet used to determine when it is acceptable to collapse space.
 void normalize(Document doc)
          Normalize the space in the document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpaceNormalizer

public SpaceNormalizer(StyleSheet styleSheet)
Class constructor.

Parameters:
styleSheet - StyleSheet to use to determine when it is acceptable to collapse space.
Method Detail

getStyleSheet

public StyleSheet getStyleSheet()
Returns the style sheet used to determine when it is acceptable to collapse space.


normalize

public void normalize(Document doc)
Normalize the space in the document. Whitespace leading and trailing an element's content is removed, and any other whitespace is collapsed to a single space.

Parameters:
doc - Document to normalize.