added Live Support (ls:) namespace declaration to AudioClip class

This commit is contained in:
fgerlits 2005-03-08 12:57:10 +00:00
parent 91824f522c
commit fcb009246d
1 changed files with 30 additions and 6 deletions

View File

@ -22,7 +22,7 @@
Author : $Author: fgerlits $
Version : $Revision: 1.22 $
Version : $Revision: 1.23 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/core/src/AudioClip.cxx,v $
------------------------------------------------------------------------------*/
@ -93,7 +93,7 @@ static const std::string extentElementPrefix = "dcterms";
static const std::string extentElementName = "extent";
/**
* The URI identifier for the "dcterms" prefix
* The URI identifier for the "dcterms" prefix.
*/
static const std::string extentElementUri = "http://purl.org/dc/terms/";
@ -108,14 +108,27 @@ static const std::string titleElementPrefix = "dc";
static const std::string titleElementName = "title";
/**
* The URI identifier for the "dc" prefix
* The URI identifier for the "dc" prefix.
*/
static const std::string titleElementUri ="http://purl.org/dc/elements/1.1/";
static const std::string titleElementUri
= "http://purl.org/dc/elements/1.1/";
/**
* The URI identifier for the default XML namespace
* The URI identifier for the default XML namespace.
*/
static const std::string defaultPrefixUri ="http://www.streamonthefly.org/";
static const std::string defaultPrefixUri
="http://www.streamonthefly.org/";
/**
* The prefix for the Live Support extension elements.
*/
static const std::string liveSupportNamespacePrefix = "ls";
/**
* The URI identifier for the "ls" prefix.
*/
static const std::string liveSupportNamespaceUri
= "http://mdlf.org/livesupport/elements/1.0/";
/* =============================================== local function prototypes */
@ -477,6 +490,8 @@ AudioClip :: setMetadata(Ptr<const Glib::ustring>::Ref value,
titleElementPrefix);
metadata->set_namespace_declaration(extentElementUri,
extentElementPrefix);
metadata->set_namespace_declaration(liveSupportNamespaceUri,
liveSupportNamespacePrefix);
}
// find the element to be modified
@ -548,6 +563,15 @@ AudioClip :: getXmlDocumentString() const throw ()
if (id) {
rootNode->set_attribute(idAttrName, std::string(*id));
}
xmlpp::Element* metadata = rootNode->add_child(metadataElementName);
metadata->set_namespace_declaration(defaultPrefixUri);
metadata->set_namespace_declaration(titleElementUri,
titleElementPrefix);
metadata->set_namespace_declaration(extentElementUri,
extentElementPrefix);
metadata->set_namespace_declaration(liveSupportNamespaceUri,
liveSupportNamespacePrefix);
}
Ptr<Glib::ustring>::Ref metadataString(new Glib::ustring(