rxerces 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGES.md +12 -0
- data/README.md +14 -3
- data/ext/rxerces/rxerces.cpp +770 -3
- data/lib/rxerces/nokogiri.rb +26 -0
- data/lib/rxerces/version.rb +1 -1
- data/rxerces.gemspec +1 -1
- data/spec/document_spec.rb +59 -0
- data/spec/node_spec.rb +351 -4
- data/spec/nodeset_spec.rb +59 -0
- data/spec/nokogiri_compatibility_spec.rb +44 -0
- data/spec/rxerces_shared.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 301821063fa998d1a4522029ef825aaa7bddc45370ed0c1bb904f8b31fd9f036
|
|
4
|
+
data.tar.gz: cabdd59089a44485d847b7ff3637197d2c24e38abb3e5c68423c397a9869e843
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9edd86524fc0ac49a51a9b2658d723a84f85c295d362e8dad500bcd8a47e95c3ad4b41d073f7bdcee0927bd38a6b1710537ee190693ec739de20e65b22e04d8a
|
|
7
|
+
data.tar.gz: 035ed74771b3d3e6125c1567d5452ac773f80a2f9ae220efd063358f7fcc93326f1beb027bf67e45ad042a950a8372b208426f07ab5320c58bb453f40c4d4c19
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/CHANGES.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## 0.5.0 - 16-Dec-2025
|
|
2
|
+
* Implemented a real css method. Requires Xalan to be installed.
|
|
3
|
+
* Added text/content methods for most classes.
|
|
4
|
+
* Added a nicer inspect method for most classes.
|
|
5
|
+
* Added an HTML alias for XML, mainly for compatibility with nokogiri,
|
|
6
|
+
but keep in mind that this library parses HTML as XML.
|
|
7
|
+
* Added the Node#ancestors method.
|
|
8
|
+
* Added the Node#has_attribute method.
|
|
9
|
+
* Added first, last, empty? and inner_html methods for Node.
|
|
10
|
+
* Added elements, next_element and previous_element for Node.
|
|
11
|
+
* Added the Document#at_css method.
|
|
12
|
+
|
|
1
13
|
## 0.4.0 - 15-Dec-2025
|
|
2
14
|
* Now uses Xalan if installed for xpath 1.0 compliance.
|
|
3
15
|
* Added Node#search.
|
data/README.md
CHANGED
|
@@ -102,16 +102,27 @@ RXerces provides optional Nokogiri compatibility. Require `rxerces/nokogiri` to
|
|
|
102
102
|
```ruby
|
|
103
103
|
require 'rxerces/nokogiri'
|
|
104
104
|
|
|
105
|
-
#
|
|
105
|
+
# Parse XML with Nokogiri syntax
|
|
106
106
|
doc = Nokogiri.XML('<root><child>text</child></root>')
|
|
107
107
|
puts doc.root.name # => "root"
|
|
108
108
|
|
|
109
|
-
#
|
|
110
|
-
|
|
109
|
+
# Parse HTML with Nokogiri syntax
|
|
110
|
+
html_doc = Nokogiri.HTML('<html><body><h1>Hello</h1></body></html>')
|
|
111
|
+
puts html_doc.root.name # => "html"
|
|
112
|
+
|
|
113
|
+
# Alternative syntax
|
|
114
|
+
xml_doc = Nokogiri::XML.parse('<root>text</root>')
|
|
115
|
+
html_doc = Nokogiri::HTML.parse('<html>...</html>')
|
|
116
|
+
|
|
117
|
+
# Classes are aliased for both XML and HTML
|
|
118
|
+
Nokogiri::XML::Document == RXerces::XML::Document # => true
|
|
119
|
+
Nokogiri::HTML::Document == RXerces::XML::Document # => true
|
|
111
120
|
```
|
|
112
121
|
|
|
113
122
|
**Note:** If you don't need Nokogiri compatibility, just `require 'rxerces'` and use the `RXerces` module directly.
|
|
114
123
|
|
|
124
|
+
**HTML Parsing Note:** Since RXerces uses Xerces-C (an XML parser), `Nokogiri::HTML` parses HTML as XML. This means it won't perform HTML-specific error correction or tag fixing like Nokogiri does with libxml2's HTML parser. For well-formed HTML/XHTML documents, this works fine.
|
|
125
|
+
|
|
115
126
|
### Working with Nodes
|
|
116
127
|
|
|
117
128
|
```ruby
|