📄 hellomanipulation.java
字号:
import java.io.*;
import org.w3c.dom.*;
import org.w3c.dom.html.*;
import org.enhydra.xml.io.DOMFormatter;
public class HelloManipulation {
public static void main(String[] args) {
// Some pseudo-dynamic content
String username = "Mark Diekhans";
int numMessages = 43;
// Create the DOM tree
Hello hello = new Hello();
// Set the title, using a standard DOM method
hello.setTitle("Hello XMLC!");
// Set the value for "greeting"
hello.setTextGreeting("Hello, " + username);
// Set the value for "messages"
hello.setTextMessages("" + numMessages);
try {
DOMFormatter formatter = new DOMFormatter(); // can be heavily tweaked
formatter.write(hello, System.out);
}
catch (IOException e) {
e.printStackTrace();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -