2008-04-01から1日間の記事一覧
ウチのクリックフォールディング1だけど、知り合いの自転車好きに相談したら、インター8が付けられる事があっけなく分かった。そこで、目処がつき次第作業に取り掛かるつもり。と言っても作業自体は自分ができないので自転車屋さんに頼むんですけど。また…
SourceFormatter#setIndentAllelement(true) 値の部分もインデントする <table> <tr> <td>ほげほげ</td> </tr> </table> ↓ <table> <tr> <td> ほげほげ </td> </tr> </table>
SourceFormatter#setIndentString(String) インデントの際の文字列を指定する。 Source src = new Source("HTMLの文字列"); SourceFormatter sf = src.getSourceFormatter(); sf.setIndentString("--"); ↓ <html> <body> hello </body> </html> ↓ <html> --<body>hello --</body> </html>
SourceFormatter#setNewLine(String) 改行文字を設定する。デフォルトはConfig.NewLine定数。この定数自体はプラットフォーム依存となる。Windowsで実行したら\r\nだし、Unixの場合は\nとなる。
Jerichoを使ってみて、ちょっとした整形だったらコレで一発でできるので簡単。こんな感じでOK。 Source src = new Source("HTMLの文字列"); SourceFormatter sf = src.getSourceFormatter(); System.out.println(sf); SourceFormatterクラスが表現をつかさど…