nokogiri 1.5.7.rc3-java → 1.5.8-java

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of nokogiri might be problematic. Click here for more details.

@@ -1,7 +1,14 @@
1
1
 
2
- == 1.5.x
2
+ === 1.5.8 / 2013年03月19日
3
3
 
4
- === 1.5.7 / unreleased
4
+ * Bugfixes
5
+
6
+ * (JRuby) Fix EmptyStackException thrown by elements with xlink:href attributes and no base_uri #534, #805. (Thanks, Patrick Quinn and Brian Hoffman!)
7
+ * Fixes duplicate attributes issue introduced in 1.5.7. #865
8
+ * Allow use of a prefixed namespace on a root node using Nokogiri::XML::Builder #868
9
+
10
+
11
+ === 1.5.7 / 2013年03月18日
5
12
 
6
13
  * Features
7
14
 
@@ -187,6 +194,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
187
194
  * Node#set is a private method (JRuby). #564 (thanks, Nick Sieger!)
188
195
  * C14n cleanup and Node#canonicalize (thanks, Ivan Pirlik!) #563
189
196
 
197
+
190
198
  === 1.5.0 / 2011年7月1日
191
199
 
192
200
  * 註
@@ -218,12 +226,14 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
218
226
 
219
227
  * Node#inner_textはnilを返さなくなった. (JRuby) #264
220
228
 
229
+
221
230
  === 1.5.0 beta2 2010年7月30日
222
231
 
223
232
  * 註
224
233
 
225
234
  * 1.4.3からの変更点を参照
226
235
 
236
+
227
237
  === 1.5.0 beta1 2010年5月22日
228
238
 
229
239
  * 註
@@ -237,14 +247,13 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
237
247
  * FFIサポートは削除された.
238
248
 
239
249
 
240
- == 1.4.x
241
-
242
250
  === 1.4.7 / 2011年7月1日
243
251
 
244
252
  * バグの修正
245
253
 
246
254
  * エンコーディング宣言のないHTMLファイルで部分的に重複したドキュメントが生成される問題を修正した. #478
247
255
 
256
+
248
257
  === 1.4.6 / 2011年6月19日
249
258
 
250
259
  * ノート
@@ -252,6 +261,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
252
261
  * このバージョンは、1.4.5と機能的に同じです
253
262
  * Rubyの1.8.6のサポートが復元されている
254
263
 
264
+
255
265
  === 1.4.5 / 未リリース
256
266
 
257
267
  * 新機能
@@ -268,6 +278,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
268
278
  * HTMLパーサーのエンコーディング判定をlibxml2の仕様を超えて拡張・改善した. (XML宣言のencodingを認識、非ASCII文字出現後のmetaタグも文字化けを生じずに反映)
269
279
  * Document#remove_namespaces! は名前空間付きの属性に対応した. #396
270
280
 
281
+
271
282
  === 1.4.4 2010年11月15日
272
283
 
273
284
  * 新機能
@@ -294,6 +305,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
294
305
  * libxml2 in-contextの解析バグの処置  #362
295
306
  * フレグメント内のノードの中にあるNodeSet#wrapの修正 #331
296
307
 
308
+
297
309
  === 1.4.3 2010年7月28日
298
310
 
299
311
  * 新しい機能
@@ -317,6 +329,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
317
329
  * CSS3の間接セレクタ"E ~ F G"がXPathの"//F//G[preceding-sibling::E]"へと
318
330
  誤変換されてしまうのを修正
319
331
 
332
+
320
333
  === 1.4.2 2010年5月22日
321
334
 
322
335
  * 新機能
@@ -367,6 +380,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
367
380
  1.1.26にDLLsを標準装備しています。このリリース以前にも既にDLLsはlibxml
368
381
  2.7.3 と libxslt 1.1.24に標準装備済み。
369
382
 
383
+
370
384
  === 1.4.1 2009年12月10日
371
385
 
372
386
  * 新しい機能
@@ -403,6 +417,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
403
417
  * 新しい文字列の先頭にくるテキストノードを含んだフレグメントが 正確に
404
418
  解析出来るようになった GH #178
405
419
 
420
+
406
421
  === 1.4.0 2009年10月30日
407
422
 
408
423
  * 今日はノコギリの満一歳のお誕生日です
@@ -449,8 +464,6 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
449
464
  * Hpricot用の互換性レイヤーを削除
450
465
 
451
466
 
452
- == 1.3.x
453
-
454
467
  === 1.3.3 / 2009年7月26日
455
468
 
456
469
  * 新しい機能
@@ -472,6 +485,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
472
485
 
473
486
  * Hpricotの互換性レイヤーがNokogiriの1.4.0で除去される予定
474
487
 
488
+
475
489
  === 1.3.2 / 2009年6月22日
476
490
 
477
491
  * 新しい機能
@@ -497,6 +511,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
497
511
  * Nokogiri::XML::SAX::Document#end_element_nsは廃棄予定なので
498
512
  Nokogiri::XML::SAX::Document#end_element_namespaceを代わりに使用して下さい
499
513
 
514
+
500
515
  === 1.3.1 / 2009年6月7日
501
516
 
502
517
  * バグの修正
@@ -504,6 +519,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
504
519
  * extconf.rb は任意のRelaxNGとSchemaの機能を探すようになった
505
520
  * ドキュメントのノードキャッシュに名前空間のノードが入るようになった
506
521
 
522
+
507
523
  === 1.3.0 / 2009年5月30日
508
524
 
509
525
  * 新しい機能
@@ -558,8 +574,6 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
558
574
  修正 (GH#35)
559
575
 
560
576
 
561
- == 1.2.x
562
-
563
577
  === 1.2.3 / 2009年3月22日
564
578
 
565
579
  * バグの修正
@@ -571,6 +585,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
571
585
  * 子ノードを付加する事で、重複した名前空間の宣言を取り除く LH#67
572
586
  * ビルダ方法はハッシュを第二引数とする
573
587
 
588
+
574
589
  === 1.2.2 / 2009年3月14日
575
590
 
576
591
  * 新しい機能
@@ -606,6 +621,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
606
621
  * CSS のセレクターのスペースを修正
607
622
  * Ruby 1.9 のStringのエンコードを修正 (角谷さんに感謝!)
608
623
 
624
+
609
625
  === 1.2.0 / 2009年2月22日
610
626
 
611
627
  * 新しい機能
@@ -641,8 +657,6 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
641
657
  * Nokogiri::HTML.fragment は XML::DocumentFragment (LH #32)で返す
642
658
 
643
659
 
644
- == 1.1.x
645
-
646
660
  === 1.1.1
647
661
 
648
662
  * 新しい機能
@@ -659,6 +673,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
659
673
  * XML::Node#attributes が Attr node を value値に返す
660
674
  * XML::NodeSet が to_xml へ実行
661
675
 
676
+
662
677
  === 1.1.0
663
678
 
664
679
  * 新しい機能
@@ -676,8 +691,6 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
676
691
  * XML::Node#add_previous_sibling が新しい兄弟ノードで返す
677
692
 
678
693
 
679
- == 1.0.x
680
-
681
694
  === 1.0.7
682
695
 
683
696
  * バグの修正
@@ -689,6 +702,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
689
702
  * ENV['PATH'] に付加せれる代わりに先頭へデータ挿入される
690
703
  * 複雑な CSS 内のバグを修正完了 :not selector ではありません
691
704
 
705
+
692
706
  === 1.0.6
693
707
 
694
708
  * 5つの修正
@@ -699,6 +713,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
699
713
  * CSS が Node#search 経由で検索し、常時対応する事が出来るようになった
700
714
  * CSS より XPath 変換がキャッシュに入れられるようになった
701
715
 
716
+
702
717
  === 1.0.5
703
718
 
704
719
  * バグフィックス
@@ -708,6 +723,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
708
723
  * Windows 内で ENV['PATH'] が存在しない場合でも、存在出来るように設定完了
709
724
  * Document 内の NodeSet#[] の結果をキャッシュする
710
725
 
726
+
711
727
  === 1.0.4
712
728
 
713
729
  * バグフィックス
@@ -717,6 +733,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
717
733
  * Builderブロックが取り囲んでいるコンテキストから
718
734
  メソッドの呼び出しをする事が出来る
719
735
 
736
+
720
737
  === 1.0.3
721
738
 
722
739
  * 5つのバグ修正
@@ -727,12 +744,14 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
727
744
  * 1.8.5互換性の為の RARRAY_LEN 除去
728
745
  * inner_html 修正済み (Yahuda に感謝)
729
746
 
747
+
730
748
  === 1.0.2
731
749
 
732
750
  * 1つのバグ修正
733
751
 
734
752
  * extconf.rb は frex や racc を調べないはず
735
753
 
754
+
736
755
  === 1.0.1
737
756
 
738
757
  * 1つのバグ修正
@@ -740,6 +759,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
740
759
  * extconf.rb が libdir や prefix を検索しない事を確認済み
741
760
  それによって、ports libxml/ruby が正しくリンクする (lucsky に感謝!)
742
761
 
762
+
743
763
  === 1.0.0 / 2008-07-13
744
764
 
745
765
  * 1つの偉大な増進
@@ -1,6 +1,14 @@
1
- == 1.5.x
2
1
 
3
- === 1.5.7 / unreleased
2
+ === 1.5.8 / 2013-03-19
3
+
4
+ * Bugfixes
5
+
6
+ * (JRuby) Fix EmptyStackException thrown by elements with xlink:href attributes and no base_uri #534, #805. (Thanks, Patrick Quinn and Brian Hoffman!)
7
+ * Fixes duplicate attributes issue introduced in 1.5.7. #865
8
+ * Allow use of a prefixed namespace on a root node using Nokogiri::XML::Builder #868
9
+
10
+
11
+ === 1.5.7 / 2013-03-18
4
12
 
5
13
  * Features
6
14
 
@@ -210,6 +218,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
210
218
  encoding.
211
219
  * Add support for <meta charset="...">.
212
220
 
221
+
213
222
  === 1.5.0 beta3 / 2010/12/02
214
223
 
215
224
  * Notes
@@ -221,12 +230,14 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
221
230
 
222
231
  * Node#inner_text no longer returns nil. (JRuby) #264
223
232
 
233
+
224
234
  === 1.5.0 beta2 / 2010/07/30
225
235
 
226
236
  * Notes
227
237
 
228
238
  * See changelog from 1.4.3
229
239
 
240
+
230
241
  === 1.5.0 beta1 / 2010/05/22
231
242
 
232
243
  * Notes
@@ -240,8 +251,6 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
240
251
  * FFI support is removed.
241
252
 
242
253
 
243
- == 1.4.x
244
-
245
254
  === 1.4.7 / 2011-07-01
246
255
 
247
256
  * Bugfixes
@@ -250,6 +259,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
250
259
  duplicated document when parsing an HTML file with unknown
251
260
  encoding. Thanks, Timothy Elliott (@ender672)! #478
252
261
 
262
+
253
263
  === 1.4.6 / 2011-06-19
254
264
 
255
265
  * Notes
@@ -257,6 +267,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
257
267
  * This version is functionally identical to 1.4.5.
258
268
  * Ruby 1.8.6 support has been restored.
259
269
 
270
+
260
271
  === 1.4.5 / 2011-05-19
261
272
 
262
273
  * New Features
@@ -279,6 +290,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
279
290
  * XSLT::Stylesheet#transform no longer segfaults when handed a non-XML::Document. #452
280
291
  * XML::Reader no longer segfaults when under GC pressure. #439
281
292
 
293
+
282
294
  === 1.4.4 / 2010-11-15
283
295
 
284
296
  * New Features
@@ -305,6 +317,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
305
317
  * Workaround for libxml2 in-context parsing bug. #362
306
318
  * Fixed NodeSet#wrap on nodes within a fragment. #331
307
319
 
320
+
308
321
  === 1.4.3 / 2010/07/28
309
322
 
310
323
  * New Features
@@ -328,6 +341,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
328
341
  (a.k.a. preceding selector) that incorrectly converted "E ~ F G" to
329
342
  "//F//G[preceding-sibling::E]".
330
343
 
344
+
331
345
  === 1.4.2 / 2010/05/22
332
346
 
333
347
  * New Features
@@ -380,6 +394,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
380
394
  1.1.26. Prior to this release, libxml 2.7.3 and libxslt 1.1.24
381
395
  were bundled.
382
396
 
397
+
383
398
  === 1.4.1 / 2009/12/10
384
399
 
385
400
  * New Features
@@ -411,6 +426,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
411
426
  * XSLT#apply_to will honor the "output method". Thanks richardlehane!
412
427
  * Fragments containing leading text nodes with newlines now parse properly. GH #178.
413
428
 
429
+
414
430
  === 1.4.0 / 2009/10/30
415
431
 
416
432
  * Happy Birthday!
@@ -454,8 +470,6 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
454
470
  * Hpricot compatibility layer removed
455
471
 
456
472
 
457
- == 1.3.x
458
-
459
473
  === 1.3.3 / 2009/07/26
460
474
 
461
475
  * New Features
@@ -476,6 +490,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
476
490
 
477
491
  * Hpricot compatibility layer will be removed in 1.4.0
478
492
 
493
+
479
494
  === 1.3.2 / 2009-06-22
480
495
 
481
496
  * New Features
@@ -499,6 +514,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
499
514
  * Nokogiri::XML::SAX::Document#end_element_ns is deprecated, please switch
500
515
  to Nokogiri::XML::SAX::Document#end_element_namespace
501
516
 
517
+
502
518
  === 1.3.1 / 2009-06-07
503
519
 
504
520
  * Bugfixes
@@ -506,6 +522,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
506
522
  * extconf.rb checks for optional RelaxNG and Schema functions
507
523
  * Namespace nodes are added to the Document node cache
508
524
 
525
+
509
526
  === 1.3.0 / 2009-05-30
510
527
 
511
528
  * New Features
@@ -550,8 +567,6 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
550
567
  * Fixed intolerance of HTML attributes without values in Node#before/after/inner_html=. (GH#35)
551
568
 
552
569
 
553
- == 1.2.x
554
-
555
570
  === 1.2.3 / 2009-03-22
556
571
 
557
572
  * Bugfixes
@@ -563,6 +578,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
563
578
  * Adding a child will remove duplicate namespace declarations LH #67
564
579
  * Builder methods take a hash as a second argument
565
580
 
581
+
566
582
  === 1.2.2 / 2009-03-14
567
583
 
568
584
  * New features
@@ -589,6 +605,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
589
605
  * Document#dup should create a new document of the same type (LH #59)
590
606
  * Document should not have a parent method (LH #64)
591
607
 
608
+
592
609
  === 1.2.1 / 2009-02-23
593
610
 
594
611
  * Bugfixes
@@ -596,6 +613,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
596
613
  * Fixed a CSS selector space bug
597
614
  * Fixed Ruby 1.9 String Encoding (Thanks 角谷さん!)
598
615
 
616
+
599
617
  === 1.2.0 / 2009-02-22
600
618
 
601
619
  * New features
@@ -633,8 +651,6 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
633
651
  * Nokogiri::HTML.fragment now returns an XML::DocumentFragment (LH #32)
634
652
 
635
653
 
636
- == 1.1.x
637
-
638
654
  === 1.1.1
639
655
 
640
656
  * New features
@@ -652,6 +668,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
652
668
  * XML::Node#attributes returns an Attr node for the value.
653
669
  * XML::NodeSet implements to_xml
654
670
 
671
+
655
672
  === 1.1.0
656
673
 
657
674
  * New Features
@@ -669,8 +686,6 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
669
686
  * XML::Node#add_previous_sibling returns new sibling node.
670
687
 
671
688
 
672
- == 1.0.x
673
-
674
689
  === 1.0.7
675
690
 
676
691
  * Bugfixes
@@ -682,6 +697,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
682
697
  * Prepending rather than appending to ENV['PATH'] on windows
683
698
  * Fixed a bug in complex CSS negation selectors
684
699
 
700
+
685
701
  === 1.0.6
686
702
 
687
703
  * 5 Bugfixes
@@ -692,6 +708,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
692
708
  * CSS searches via Node#search are now always relative
693
709
  * CSS to XPath conversion is now cached
694
710
 
711
+
695
712
  === 1.0.5
696
713
 
697
714
  * Bugfixes
@@ -700,6 +717,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
700
717
  * Sets ENV['PATH'] on windows if it doesn't exist
701
718
  * Caching results of NodeSet#[] on Document
702
719
 
720
+
703
721
  === 1.0.4
704
722
 
705
723
  * Bugfixes
@@ -708,6 +726,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
708
726
  * Plugged some memory leaks
709
727
  * Builder blocks can call methods from surrounding contexts
710
728
 
729
+
711
730
  === 1.0.3
712
731
 
713
732
  * 5 Bugfixes
@@ -718,12 +737,14 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
718
737
  * Removed RARRAY_LEN for 1.8.5 compatibility. Thanks Shane Hanna.
719
738
  * inner_html fixed. (Thanks Yehuda!)
720
739
 
740
+
721
741
  === 1.0.2
722
742
 
723
743
  * 1 Bugfix
724
744
 
725
745
  * extconf.rb should not check for frex and racc
726
746
 
747
+
727
748
  === 1.0.1
728
749
 
729
750
  * 1 Bugfix
@@ -731,6 +752,7 @@ Repackaging of 1.5.1 with a gemspec that is compatible with older Rubies. #631,
731
752
  * Made sure extconf.rb searched libdir and prefix so that ports libxml/ruby
732
753
  will link properly. Thanks lucsky!
733
754
 
755
+
734
756
  === 1.0.0 / 2008-07-13
735
757
 
736
758
  * 1 major enhancement
@@ -396,9 +396,12 @@ public abstract class ReaderNode {
396
396
  else return base.concat("/").concat(v);
397
397
  }
398
398
  } else if ("xlink:href".equals(n)) {
399
+ if (v.startsWith("http://")) {
400
+ return v;
401
+ } else if (!xmlBaseStack.isEmpty()) {
399
402
  String base = xmlBaseStack.peek();
400
- if (base.endsWith("/")) return base.concat(v);
401
- else return base.concat("/").concat(v);
403
+ return base;
404
+ }
402
405
  }
403
406
  return null;
404
407
  }
Binary file
@@ -1,6 +1,6 @@
1
1
  module Nokogiri
2
2
  # The version of Nokogiri you are using
3
- VERSION = '1.5.7.rc3'
3
+ VERSION = '1.5.8'
4
4
 
5
5
  class VersionInfo # :nodoc:
6
6
  def jruby?
@@ -318,7 +318,9 @@ module Nokogiri
318
318
  # Build a tag that is associated with namespace +ns+. Raises an
319
319
  # ArgumentError if +ns+ has not been defined higher in the tree.
320
320
  def [] ns
321
- @ns = @parent.namespace_definitions.find { |x| x.prefix == ns.to_s }
321
+ if @parent != @doc
322
+ @ns = @parent.namespace_definitions.find { |x| x.prefix == ns.to_s }
323
+ end
322
324
  return self if @ns
323
325
 
324
326
  @parent.ancestors.each do |a|
@@ -87,8 +87,9 @@ module Nokogiri
87
87
  if key =~ NCNAME_RE
88
88
  ns_name = key.split(":", 2)[1]
89
89
  elm.add_namespace_definition ns_name, v
90
+ else
91
+ elm[k.to_s] = v.to_s
90
92
  end
91
- elm[k.to_s] = v.to_s
92
93
  }
93
94
  else
94
95
  elm.content = arg
@@ -0,0 +1,14 @@
1
+ require "helper"
2
+
3
+ module Nokogiri
4
+ module XML
5
+ class TestAdditionalNamespacesInBuilderDoc < Nokogiri::TestCase
6
+ def test_builder_namespaced_root_node_ns
7
+ b = Nokogiri::XML::Builder.new do |x|
8
+ x[:foo].RDF(:'xmlns:foo' => 'http://foo.io')
9
+ end
10
+ assert_equal 'http://foo.io', b.doc.root.namespace.href
11
+ end
12
+ end
13
+ end
14
+ end
@@ -55,6 +55,12 @@ module Nokogiri
55
55
  def test_builder_buried_decl_ns
56
56
  assert_equal 'ns:veg', check_namespace(@doc.root.elements[3].elements[1])
57
57
  end
58
+ def test_builder_namespace_count
59
+ n = @doc.root.clone
60
+ n.children.each(&:remove)
61
+ ns_attrs = n.to_xml.scan(/\bxmlns(?::.+?)?=/)
62
+ assert_equal 3, ns_attrs.length
63
+ end
58
64
  end
59
65
  end
60
66
  end
@@ -57,6 +57,12 @@ module Nokogiri
57
57
  def test_created_buried_decl_ns
58
58
  assert_equal 'ns:veg', check_namespace(@doc.root.elements[3].elements[1])
59
59
  end
60
+ def test_created_namespace_count
61
+ n = @doc.root.clone
62
+ n.children.each(&:remove)
63
+ ns_attrs = n.to_xml.scan(/\bxmlns(?::.+?)?=/)
64
+ assert_equal 3, ns_attrs.length
65
+ end
60
66
  end
61
67
  end
62
68
  end
@@ -55,6 +55,12 @@ module Nokogiri
55
55
  def test_parsed_buried_decl_ns
56
56
  assert_equal 'ns:veg', check_namespace(@doc.root.elements[3].elements[1])
57
57
  end
58
+ def test_parsed_namespace_count
59
+ n = @doc.root.clone
60
+ n.children.each(&:remove)
61
+ ns_attrs = n.to_xml.scan(/\bxmlns(?::.+?)?=/)
62
+ assert_equal 3, ns_attrs.length
63
+ end
58
64
  end
59
65
  end
60
66
  end
@@ -433,6 +433,39 @@ class TestReader < Nokogiri::TestCase
433
433
  reader.map {|n| n.base_uri })
434
434
  end
435
435
 
436
+ def test_xlink_href_without_base_uri
437
+ reader = Nokogiri::XML::Reader(<<-eoxml)
438
+ <x xmlns:xlink="http://www.w3.org/1999/xlink">
439
+ <link xlink:href="#other">Link</link>
440
+ <other id="other">Linked Element</other>
441
+ </x>
442
+ eoxml
443
+
444
+ reader.each do |node|
445
+ if node.node_type == Nokogiri::XML::Reader::TYPE_ELEMENT
446
+ if node.name == 'link'
447
+ assert_nil node.base_uri
448
+ end
449
+ end
450
+ end
451
+ end
452
+
453
+ def test_xlink_href_with_base_uri
454
+ reader = Nokogiri::XML::Reader(<<-eoxml)
455
+ <x xml:base="http://base.example.org/base/"
456
+ xmlns:xlink="http://www.w3.org/1999/xlink">
457
+ <link xlink:href="#other">Link</link>
458
+ <other id="other">Linked Element</other>
459
+ </x>
460
+ eoxml
461
+
462
+ reader.each do |node|
463
+ if node.node_type == Nokogiri::XML::Reader::TYPE_ELEMENT
464
+ assert_equal node.base_uri, "http://base.example.org/base/"
465
+ end
466
+ end
467
+ end
468
+
436
469
  def test_read_from_memory
437
470
  called = false
438
471
  reader = Nokogiri::XML::Reader.from_memory('<foo>bar</foo>')
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nokogiri
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: 6
5
- version: 1.5.7.rc3
4
+ prerelease:
5
+ version: 1.5.8
6
6
  platform: java
7
7
  authors:
8
8
  - Aaron Patterson
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-03-14 00:00:00.000000000 Z
15
+ date: 2013-03-19 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: hoe-bundler
@@ -565,6 +565,7 @@ files:
565
565
  - test_all
566
566
  - test/namespaces/test_namespaces_in_builder_doc.rb
567
567
  - test/namespaces/test_namespaces_in_created_doc.rb
568
+ - test/namespaces/test_additional_namespaces_in_builder_doc.rb
568
569
  - test/namespaces/test_namespaces_in_parsed_doc.rb
569
570
  - lib/nokogiri/nokogiri.jar
570
571
  homepage: http://nokogiri.org
@@ -587,10 +588,10 @@ required_ruby_version: !ruby/object:Gem::Requirement
587
588
  none: false
588
589
  required_rubygems_version: !ruby/object:Gem::Requirement
589
590
  requirements:
590
- - - !binary |-
591
- Pg==
591
+ - - ">="
592
592
  - !ruby/object:Gem::Version
593
- version: 1.3.1
593
+ version: !binary |-
594
+ MA==
594
595
  none: false
595
596
  requirements: []
596
597
  rubyforge_project: nokogiri
@@ -663,4 +664,5 @@ test_files:
663
664
  - test/html/sax/test_parser_context.rb
664
665
  - test/namespaces/test_namespaces_in_builder_doc.rb
665
666
  - test/namespaces/test_namespaces_in_created_doc.rb
667
+ - test/namespaces/test_additional_namespaces_in_builder_doc.rb
666
668
  - test/namespaces/test_namespaces_in_parsed_doc.rb