Skip to content
Snippets Groups Projects
Commit c1540220 authored by Daniel Espinosa's avatar Daniel Espinosa
Browse files

Fixed bug in GXml.Namespace implementation of old libxml

parent 6d6d6d35
Branches
Tags
No related merge requests found
...@@ -124,12 +124,12 @@ namespace GXml { ...@@ -124,12 +124,12 @@ namespace GXml {
// GXml.Namespace interface implementations // GXml.Namespace interface implementations
public string uri { public string uri {
get { get {
return namespace_uri; return defined_namespace_uri;
} }
} }
public string prefix { public string prefix {
get { get {
return namespace_prefix; return defined_prefix;
} }
} }
} }
......
...@@ -502,7 +502,7 @@ namespace GXml { ...@@ -502,7 +502,7 @@ namespace GXml {
} }
// GXml.Node interface implementations // GXml.Node interface implementations
public virtual Gee.BidirList<GXml.Namespace> namespaces { get { return _namespace_definitions; } } public virtual Gee.BidirList<GXml.Namespace> namespaces { get { return (Gee.BidirList) namespace_definitions; } }
public virtual Gee.BidirList<GXml.Node> childs { get { return (BidirList<GXml.Node>) child_nodes; } } public virtual Gee.BidirList<GXml.Node> childs { get { return (BidirList<GXml.Node>) child_nodes; } }
public virtual Gee.Map<string,GXml.Node> attrs { get { return (Map<string,GXml.Node>) _attributes; } } public virtual Gee.Map<string,GXml.Node> attrs { get { return (Map<string,GXml.Node>) _attributes; } }
public virtual string name { get { return node_name; } } public virtual string name { get { return node_name; } }
......
...@@ -253,8 +253,10 @@ class Configuration : ObjectModel ...@@ -253,8 +253,10 @@ class Configuration : ObjectModel
n = node; n = node;
foreach (GXml.Namespace ns in n.namespaces) { foreach (GXml.Namespace ns in n.namespaces) {
//stdout.printf (@"Namespace = $(ns.node_value)"); #if DEBUG
if (ns.prefix == "om" && ns.prefix == "http://www.gnome.org/gxml/0.4") GLib.message (@"Namespace = $(ns.prefix):$(ns.uri)");
#endif
if (ns.prefix == "om" && ns.uri == "http://www.gnome.org/gxml/0.4")
invalid = false; invalid = false;
} }
return default_deserialize (node); return default_deserialize (node);
...@@ -729,20 +731,27 @@ class SerializableObjectModelTest : GXmlTest ...@@ -729,20 +731,27 @@ class SerializableObjectModelTest : GXmlTest
stdout.printf (@"Error: $(e.message)"); stdout.printf (@"Error: $(e.message)");
assert_not_reached (); assert_not_reached ();
} }
});/* });
Test.add_func ("/gxml/serializable/object_model/override_deserialize", Test.add_func ("/gxml/serializable/object_model/override_deserialize",
() => { () => {
var doc = new xDocument.from_string ("""<?xml version="1.0"?> var doc = new xDocument.from_string ("""<?xml version="1.0"?>
<Configuration xmlns:om="http://www.gnome.org/gxml/0.4" device="Sampler"/>"""); <Configuration xmlns:om="http://www.gnome.org/gxml/0.4" device="Sampler"/>""");
var configuration = new Configuration (); var configuration = new Configuration ();
try { try {
//stdout.printf (@"$doc"); #if DEBUG
GLib.message ("Deserializing doc...");
#endif
configuration.deserialize (doc); configuration.deserialize (doc);
#if DEBUG
GLib.message ("Verifing Configuration...");
#endif
if (configuration.invalid == true) { if (configuration.invalid == true) {
#if DEBUG
stdout.printf ("CONFIGURATION: deserialize is INVALID\n"); stdout.printf ("CONFIGURATION: deserialize is INVALID\n");
foreach (GXml.xNode n in doc.document_element.namespace_definitions) { foreach (GXml.xNode n in doc.document_element.namespace_definitions) {
stdout.printf (@"CONFIGURATION: namespace: $(n.node_value)\n"); stdout.printf (@"CONFIGURATION: namespace: $(n.node_value)\n");
} }
#endif
assert_not_reached (); assert_not_reached ();
} }
} }
...@@ -750,7 +759,7 @@ class SerializableObjectModelTest : GXmlTest ...@@ -750,7 +759,7 @@ class SerializableObjectModelTest : GXmlTest
stdout.printf (@"Error: $(e.message)"); stdout.printf (@"Error: $(e.message)");
assert_not_reached (); assert_not_reached ();
} }
});*/ });
Test.add_func ("/gxml/serializable/object_model/custome_node_name", Test.add_func ("/gxml/serializable/object_model/custome_node_name",
() => { () => {
var doc = new xDocument.from_string ("""<?xml version="1.0"?><NodeName />"""); var doc = new xDocument.from_string ("""<?xml version="1.0"?><NodeName />""");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment