java - Easy Way to Add Closing Tags on HTML Document so XSLT can be Applied -
i working on system need pass hmtl through xslt transformation, html has few header tags don't have closing tags not technically "well-formed" able apply xslt. here tags:
<meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta http-equiv="x-ua-compatible" content="ie=9"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="bootstrap.min.css"> <link rel="stylesheet" href="smartdoc.css">
here issue, documents working downloaded server don't have direct access open file, in notepad, , close tags manually. best way go closing tags can use xslt on them? note using java library run xslt transformation potentially use java edit html before applying xslt, not sure use.
there java version of html tidy called jtidy use clean-up html.
the jtidy how page shows example use of api:
tidy tidy = new tidy(); // obtain new tidy instance tidy.setxhtml(boolean xhtml); // set desired config options using tidy setters ... // (equivalent command line options) tidy.parse(inputstream, system.out); // run tidy, providing input , // output stream
Comments
Post a Comment