dk.brics.xsugar.xml
Class InputNormalizer

java.lang.Object
  extended by dk.brics.xsugar.xml.InputNormalizer

public class InputNormalizer
extends Object

Normalizes XML input (special chars, whitespace, and qnames). Whitespace character data is removed if it has no non-whitespace siblings. Element/attribute names with non-empty namespace URI are written in expanded form: {URI}localname. Characters are escaped using Escaping.escape(String). End tags are written as </>.


Constructor Summary
InputNormalizer()
          Constructs a new input normalizer.
 
Method Summary
 LocationMap getLocationMap()
          Returns the location map from the previous normalization.
 String normalize(String x, String file)
          Normalizes the given XML input
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputNormalizer

public InputNormalizer()
Constructs a new input normalizer.

Method Detail

getLocationMap

public LocationMap getLocationMap()
Returns the location map from the previous normalization.

Returns:
location map

normalize

public String normalize(String x,
                        String file)
                 throws org.jdom.JDOMException,
                        IOException
Normalizes the given XML input

Parameters:
x - input string
file - origin
Returns:
normalized string
Throws:
org.jdom.JDOMException - if a parse error occurs
IOException - if an I/O error occurs


Copyright © 2004-2007 Anders Møller & Claus Brabrand.