我的PHP安装标识为PHP版本5.2.6-1 + lenny8
我知道PHP版本5.2.6-1显然是什么,但什么是lenny8?
搜索周围没用
使用JAXP,创建元素的"Hello world"是:
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.newDocument();
Element e = doc.createElement("helloElement");
// attributes, append, etc...
Run Code Online (Sandbox Code Playgroud)
这使得元素的创建依赖于文档对象.有没有办法在没有特定文档的情况下创建元素?就像是:
Element e = DomDocument.createElement("helloElement"); //static method or so ...
return e;
Run Code Online (Sandbox Code Playgroud)
实现Element接口的方式太多了!
目的是从POJO获取DOM元素而无需传递文档任何建议?