README.md in compare-xml-0.65 vs README.md in compare-xml-0.66
- old
+ new
@@ -76,10 +76,13 @@
- when provided, ignores all attributes that contain substrings `string`, `string2`, etc.
- `ignore_attrs: [css_selector1, css_selector1, ...]` default: **`[]`** [show examples ⇨](#ignore_attrs)
- when provided, ignores specific *attributes* using [CSS selectors](http://www.w3schools.com/cssref/css_selectors.asp)
+- `ignore_attrs_by_name: [string1, string2, ...]` default: **`[]`** [show examples ⇨](#ignore_attrs_by_name)
+ - when provided, ignores specific *attributes* using [String]
+
- `ignore_comments: {true|false}` default: **`true`** [show examples ⇨](#ignore_comments)
- when `true`, ignores comments, such as `<!-- comment -->`
- `ignore_nodes: [css_selector1, css_selector1, ...]` default: **`[]`** [show examples ⇨](#ignore_nodes)
- when provided, ignores specific *nodes* using [CSS selectors](http://www.w3schools.com/cssref/css_selectors.asp)
@@ -88,11 +91,17 @@
- when `true`, ignores all text content within a document
- `verbose: {true|false}` default: **`false`** [show examples ⇨](#verbose)
- when `true`, instead of a boolean, `CompareXML.equivalent?` returns an array of discrepancies.
+- `ignore_children {true|false}` default **`false`** [show examples ⇨](#ignore_children)
+ - when `true`, the subnodes of a node in the xml are ignored
+- `force_children {true|false}` default **`false`** [show examples ⇨](#force_children)
+ - when `true`, the subnodes of a node are checked independently of the status of the parent node
+
+
## Options in Depth
- <a id="collapse_whitespace"></a>`collapse_whitespace: {true|false}` default: **`true`**
When `true`, all text content within the document is trimmed (i.e. space removed from left and right) and whitespace is collapsed (i.e. tabs, new lines, multiple whitespace characters are replaced by a single whitespace).
@@ -183,11 +192,23 @@
**Example:** With `ignore_attrs: ['a[href^="http"]', 'a[class*="button"]']` the following HTML strings are considered equal:
<a href="http://google.ca" class="primary button">Link</a>
<a href="https://google.com" class="primary button rounded">Link</a>
+----------
+- <a id="ignore_attrs_by_name"></a>`ignore_attrs_by_name: [string1, string2, ...]` default: **`false`**
+
+ When provided, ignores all **attributes** which name is specified in the string array.
+
+ **Usage Example:** `CompareXML.equivalent?(doc1, doc2, {ignore_attrs_by_name: ['target'])`
+
+ **Example:** With `ignore_attrs_by_name: ['target', 'rel']` the following HTML strings are considered equal:
+
+ <a href="/admin" class="button" target="_blank">Link</a>
+ <a href="/admin" class="button" target="_self" rel="nofollow">Link</a>
+
----------
- <a id="ignore_comments"></a>`ignore_comments: {true|false}` default: **`true`**
@@ -303,10 +324,31 @@
node1: [Nokogiri::XML::Node] left node that contains the difference
node2: [Nokogiri::XML::Node] right node that contains the difference
diff1: [Nokogiri::XML::Node|String] left difference
diff2: [Nokogiri::XML::Node|String] right difference
+----------
+- <a id="ignore_children"></a>`ignore_children: {true|false}` default: **`false`**
+
+ When provided, ignores all **subnodes** of any node.
+
+ **Usage Example:** `CompareXML.equivalent?(doc1, doc2, {ignore_children: true})`
+
+ **Example:** With `ignore_children: true` the following HTML strings are considered equal:
+
+ <body><a href="/admin" class="icon" target="_blank">Link 1</a></body>
+ <body><a href="/index" class="button" target="_self" rel="nofollow">Link 2</a></body>
+
+----------
+
+- <a id="force_children"></a>`force_children: {true|false}` default: **`false`**
+
+ When provided, compares all **subnodes** of any node.
+
+ **Usage Example:** `CompareXML.equivalent?(doc1, doc2, {ignore_children: true})`
+
+----------
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
\ No newline at end of file