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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c6ba3896b05b5303ed0842c6ccc0376ce27e0325301dafe54472c73f9298ed9
4
- data.tar.gz: 45844824ec1ca0ba91acf214cd1369466b40e1e0d7d1a653ed5ad7807a488e58
3
+ metadata.gz: 301821063fa998d1a4522029ef825aaa7bddc45370ed0c1bb904f8b31fd9f036
4
+ data.tar.gz: cabdd59089a44485d847b7ff3637197d2c24e38abb3e5c68423c397a9869e843
5
5
  SHA512:
6
- metadata.gz: d9513b47e15bf8219c9cfc0a801763b656622e0f00c517d4e3cc3065b7775555d03ec1ad933eb309933e9bb9563ec234f66d19ce179693a265bac1a9a9d52f7e
7
- data.tar.gz: 8df33c1af2dc29c325e2b82a148b2adaa75d61d1e80a7dba466b39cb0896ea9a26da3c53b564a84643330c70d88f239202ee87b3fedb7c2ca66e4b82e5eb4112
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
- # Use Nokogiri syntax
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
- # Classes are aliased
110
- Nokogiri::XML::Document == RXerces::XML::Document # => true
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