Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Gxml
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Canek Peláez Valdés
Gxml
Commits
c1540220
Commit
c1540220
authored
10 years ago
by
Daniel Espinosa
Browse files
Options
Downloads
Patches
Plain Diff
Fixed bug in GXml.Namespace implementation of old libxml
parent
6d6d6d35
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
gxml/libxml-NamespaceAttr.vala
+2
-2
2 additions, 2 deletions
gxml/libxml-NamespaceAttr.vala
gxml/libxml-Node.vala
+1
-1
1 addition, 1 deletion
gxml/libxml-Node.vala
test/SerializableObjectModelTest.vala
+14
-5
14 additions, 5 deletions
test/SerializableObjectModelTest.vala
with
17 additions
and
8 deletions
gxml/libxml-NamespaceAttr.vala
+
2
−
2
View file @
c1540220
...
@@ -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
;
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
gxml/libxml-Node.vala
+
1
−
1
View file @
c1540220
...
@@ -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
>
namespace
s
{
get
{
return
_
namespace_definitions
;
}
}
public
virtual
Gee
.
BidirList
<
GXml
.
Namespace
>
namespace
s
{
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
;
}
}
...
...
This diff is collapsed.
Click to expand it.
test/SerializableObjectModelTest.vala
+
14
−
5
View file @
c1540220
...
@@ -253,8 +253,10 @@ class Configuration : ObjectModel
...
@@ -253,8 +253,10 @@ class Configuration : ObjectModel
n
=
node
;
n
=
node
;
foreach
(
GXml
.
Namespace
ns
in
n
.
namespace
s
)
{
foreach
(
GXml
.
Namespace
ns
in
n
.
namespace
s
)
{
//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 />"""
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment