xpather 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/ext/xpather/xpather.c +5 -2
- metadata +2 -2
data/ext/xpather/xpather.c
CHANGED
@@ -17,6 +17,7 @@ VALUE search(VALUE self, VALUE xpathExpr)
|
|
17
17
|
xmlXPathObjectPtr xpathObj;
|
18
18
|
xmlNodeSetPtr nodes;
|
19
19
|
xmlNodePtr cur;
|
20
|
+
xmlBufferPtr nodeBuffer;
|
20
21
|
int size;
|
21
22
|
int i;
|
22
23
|
|
@@ -42,8 +43,10 @@ VALUE search(VALUE self, VALUE xpathExpr)
|
|
42
43
|
results = rb_str_new2(xmlNodeGetContent(nodes->nodeTab[0]));
|
43
44
|
} else if (size > 1) {
|
44
45
|
for (i = 0; i < size; ++i) {
|
45
|
-
|
46
|
-
|
46
|
+
nodeBuffer = xmlBufferCreate();
|
47
|
+
xmlNodeDump(nodeBuffer, doc, nodes->nodeTab[i], 0, 1);
|
48
|
+
rb_ary_push(results, rb_str_new2(nodeBuffer->content));
|
49
|
+
xmlBufferFree(nodeBuffer);
|
47
50
|
}
|
48
51
|
} else {
|
49
52
|
return Qnil;
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xpather
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-09-
|
12
|
+
date: 2012-09-15 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Quick and painless XPath searching for Ruby using libxml2
|
15
15
|
email:
|