多项选择题
在J2EE中,使用()选项中的代码,可以生成如下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);
相关考题
-
单项选择题
在J2EE中,以下代码()能正确的创建了SAX解析器对象。
A.SAXParser saxParser = SAXParserFactory.newSAXParser();
B.SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser();
C.SAXParser saxParser = SAXParser. newInstance ();
D.SAXParser saxParser = new SAXParser(); -
单项选择题
在J2EE中,假设sample.xml文档有一个元素是,它有个子元素是。我们已经获得了Document对象doc,取出第一个的第一个子元素的值的代码是()。
A.((Element)doc.getElementsByTagName("PERSON").item(0)).getNodeValue();
B.((Element)doc.getElementsByTagName("PERSON").item(0)).getElementsByTagName("NAME").item(0).getFirstChild().getNodeValue();
C.((Element)doc.getElementsByTagName("PERSON").item(0)).getElementsByTagName("NAME").item(0).getNodeValue();
D.((Element)doc.getElementsByTagName("PERSON").item(0)).item(0).getNodeValue(); -
单项选择题
在J2EE中,在DOM基本对象中,代表文档树中一个抽象的节点和文档中的标签元素的对象分别是()。
A.Document, Node
B.Node, NodeList
C.NodeList, Element
D.Node, Element
