Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    private static final String XML_LINEARIZATION_REGEX = "(>|&gt;){1,1}(\\t)*(\\n|\\r)+(\\s)*(<|&lt;){1,1}";
    private static final String XML_LINEARIZATION_REPLACEMENT = "$1$5";

    /**
     * 
     * @param xml
     * @return linearized
     */
    public static String linarizeXml(String xml) {

        return (xml != null) ? xml.trim().replaceAll(XML_LINEARIZATION_REGEX, XML_LINEARIZATION_REPLACEMENT) : null;
    }
}