1/* 2 * Copyright (C) 2007 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16#include <util/xml/XMLDocumentImpl.h> 17#include <util/xml/XMLElementImpl.h> 18 19/** see XMLDocumentImpl.h */ 20XMLDocumentImpl::XMLDocumentImpl() 21{} 22 23/** see XMLDocumentImpl.h */ 24XMLDocumentImpl::~XMLDocumentImpl() 25{} 26 27/** see XMLDocumentImpl.h */ 28ElementImpl* XMLDocumentImpl::getDocumentElement() const 29{ 30 XMLElementImpl *element = (XMLElementImpl *)(this->getFirstChild()); 31 return element; 32} 33 34/** see XMLDocumentImpl.h */ 35ElementImpl* XMLDocumentImpl::createElement(const DOMString* tagName) const throw (DOMException) 36{ 37 if (tagName) 38 { 39 XMLElementImpl *element = new XMLElementImpl(tagName); 40 return element; 41 } 42 return NULL; 43} 44 45/** see XMLDocumentImpl.h */ 46TextImpl* XMLDocumentImpl::createTextNode(const DOMString* data) const 47{ 48 if (data) 49 { 50 TextImpl *text = new TextImpl(data); 51 return text; 52 } 53 return NULL; 54} 55 56