diff --git a/src/dialogs/rdf.cpp b/src/dialogs/rdf.cpp
index d9949c05b00f73fbd3140f0652c838580712bb12..1e26a79c45d1c1e9507858345a39887e34bc7115 100644 (file)
--- a/src/dialogs/rdf.cpp
+++ b/src/dialogs/rdf.cpp
*
* Authors:
* Kees Cook <kees@outflux.net>
*
* Authors:
* Kees Cook <kees@outflux.net>
+ * Jon Phillips <jon@rejon.org>
*
* Copyright (C) 2004 Kees Cook <kees@outflux.net>
*
* Copyright (C) 2004 Kees Cook <kees@outflux.net>
+ * Copyright (C) 2006 Jon Phillips <jon@rejon.org>
*
* Released under GNU GPL, read the file 'COPYING' for more information
*
*
* Released under GNU GPL, read the file 'COPYING' for more information
*
Example RDF XML from various places...
Example RDF XML from various places...
-<rdf:RDF xmlns="http://web.resource.org/cc/"
+<rdf:RDF xmlns="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<Work rdf:about="">
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<Work rdf:about="">
</Work>
</Work>
- <rdf:RDF xmlns="http://web.resource.org/cc/"
+ <rdf:RDF xmlns="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<Work rdf:about="">
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<Work rdf:about="">
<dc:title>John Cliff</dc:title>
</Agent></dc:rights>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>John Cliff</dc:title>
</Agent></dc:rights>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <license rdf:resource="http://web.resource.org/cc/PublicDomain" />
+ <license rdf:resource="http://creativecommons.org/ns#PublicDomain" />
</Work>
</Work>
- <License rdf:about="http://web.resource.org/cc/PublicDomain">
- <permits rdf:resource="http://web.resource.org/cc/Reproduction" />
- <permits rdf:resource="http://web.resource.org/cc/Distribution" />
- <permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
+ <License rdf:about="http://creativecommons.org/ns#PublicDomain">
+ <permits rdf:resource="http://creativecommons.org/ns#Reproduction" />
+ <permits rdf:resource="http://creativecommons.org/ns#Distribution" />
+ <permits rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
</License>
</rdf:RDF>
</License>
</rdf:RDF>
};
struct rdf_double_t rdf_license_cc_a [] = {
};
struct rdf_double_t rdf_license_cc_a [] = {
- { "cc:permits", "http://web.resource.org/cc/Reproduction", },
- { "cc:permits", "http://web.resource.org/cc/Distribution", },
- { "cc:requires", "http://web.resource.org/cc/Notice", },
- { "cc:requires", "http://web.resource.org/cc/Attribution", },
- { "cc:permits", "http://web.resource.org/cc/DerivativeWorks", },
+ { "cc:permits", "http://creativecommons.org/ns#Reproduction", },
+ { "cc:permits", "http://creativecommons.org/ns#Distribution", },
+ { "cc:requires", "http://creativecommons.org/ns#Notice", },
+ { "cc:requires", "http://creativecommons.org/ns#Attribution", },
+ { "cc:permits", "http://creativecommons.org/ns#DerivativeWorks", },
{ NULL, NULL }
};
struct rdf_double_t rdf_license_cc_a_sa [] = {
{ NULL, NULL }
};
struct rdf_double_t rdf_license_cc_a_sa [] = {
- { "cc:permits", "http://web.resource.org/cc/Reproduction", },
- { "cc:permits", "http://web.resource.org/cc/Distribution", },
- { "cc:requires", "http://web.resource.org/cc/Notice", },
- { "cc:requires", "http://web.resource.org/cc/Attribution", },
- { "cc:permits", "http://web.resource.org/cc/DerivativeWorks", },
- { "cc:requires", "http://web.resource.org/cc/ShareAlike", },
+ { "cc:permits", "http://creativecommons.org/ns#Reproduction", },
+ { "cc:permits", "http://creativecommons.org/ns#Distribution", },
+ { "cc:requires", "http://creativecommons.org/ns#Notice", },
+ { "cc:requires", "http://creativecommons.org/ns#Attribution", },
+ { "cc:permits", "http://creativecommons.org/ns#DerivativeWorks", },
+ { "cc:requires", "http://creativecommons.org/ns#ShareAlike", },
{ NULL, NULL }
};
struct rdf_double_t rdf_license_cc_a_nd [] = {
{ NULL, NULL }
};
struct rdf_double_t rdf_license_cc_a_nd [] = {
- { "cc:permits", "http://web.resource.org/cc/Reproduction", },
- { "cc:permits", "http://web.resource.org/cc/Distribution", },
- { "cc:requires", "http://web.resource.org/cc/Notice", },
- { "cc:requires", "http://web.resource.org/cc/Attribution", },
+ { "cc:permits", "http://creativecommons.org/ns#Reproduction", },
+ { "cc:permits", "http://creativecommons.org/ns#Distribution", },
+ { "cc:requires", "http://creativecommons.org/ns#Notice", },
+ { "cc:requires", "http://creativecommons.org/ns#Attribution", },
{ NULL, NULL }
};
struct rdf_double_t rdf_license_cc_a_nc [] = {
{ NULL, NULL }
};
struct rdf_double_t rdf_license_cc_a_nc [] = {
- { "cc:permits", "http://web.resource.org/cc/Reproduction", },
- { "cc:permits", "http://web.resource.org/cc/Distribution", },
- { "cc:requires", "http://web.resource.org/cc/Notice", },
- { "cc:requires", "http://web.resource.org/cc/Attribution", },
- { "cc:prohibits", "http://web.resource.org/cc/CommercialUse", },
- { "cc:permits", "http://web.resource.org/cc/DerivativeWorks", },
+ { "cc:permits", "http://creativecommons.org/ns#Reproduction", },
+ { "cc:permits", "http://creativecommons.org/ns#Distribution", },
+ { "cc:requires", "http://creativecommons.org/ns#Notice", },
+ { "cc:requires", "http://creativecommons.org/ns#Attribution", },
+ { "cc:prohibits", "http://creativecommons.org/ns#CommercialUse", },
+ { "cc:permits", "http://creativecommons.org/ns#DerivativeWorks", },
{ NULL, NULL }
};
struct rdf_double_t rdf_license_cc_a_nc_sa [] = {
{ NULL, NULL }
};
struct rdf_double_t rdf_license_cc_a_nc_sa [] = {
- { "cc:permits", "http://web.resource.org/cc/Reproduction", },
- { "cc:permits", "http://web.resource.org/cc/Distribution", },
- { "cc:requires", "http://web.resource.org/cc/Notice", },
- { "cc:requires", "http://web.resource.org/cc/Attribution", },
- { "cc:prohibits", "http://web.resource.org/cc/CommercialUse", },
- { "cc:permits", "http://web.resource.org/cc/DerivativeWorks", },
- { "cc:requires", "http://web.resource.org/cc/ShareAlike", },
+ { "cc:permits", "http://creativecommons.org/ns#Reproduction", },
+ { "cc:permits", "http://creativecommons.org/ns#Distribution", },
+ { "cc:requires", "http://creativecommons.org/ns#Notice", },
+ { "cc:requires", "http://creativecommons.org/ns#Attribution", },
+ { "cc:prohibits", "http://creativecommons.org/ns#CommercialUse", },
+ { "cc:permits", "http://creativecommons.org/ns#DerivativeWorks", },
+ { "cc:requires", "http://creativecommons.org/ns#ShareAlike", },
{ NULL, NULL }
};
struct rdf_double_t rdf_license_cc_a_nc_nd [] = {
{ NULL, NULL }
};
struct rdf_double_t rdf_license_cc_a_nc_nd [] = {
- { "cc:permits", "http://web.resource.org/cc/Reproduction", },
- { "cc:permits", "http://web.resource.org/cc/Distribution", },
- { "cc:requires", "http://web.resource.org/cc/Notice", },
- { "cc:requires", "http://web.resource.org/cc/Attribution", },
- { "cc:prohibits", "http://web.resource.org/cc/CommercialUse", },
+ { "cc:permits", "http://creativecommons.org/ns#Reproduction", },
+ { "cc:permits", "http://creativecommons.org/ns#Distribution", },
+ { "cc:requires", "http://creativecommons.org/ns#Notice", },
+ { "cc:requires", "http://creativecommons.org/ns#Attribution", },
+ { "cc:prohibits", "http://creativecommons.org/ns#CommercialUse", },
{ NULL, NULL }
};
{ NULL, NULL }
};
-struct rdf_double_t rdf_license_gpl [] = {
- { "cc:permits", "http://web.resource.org/cc/Reproduction", },
- { "cc:permits", "http://web.resource.org/cc/Distribution", },
- { "cc:requires", "http://web.resource.org/cc/Notice", },
- { "cc:permits", "http://web.resource.org/cc/DerivativeWorks", },
- { "cc:requires", "http://web.resource.org/cc/ShareAlike", },
- { "cc:requires", "http://web.resource.org/cc/SourceCode", },
+struct rdf_double_t rdf_license_pd [] = {
+ { "cc:permits", "http://creativecommons.org/ns#Reproduction", },
+ { "cc:permits", "http://creativecommons.org/ns#Distribution", },
+ { "cc:permits", "http://creativecommons.org/ns#DerivativeWorks", },
{ NULL, NULL }
};
{ NULL, NULL }
};
-struct rdf_double_t rdf_license_pd [] = {
- { "cc:permits", "http://web.resource.org/cc/Reproduction", },
- { "cc:permits", "http://web.resource.org/cc/Distribution", },
- { "cc:permits", "http://web.resource.org/cc/DerivativeWorks", },
+struct rdf_double_t rdf_license_freeart [] = {
+ { "cc:permits", "http://creativecommons.org/ns#Reproduction", },
+ { "cc:permits", "http://creativecommons.org/ns#Distribution", },
+ { "cc:permits", "http://creativecommons.org/ns#DerivativeWorks", },
+ { "cc:requires", "http://creativecommons.org/ns#ShareAlike", },
+ { "cc:requires", "http://creativecommons.org/ns#Notice", },
+ { "cc:requires", "http://creativecommons.org/ns#Attribution", },
{ NULL, NULL }
};
{ NULL, NULL }
};
-struct rdf_double_t rdf_license_freeart [] = {
- { "cc:permits", "http://web.resource.org/cc/Reproduction", },
- { "cc:permits", "http://web.resource.org/cc/Distribution", },
- { "cc:permits", "http://web.resource.org/cc/DerivativeWorks", },
- { "cc:requires", "http://web.resource.org/cc/ShareAlike", },
- { "cc:requires", "http://web.resource.org/cc/Notice", },
- { "cc:requires", "http://web.resource.org/cc/Attribution", },
+struct rdf_double_t rdf_license_ofl [] = {
+ { "cc:permits", "http://scripts.sil.org/pub/OFL/Reproduction", },
+ { "cc:permits", "http://scripts.sil.org/pub/OFL/Distribution", },
+ { "cc:permits", "http://scripts.sil.org/pub/OFL/Embedding", },
+ { "cc:permits", "http://scripts.sil.org/pub/OFL/DerivativeWorks", },
+ { "cc:requires", "http://scripts.sil.org/pub/OFL/Notice", },
+ { "cc:requires", "http://scripts.sil.org/pub/OFL/Attribution", },
+ { "cc:requires", "http://scripts.sil.org/pub/OFL/ShareAlike", },
+ { "cc:requires", "http://scripts.sil.org/pub/OFL/DerivativeRenaming", },
+ { "cc:requires", "http://scripts.sil.org/pub/OFL/BundlingWhenSelling", },
{ NULL, NULL }
};
struct rdf_license_t rdf_licenses [] = {
{ NULL, NULL }
};
struct rdf_license_t rdf_licenses [] = {
- { "CC Attribution",
- "http://creativecommons.org/licenses/by/2.0/",
+ { N_("CC Attribution"),
+ "http://creativecommons.org/licenses/by/3.0/",
rdf_license_cc_a,
},
rdf_license_cc_a,
},
- { "CC Attribution-ShareAlike",
- "http://creativecommons.org/licenses/by-sa/2.0/",
+ { N_("CC Attribution-ShareAlike"),
+ "http://creativecommons.org/licenses/by-sa/3.0/",
rdf_license_cc_a_sa,
},
rdf_license_cc_a_sa,
},
- { "CC Attribution-NoDerivs",
- "http://creativecommons.org/licenses/by-nd/2.0/",
+ { N_("CC Attribution-NoDerivs"),
+ "http://creativecommons.org/licenses/by-nd/3.0/",
rdf_license_cc_a_nd,
},
rdf_license_cc_a_nd,
},
- { "CC Attribution-NonCommercial",
- "http://creativecommons.org/licenses/by-nc/2.0/",
+ { N_("CC Attribution-NonCommercial"),
+ "http://creativecommons.org/licenses/by-nc/3.0/",
rdf_license_cc_a_nc,
},
rdf_license_cc_a_nc,
},
- { "CC Attribution-NonCommercial-ShareAlike",
- "http://creativecommons.org/licenses/by-nc-sa/2.0/",
+ { N_("CC Attribution-NonCommercial-ShareAlike"),
+ "http://creativecommons.org/licenses/by-nc-sa/3.0/",
rdf_license_cc_a_nc_sa,
},
rdf_license_cc_a_nc_sa,
},
- { "CC Attribution-NonCommercial-NoDerivs",
- "http://creativecommons.org/licenses/by-nc-nd/2.0/",
+ { N_("CC Attribution-NonCommercial-NoDerivs"),
+ "http://creativecommons.org/licenses/by-nc-nd/3.0/",
rdf_license_cc_a_nc_nd,
},
rdf_license_cc_a_nc_nd,
},
- { "GNU General Public License",
- "http://creativecommons.org/licenses/GPL/2.0/",
- rdf_license_gpl,
- },
-
- { "GNU Lesser General Public License",
- "http://creativecommons.org/licenses/LGPL/2.1/",
- rdf_license_gpl,
- },
-
- { "Public Domain",
- "http://web.resource.org/cc/PublicDomain",
+ { N_("Public Domain"),
+ "http://creativecommons.org/licenses/publicdomain/",
rdf_license_pd,
},
rdf_license_pd,
},
- { "FreeArt",
+ { N_("FreeArt"),
"http://artlibre.org/licence.php/lalgb.html",
rdf_license_freeart,
},
"http://artlibre.org/licence.php/lalgb.html",
rdf_license_freeart,
},
+ { N_("Open Font License"),
+ "http://scripts.sil.org/OFL",
+ rdf_license_ofl,
+ },
+
{ NULL, NULL, rdf_license_empty, }
};
{ NULL, NULL, rdf_license_empty, }
};
gchar *string=NULL;
gchar *rdf_head="\
gchar *string=NULL;
gchar *rdf_head="\
-<rdf:RDF xmlns=\"http://web.resource.org/cc/\"\
+<rdf:RDF xmlns=\"http://creativecommons.org/ns#\"\
xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\
xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\
";
xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\
xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\
";
Inkscape::XML::Node * temp=NULL;
Inkscape::XML::Node * child=NULL;
Inkscape::XML::Node * parent=repr;
Inkscape::XML::Node * temp=NULL;
Inkscape::XML::Node * child=NULL;
Inkscape::XML::Node * parent=repr;
+
+ Inkscape::XML::Document * xmldoc = parent->document();
+ g_return_val_if_fail (xmldoc != NULL, FALSE);
+
switch (entity->datatype) {
case RDF_CONTENT:
temp = sp_repr_children(parent);
if ( temp == NULL ) {
switch (entity->datatype) {
case RDF_CONTENT:
temp = sp_repr_children(parent);
if ( temp == NULL ) {
- temp = sp_repr_new_text( text );
- g_return_val_if_fail (temp != NULL, 0);
+ temp = xmldoc->createTextNode( text );
+ g_return_val_if_fail (temp != NULL, FALSE);
parent->appendChild(temp);
Inkscape::GC::release(temp);
parent->appendChild(temp);
Inkscape::GC::release(temp);
}
else {
temp->setContent(text);
}
else {
temp->setContent(text);
- return TRUE;
+ return TRUE;
}
case RDF_AGENT:
temp = sp_repr_lookup_name ( parent, "cc:Agent", 1 );
if ( temp == NULL ) {
}
case RDF_AGENT:
temp = sp_repr_lookup_name ( parent, "cc:Agent", 1 );
if ( temp == NULL ) {
- temp = sp_repr_new ( "cc:Agent" );
- g_return_val_if_fail (temp != NULL, 0);
+ temp = xmldoc->createElement ( "cc:Agent" );
+ g_return_val_if_fail (temp != NULL, FALSE);
parent->appendChild(temp);
Inkscape::GC::release(temp);
parent->appendChild(temp);
Inkscape::GC::release(temp);
temp = sp_repr_lookup_name ( parent, "dc:title", 1 );
if ( temp == NULL ) {
temp = sp_repr_lookup_name ( parent, "dc:title", 1 );
if ( temp == NULL ) {
- temp = sp_repr_new ( "dc:title" );
- g_return_val_if_fail (temp != NULL, 0);
+ temp = xmldoc->createElement ( "dc:title" );
+ g_return_val_if_fail (temp != NULL, FALSE);
parent->appendChild(temp);
Inkscape::GC::release(temp);
parent->appendChild(temp);
Inkscape::GC::release(temp);
temp = sp_repr_children(parent);
if ( temp == NULL ) {
temp = sp_repr_children(parent);
if ( temp == NULL ) {
- temp = sp_repr_new_text( text );
- g_return_val_if_fail (temp != NULL, 0);
+ temp = xmldoc->createTextNode( text );
+ g_return_val_if_fail (temp != NULL, FALSE);
parent->appendChild(temp);
Inkscape::GC::release(temp);
parent->appendChild(temp);
Inkscape::GC::release(temp);
parent->removeChild(temp);
}
parent->removeChild(temp);
}
- temp = sp_repr_new ( "rdf:Bag" );
- g_return_val_if_fail (temp != NULL, 0);
+ temp = xmldoc->createElement ( "rdf:Bag" );
+ g_return_val_if_fail (temp != NULL, FALSE);
parent->appendChild(temp);
Inkscape::GC::release(temp);
parent->appendChild(temp);
Inkscape::GC::release(temp);
strlist = g_strsplit( text, ",", 0);
for (i = 0; (str = strlist[i]); i++) {
strlist = g_strsplit( text, ",", 0);
for (i = 0; (str = strlist[i]); i++) {
- temp = sp_repr_new ( "rdf:li" );
+ temp = xmldoc->createElement ( "rdf:li" );
g_return_val_if_fail (temp != NULL, 0);
parent->appendChild(temp);
Inkscape::GC::release(temp);
g_return_val_if_fail (temp != NULL, 0);
parent->appendChild(temp);
Inkscape::GC::release(temp);
- child = sp_repr_new_text( g_strstrip(str) );
+ child = xmldoc->createTextNode( g_strstrip(str) );
g_return_val_if_fail (child != NULL, 0);
temp->appendChild(child);
g_return_val_if_fail (child != NULL, 0);
temp->appendChild(child);
g_return_val_if_fail (doc != NULL, NULL);
g_return_val_if_fail (doc->rroot != NULL, NULL);
g_return_val_if_fail (doc != NULL, NULL);
g_return_val_if_fail (doc->rroot != NULL, NULL);
+ Inkscape::XML::Document * xmldoc = sp_document_repr_doc(doc);
+ g_return_val_if_fail (xmldoc != NULL, NULL);
+
Inkscape::XML::Node * rdf = sp_repr_lookup_name ( doc->rroot, XML_TAG_NAME_RDF );
if (rdf == NULL) {
Inkscape::XML::Node * rdf = sp_repr_lookup_name ( doc->rroot, XML_TAG_NAME_RDF );
if (rdf == NULL) {
Inkscape::XML::Node * parent = sp_repr_lookup_name ( svg, XML_TAG_NAME_METADATA );
if ( parent == NULL ) {
Inkscape::XML::Node * parent = sp_repr_lookup_name ( svg, XML_TAG_NAME_METADATA );
if ( parent == NULL ) {
- parent = sp_repr_new( XML_TAG_NAME_METADATA );
+ parent = xmldoc->createElement( XML_TAG_NAME_METADATA );
g_return_val_if_fail ( parent != NULL, NULL);
svg->appendChild(parent);
Inkscape::GC::release(parent);
}
g_return_val_if_fail ( parent != NULL, NULL);
svg->appendChild(parent);
Inkscape::GC::release(parent);
}
- rdf = sp_repr_new( XML_TAG_NAME_RDF );
+ Inkscape::XML::Document * xmldoc = parent->document();
+ g_return_val_if_fail (xmldoc != NULL, FALSE);
+
+ rdf = xmldoc->createElement( XML_TAG_NAME_RDF );
g_return_val_if_fail (rdf != NULL, NULL);
parent->appendChild(rdf);
g_return_val_if_fail (rdf != NULL, NULL);
parent->appendChild(rdf);
Inkscape::XML::Node * want_metadata = sp_repr_parent ( rdf );
g_return_val_if_fail (want_metadata != NULL, NULL);
if (strcmp( want_metadata->name(), XML_TAG_NAME_METADATA )) {
Inkscape::XML::Node * want_metadata = sp_repr_parent ( rdf );
g_return_val_if_fail (want_metadata != NULL, NULL);
if (strcmp( want_metadata->name(), XML_TAG_NAME_METADATA )) {
- Inkscape::XML::Node * metadata = sp_repr_new( XML_TAG_NAME_METADATA );
+ Inkscape::XML::Node * metadata = xmldoc->createElement( XML_TAG_NAME_METADATA );
g_return_val_if_fail (metadata != NULL, NULL);
/* attach the metadata node */
g_return_val_if_fail (metadata != NULL, NULL);
/* attach the metadata node */
//printf("missing XML '%s'\n",name);
if (!build) return NULL;
//printf("missing XML '%s'\n",name);
if (!build) return NULL;
- xml = sp_repr_new( name );
+ Inkscape::XML::Document * xmldoc = sp_document_repr_doc(doc);
+ g_return_val_if_fail (xmldoc != NULL, NULL);
+
+ xml = xmldoc->createElement( name );
g_return_val_if_fail (xml != NULL, NULL);
xml->setAttribute("rdf:about", "" );
g_return_val_if_fail (xml != NULL, NULL);
xml->setAttribute("rdf:about", "" );
//printf("missing XML '%s'\n",name);
if (!build) return NULL;
//printf("missing XML '%s'\n",name);
if (!build) return NULL;
- item = sp_repr_new( name );
+ Inkscape::XML::Document * xmldoc = sp_document_repr_doc(doc);
+ g_return_val_if_fail (xmldoc != NULL, NULL);
+
+ item = xmldoc->createElement( name );
g_return_val_if_fail (item != NULL, NULL);
work->appendChild(item);
g_return_val_if_fail (item != NULL, NULL);
work->appendChild(item);
*
*/
void
*
*/
void
-rdf_set_license(SPDocument * document, struct rdf_license_t const * license)
+rdf_set_license(SPDocument * doc, struct rdf_license_t const * license)
{
// drop old license section
{
// drop old license section
- Inkscape::XML::Node * repr = rdf_get_xml_repr ( document, XML_TAG_NAME_LICENSE, FALSE );
+ Inkscape::XML::Node * repr = rdf_get_xml_repr ( doc, XML_TAG_NAME_LICENSE, FALSE );
if (repr) sp_repr_unparent(repr);
if (!license) return;
// build new license section
if (repr) sp_repr_unparent(repr);
if (!license) return;
// build new license section
- repr = rdf_get_xml_repr ( document, XML_TAG_NAME_LICENSE, TRUE );
+ repr = rdf_get_xml_repr ( doc, XML_TAG_NAME_LICENSE, TRUE );
g_assert ( repr );
repr->setAttribute("rdf:about", license->uri );
g_assert ( repr );
repr->setAttribute("rdf:about", license->uri );
+ Inkscape::XML::Document * xmldoc = sp_document_repr_doc(doc);
+ g_return_if_fail (xmldoc != NULL);
+
for (struct rdf_double_t * detail = license->details;
detail->name; detail++) {
for (struct rdf_double_t * detail = license->details;
detail->name; detail++) {
- Inkscape::XML::Node * child = sp_repr_new( detail->name );
+ Inkscape::XML::Node * child = xmldoc->createElement( detail->name );
g_assert ( child != NULL );
child->setAttribute("rdf:resource", detail->resource );
g_assert ( child != NULL );
child->setAttribute("rdf:resource", detail->resource );
};
void
};
void
-rdf_set_defaults ( SPDocument * document )
+rdf_set_defaults ( SPDocument * doc )
{
{
- g_assert ( document != NULL );
+ g_assert ( doc != NULL );
// Create metadata node if it doesn't already exist
// Create metadata node if it doesn't already exist
- if (!sp_item_group_get_child_by_name ((SPGroup *) document->root, NULL,
+ if (!sp_item_group_get_child_by_name ((SPGroup *) doc->root, NULL,
XML_TAG_NAME_METADATA)) {
// create repr
XML_TAG_NAME_METADATA)) {
// create repr
- Inkscape::XML::Node * rnew = sp_repr_new (XML_TAG_NAME_METADATA);
+ Inkscape::XML::Document * xmldoc = sp_document_repr_doc(doc);
+ g_return_if_fail (xmldoc != NULL);
+ Inkscape::XML::Node * rnew = xmldoc->createElement (XML_TAG_NAME_METADATA);
// insert into the document
// insert into the document
- document->rroot->addChild(rnew, NULL);
+ doc->rroot->addChild(rnew, NULL);
// clean up
Inkscape::GC::release(rnew);
}
// clean up
Inkscape::GC::release(rnew);
}
struct rdf_work_entity_t * entity = rdf_find_entity ( rdf_default->name );
g_assert ( entity != NULL );
struct rdf_work_entity_t * entity = rdf_find_entity ( rdf_default->name );
g_assert ( entity != NULL );
- if ( rdf_get_work_entity ( document, entity ) == NULL ) {
- rdf_set_work_entity ( document, entity, rdf_default->text );
+ if ( rdf_get_work_entity ( doc, entity ) == NULL ) {
+ rdf_set_work_entity ( doc, entity, rdf_default->text );
}
}
}
}
}
}