|
I'm not complety new to DOM, I've been using for _javascript_ programing. I also have a basic idea of XML. Now i'm developing a Java application, so I would like to use XML. So I've choosen Xerces. I would like to create a completely new DOM Document, but I don't know how, or at least it doesn't work. This are my first steps in Xerces. Thanks in advance. This is my code: public
class App {
This is the execution results:ÂÂÂ private App(){} //Disable Instanciation. ÂÂÂ public static void main(String[] args) throws Exception{ ÂÂÂ ÂÂÂ DocumentBuilderFactory dbf=DocumentBuilderFactory.newInstance(); ÂÂÂ ÂÂÂ System.out.println(dbf); ÂÂÂ ÂÂÂ DocumentBuilder db=dbf.newDocumentBuilder(); ÂÂÂ ÂÂÂ System.out.println(db); ÂÂÂ //org.w3c.dom.DocumentType ÂÂÂ ÂÂÂ DocumentType doctyp=db.getDOMImplementation().createDocumentType("NETMESSAGE","",""); ÂÂÂ ÂÂÂ System.out.println(doctyp); ÂÂÂ //org.w3c.dom.Document ÂÂÂ ÂÂÂ Document doc=db.getDOMImplementation().createDocument("ns", "", doctyp); ÂÂÂ ÂÂÂ System.out.println(doc); ÂÂÂ ÂÂÂ Element docelem=doc.createElement("html"); ÂÂÂ ÂÂÂ System.out.println(docelem); ÂÂÂ ÂÂÂ doc.getDocumentElement().appendChild(docelem); ÂÂÂ ÂÂÂ System.out.println(doc); ÂÂÂ } } $
java App
[EMAIL PROTECTED] [EMAIL PROTECTED] [PROTREDES: null] [#document: null] [html: null] [#document: null] $ |
- How to use entities with XML Schema? FPI
- How to use entities with XML Schema? Bob Foster
- Re: How to use entities with XML Schema? Joseph Kesselman
- Re: How to use entities with XML Schema? Bob Foster
- Re: How to use entities with XML Sch... Neil Graham
- Re: How to use entities with XM... George Cristian Bina
- Re: How to use entities wit... Bob Foster
- Re: How to use entities wit... Bob Foster
- Re: How to use entities with XM... Bob Foster
- Re: How to use entities with XML Sch... Elliotte Harold
- Re: How to use entities with XM... Bob Foster
