]> Git trees. - libqmvoc.git/commitdiff
Enable reading and writing of category tag.
authorFrederik Gladhorn <gladhorn@kde.org>
Mon, 3 Sep 2007 18:58:28 +0000 (18:58 +0000)
committerFrederik Gladhorn <gladhorn@kde.org>
Mon, 3 Sep 2007 18:58:28 +0000 (18:58 +0000)
svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=708066

keduvocdocument/keduvockvtml2reader.cpp
keduvocdocument/keduvockvtml2writer.cpp
keduvocdocument/kvtml2.dtd
keduvocdocument/kvtml2defs.h

index 3372776117794917cfc4801be0ac36e5fe9864bd..8c2356a89ab2ec9e63bed30470e772b079c66bcc 100644 (file)
@@ -124,6 +124,12 @@ bool KEduVocKvtml2Reader::readInformation( QDomElement &informationElement )
         m_doc->setDocumentComment( currentElement.text() );
     }
 
+    // read the category
+    currentElement = informationElement.firstChildElement( KVTML_CATEGORY );
+    if ( !currentElement.isNull() ) {
+        m_doc->setCategory( currentElement.text() );
+    }
+
     return true;
 }
 
index 35aaf6dad90c506b1316b99a1b3d8e53e2a8f39a..35edeb2faddd2453460ca0b09b2bc8cd3d4229a9 100644 (file)
@@ -128,6 +128,11 @@ bool KEduVocKvtml2Writer::writeInformation( QDomElement &informationElement, con
         informationElement.appendChild( newTextElement( KVTML_COMMENT, m_doc->documentComment() ) );
     }
 
+    // category
+    if ( !m_doc->category().isEmpty() ) {
+        informationElement.appendChild( newTextElement( KVTML_CATEGORY, m_doc->category() ) );
+    }
+
     return true;
 }
 
index 5df54338384293afcb1423d0a68d75c16b7caa80..6a9c04589d2f8174be2672e3d16294b953a8a7f9 100644 (file)
@@ -1,13 +1,14 @@
 <!ELEMENT kvtml         (information, identifiers, wordtypedefinitions?, entries, tenses?, usages?, lessons?)     >
 <!ATTLIST kvtml version    CDATA  #REQUIRED>
 
-<!ELEMENT information    (generator?, title, author?, license?, comment?) >
+<!ELEMENT information    (generator?, title, author?, license?, comment?, category?) >
 
 <!ELEMENT generator      (#PCDATA) >
 <!ELEMENT title          (#PCDATA) >
 <!ELEMENT author         (#PCDATA) >
 <!ELEMENT license        (#PCDATA) >
 <!ELEMENT comment        (#PCDATA) >
+<!ELEMENT category       (#PCDATA) >
 
 <!ELEMENT identifiers    (identifier*) >
 <!ELEMENT identifier     (identifiertype, locale, name?, comment?, sizehint?, article?, personalpronouns?) >
index 696aee83c53acf6e93acabd0edb5bc05c18b3ab0..d4302b4ac45efcecf5d738b70136dd48d1afbf08 100644 (file)
@@ -28,6 +28,7 @@
 #define KVTML_AUTHOR            "author"
 #define KVTML_LICENSE           "license"
 #define KVTML_COMMENT           "comment"
+#define KVTML_CATEGORY          "category"
 
 #define KVTML_IDENTIFIERS       "identifiers"
 #define KVTML_IDENTIFIER        "identifier"