/*************************************************************************** * Copyright (C) 2005-2006 Nicolas Hadacek * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ #include "xml_to_data.h" #include #include TQDomElement XmlToData::findUniqueElement(TQDomElement parent, const TQString &tag, const TQString &attribute, const TQString &value) const { TQDomElement element; TQDomNode child = parent.firstChild(); while ( !child.isNull() ) { if ( child.nodeName()==tag && child.isElement() && (attribute.isEmpty() || child.toElement().attribute(attribute)==value) ) { if ( !element.isNull() ) qFatal(TQString("Duplicated element \"%1/%2\"").tqarg(tag).tqarg(value)); element = child.toElement(); } child = child.nextSibling(); } return element; } void XmlToData::checkTagNames(TQDomElement element, const TQString &tag, const TQStringList &names) const { TQDomNodeList list = element.elementsByTagName(tag); for (uint i=0; i