ruby_rnv 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/rnv/ruby_rnv.c +13 -18
- data/lib/rnv/validator.rb +2 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a97a5b35a39aa2ad603660b81b9c13e04375dafbc9f537fec0720357befd53f8
|
4
|
+
data.tar.gz: 54dff4be913ec5e3e356cb43c5d58a936aa6aa76f38212212a19f3057875f22c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bacdd196d95d59883413268ab7dc70d68bd39d4d93876ca156687aceabd7d76cd917a09dbeea4537a3f3c96cbc883bd6f7cd35bf152ac0c421e6e9183f14c2a9
|
7
|
+
data.tar.gz: c43c097908014a8dc61fedab76ab407012077ec471fdc256aeca28d8261e3c90a4678f50a7b4308aa66efd96c008e1eb2e86f6fafe3ef1418b433b0da74a146c
|
data/ext/rnv/ruby_rnv.c
CHANGED
@@ -489,10 +489,11 @@ VALUE rb_document_load_string(VALUE self, VALUE r_str)
|
|
489
489
|
document->fn,
|
490
490
|
RSTRING_PTR(r_str), RSTRING_LEN(r_str));
|
491
491
|
|
492
|
-
document_load(document);
|
493
|
-
|
494
492
|
if (document->opened)
|
493
|
+
{
|
494
|
+
document_load(document);
|
495
495
|
return Qtrue;
|
496
|
+
}
|
496
497
|
else
|
497
498
|
return Qfalse;
|
498
499
|
}
|
@@ -507,27 +508,21 @@ VALUE rb_document_load_file(VALUE self, VALUE r_fn)
|
|
507
508
|
document_t *document;
|
508
509
|
Data_Get_Struct(self, document_t, document);
|
509
510
|
|
510
|
-
|
511
|
-
{
|
512
|
-
case T_STRING:
|
513
|
-
document->fn = RSTRING_PTR(r_fn);
|
511
|
+
Check_Type(r_fn, T_STRING);
|
514
512
|
|
515
|
-
|
516
|
-
document->rnc_st,
|
517
|
-
document->rn_st,
|
518
|
-
document->rnd_st,
|
519
|
-
document->fn);
|
520
|
-
break;
|
521
|
-
case T_FILE: // TODO
|
522
|
-
default:
|
523
|
-
rb_raise(rb_eTypeError, "invalid argument");
|
524
|
-
break;
|
525
|
-
}
|
513
|
+
document->fn = RSTRING_PTR(r_fn);
|
526
514
|
|
527
|
-
|
515
|
+
document->opened = rnl_fn(document->rnv,
|
516
|
+
document->rnc_st,
|
517
|
+
document->rn_st,
|
518
|
+
document->rnd_st,
|
519
|
+
document->fn);
|
528
520
|
|
529
521
|
if (document->opened)
|
522
|
+
{
|
523
|
+
document_load(document);
|
530
524
|
return Qtrue;
|
525
|
+
}
|
531
526
|
else
|
532
527
|
return Qfalse;
|
533
528
|
}
|
data/lib/rnv/validator.rb
CHANGED
@@ -76,6 +76,7 @@ module RNV
|
|
76
76
|
|
77
77
|
parser = Nokogiri::XML::SAX::Parser.new(rnv_doc)
|
78
78
|
parser.parse_memory(str) do |ctx|
|
79
|
+
ctx.replace_entities = true
|
79
80
|
rnv_doc.ctx = ctx
|
80
81
|
end
|
81
82
|
|
@@ -94,6 +95,7 @@ module RNV
|
|
94
95
|
|
95
96
|
parser = Nokogiri::XML::SAX::Parser.new(rnv_doc)
|
96
97
|
parser.parse(file) do |ctx|
|
98
|
+
ctx.replace_entities = true
|
97
99
|
rnv_doc.ctx = ctx
|
98
100
|
end
|
99
101
|
|