A.Node和Element類(lèi) B.Document和NodeList類(lèi) C.TransformerFactory和Transformer類(lèi) D.TransFactory和Transmer類(lèi)
在J2EE中,使用()選項(xiàng)中的代碼,可以生成如下XML文檔: <PEOPLE> <PERSON> <NAME>Tony Blair</NAME> </PERSON> <PEOPLE>
A.Element people = doc.createElement("PEOPLE"); Element person = doc.createElement("PERSON"); Element name = doc.createElement("NAME"); name.appendChild(doc.createTextNode("Tony Blair")); people.appendChild(person); person.appendChild(name); doc.appendChild(people); B.Element people = doc.createElement("PEOPLE"); Element person = doc.createElement("PERSON"); people.appendChild(person); Element name = doc.createElement("NAME"); name.appendChild(doc.createTextNode("Tony Blair")); person.appendChild(name); doc.appendChild(people); C.Element people = doc.createElement("PEOPLE"); Element person = doc.createElement("PERSON"); people.appendChild(person); Element name = doc.createElement("NAME"); name.appendText(doc.createTextNode("Tony Blair")); person.appendChild(name); doc.appendChild(people); D.Element people = doc.createElement("PEOPLE"); Element person = doc.createElement("PERSON");Element name = doc.createElement("NAME"); name.createTextNode("Tony Blair"); people.appendChild(person); person.appendChild(name); doc.appendChild(people);
A.SAXParser saxParser = SAXParserFactory.newSAXParser(); B.SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser(); C.SAXParser saxParser = SAXParser. newInstance (); D.SAXParser saxParser = new SAXParser();