20#ifndef KOFFICE_XMLREADER
21#define KOFFICE_XMLREADER
27#include <koffice_export.h>
31#define KoXmlNode TQDomNode
32#define KoXmlElement TQDomElement
33#define KoXmlText TQDomText
34#define KoXmlCDATASection TQDomCDATASection
35#define KoXmlDocument TQDomDocument
43class TQXmlInputSource;
74 ProcessingInstructionNode,
81 bool operator== ( const KoXmlNode& ) const;
82 bool operator!= ( const KoXmlNode& ) const;
85 virtual KoXmlNode::NodeType nodeType() const;
86 virtual bool isNull() const;
87 virtual bool isElement() const;
88 virtual bool isText() const;
89 virtual bool isCDATASection() const;
90 virtual bool isDocument() const;
98 virtual TQString nodeName() const;
99 virtual TQString namespaceURI() const;
100 virtual TQString prefix() const;
101 virtual TQString localName() const;
106 bool hasChildNodes() const;
112 KoXmlNode namedItem( const TQString& name ) const;
113 KoXmlNode namedItemNS( const TQString& nsURI, const TQString& name ) const;
120 void load( int depth=1 );
150 TQString tagName() const;
151 TQString text() const;
152 virtual bool isElement() const;
154 TQString attribute( const TQString& name ) const;
155 TQString attribute( const TQString& name, const TQString& defaultValue ) const;
156 TQString attributeNS( const TQString& namespaceURI, const TQString& localName,
157 const TQString& defaultValue ) const;
158 bool hasAttribute( const TQString& name ) const;
159 bool hasAttributeNS( const TQString& namespaceURI, const TQString& localName ) const;
179 TQString data() const;
180 void setData( const TQString& data );
181 virtual bool isText() const;
201 virtual bool isCDATASection() const;
231 virtual bool isDocument() const;
235 void setFastLoading( bool f );
236 bool fastLoading() const;
238 bool setContent( TQIODevice* device, bool namespaceProcessing,
239 TQString* errorMsg = 0, int* errorLine = 0, int* errorColumn = 0 );
240 bool setContent( TQIODevice* device,
241 TQString* errorMsg = 0, int* errorLine = 0, int* errorColumn = 0 );
242 bool setContent( TQXmlInputSource *source, TQXmlReader *reader,
243 TQString* errorMsg = 0, int* errorLine = 0, int* errorColumn = 0 );
299 const char* nsURI, const char* localName );
305 KOFFICECORE_EXPORT void load( KoXmlNode& node, int depth = 1 );
311 KOFFICECORE_EXPORT void unload( KoXmlNode& node );
315#define forEachElement( elem, parent ) \
316 for ( KoXmlNode _node = parent.firstChild(); !_node.isNull(); _node = _node.nextSibling() ) \
317 if ( !( elem = _node.toElement() ).isNull() )
KoXmlCDATASection represents a CDATA section in a DOM tree.
KoXmlDocument represents an XML document, structured in a DOM tree.
KoXmlElement represents a tag element in a DOM tree.
KoXmlNode represents a node in a DOM tree.
KoXmlText represents a text in a DOM tree.
This namespace contains a few convenience functions to simplify code using TQDom (when loading OASIS ...
|