public static Document getWhitespaceStrippedDocument ( Document forDoc ) { String factory = getTransformerFactory ( ) . getClass ( ) . getName ( ) ; if ( XSLTConstants . JAVA5_XSLTC_FACTORY_NAME . equals ( factory ) ) { return stripWhiteSpaceWithoutXSLT ( forDoc ) ; } else { return stripWhiteSpaceUsingXSLT ( forDoc ) ; } }
Returns a new Document instance that is identical to the one passed in with element content whitespace removed .