Normalize

Normalization feature allows to collapse empty nodes and trim texts.

We can use directly XmlNormalizer or importing advxml.syntax.normalize._ you can have normalization methods onto NodeSeq instance.

Example

    import scala.xml.{Elem, NodeSeq}
    import advxml.core.XmlNormalizer

    val elem: Elem = <bar><foo></foo></bar>
    val result: NodeSeq = XmlNormalizer.normalize(elem)
    //result will be 
    //<bar><foo/></bar>

Example with syntax

    import scala.xml.{Elem, NodeSeq}
    import advxml.syntax._

    val elem: Elem = <bar><foo></foo></bar>
    val result:NodeSeq = elem.normalize
    //result will be 
    //<bar><foo/></bar>