xqsr3-xml 0.1.1 → 0.1.3

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
- SHA1:
3
- metadata.gz: 579902ff6b98464b33ec82da2f78822cab59b82b
4
- data.tar.gz: 069970702755b5d5f593a237a0c6bb55f379daab
2
+ SHA256:
3
+ metadata.gz: e1cc839d48995d90a12ad2007c1d32952d21cbdf279ce426b069bb7ad6f311ab
4
+ data.tar.gz: 8376854d02b2fd46eb8007a3efe062ab146bb1a7eaa856518b7d960fc1e4db04
5
5
  SHA512:
6
- metadata.gz: 668ef35a9b7601bda49cc24580a1537e6670a8aa959b7249a2dcbd8336a38c62c9cbcef7b8aba796bcb22c66301d4f49b941c824c377d42164d2a65bf443ee98
7
- data.tar.gz: 01d0308b89fc251e599c53472da97bbbba128d48054ed3a8beabae8000cff854537cb41ad78e1b90d51ec245cc79e1da2b9660bf9d5cb7825e8ae0c253ce2015
6
+ metadata.gz: 1f229ec8b2fdc95c41fbc7db3a5ffed639f9910c48cb52a5d780dab9acccfb3076e3feba39929d2edf5329b2fb5910fe0055aa1ae89cbbf24a3835ee19d114c3
7
+ data.tar.gz: 74f10178817dc74e84e6b4ea27c7212647e5275fc074cacdc483833c53174cb1ddda12159823735c2b5e225f5bad6a68e0ddd3a50538e2c4675532fae9cd4472
data/AUTHORS.md ADDED
@@ -0,0 +1,21 @@
1
+ # xqsr3-xml - Authors <!-- omit in toc -->
2
+
3
+
4
+ ## Major Contributors
5
+
6
+ | Name | GitHub |
7
+ | ----------- | --------------------------------- |
8
+ | Matt Wilson | [mwsis](https://github.com/mwsis) |
9
+
10
+
11
+ ## Defect reports, fixes and suggestions (for which we are very grateful)
12
+
13
+ | Name | GitHub |
14
+ | ----------- | --------------------------------- |
15
+ | \<none> | |
16
+
17
+
18
+ Contributions are welcomed.
19
+
20
+
21
+ <!-- ########################### end of file ########################### -->
data/CHANGES.md ADDED
@@ -0,0 +1,40 @@
1
+ # xqsr3-xml - Changes <!-- omit in toc -->
2
+
3
+
4
+ ## 0.1.3 - 19th August 2026
5
+
6
+ * converted **lib/** and **test/** Ruby sources from tab indent to 2-space indent;
7
+ * **Gemfile**: Nokogiri pins follow the last-supported series per MRI (including **2.6**, **2.7**, **3.0**, **3.1**) so `bundle install` resolves on current platforms;
8
+ * **xqsr3-xml.gemspec**: `spec.summary` matches the README tagline; packaged **AUTHORS**, **CHANGES**, **CONTRIBUTING**, **EXAMPLES**, **FAQ**, **INSTALL**, **NEWS**, **SECURITY**, and **TODO**; **Gemfile.lock** and **.ruby-version** excluded from `spec.files`;
9
+ * stop tracking **Gemfile.lock**; **Gemfile** sets `lockfile false` when Bundler supports it; CI uses `bundler-cache: false` because Bundler 4 then writes no lockfile and **ruby/setup-ruby** cache cats **Gemfile.lock**;
10
+ * CI **Warnings** job now runs on Ruby **3.4**;
11
+ * updated **run_all_unit_tests.sh** (from https://github.com/synesissoftware/misc-dev-scripts) to skip **tput** when **$TERM** is unset or stdout is not a TTY;
12
+ * reordered **README.md** (tagline before badges; TOC after badges), added Language / License / Last Commit badges and **Dependencies** (Efferent / Afferent);
13
+ * added **examples/compare_xml** and catalogued it in **EXAMPLES.md**;
14
+
15
+
16
+ ## 0.1.2 - 15th August 2026
17
+
18
+ * added `# frozen_string_literal: true` to all **lib/** sources;
19
+
20
+
21
+ ## 0.1.1 - 11th April 2019
22
+
23
+ * project boilerplate;
24
+ * version adjustment;
25
+ * added **Gemfile** with Ruby-version-discriminated **Nokogiri** dependencies;
26
+ * added **.ruby-version-exclusions**;
27
+ * updated **run_all_unit_tests.sh** (from **misc-dev-scripts**);
28
+
29
+
30
+ ## 0.1.0.1 - 2nd March 2019
31
+
32
+ * build-number update for packaging;
33
+
34
+
35
+ ## 0.1.0 - 1st March 2019
36
+
37
+ * first public release;
38
+
39
+
40
+ <!-- ########################### end of file ########################### -->
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,36 @@
1
+ # xqsr3-xml - Contributing <!-- omit in toc -->
2
+
3
+
4
+ ## Table of Contents <!-- omit in toc -->
5
+
6
+ - [Defects and features](#defects-and-features)
7
+ - [Pull requests](#pull-requests)
8
+ - [Tests](#tests)
9
+ - [License](#license)
10
+
11
+
12
+ ## Defects and features
13
+
14
+ Open an issue on https://github.com/synesissoftware/xqsr3-xml/issues.
15
+
16
+
17
+ ## Pull requests
18
+
19
+ Pull requests are welcome on https://github.com/synesissoftware/xqsr3-xml. Keep diffs local to the change; match existing indentation (2 spaces in Ruby) and the Synesis markdown set (**README.md**, **CHANGES.md**, **NEWS.md**, **TODO.md**, **INSTALL.md**, **CONTRIBUTING.md**, **SECURITY.md**).
20
+
21
+
22
+ ## Tests
23
+
24
+ ```
25
+ bundle exec rake test
26
+ ```
27
+
28
+ or `./run_all_unit_tests.sh`.
29
+
30
+
31
+ ## License
32
+
33
+ Contributions are accepted under the 3-clause BSD license. See [LICENSE](./LICENSE).
34
+
35
+
36
+ <!-- ########################### end of file ########################### -->
data/EXAMPLES.md ADDED
@@ -0,0 +1,8 @@
1
+ # xqsr3-xml - Examples <!-- omit in toc -->
2
+
3
+ |Name|Source & Description|Summary|
4
+ |---|---|---|
5
+ |**compare_xml**|[examples/compare_xml.rb](./examples/compare_xml.rb)<br/>[examples/compare_xml.md](./examples/compare_xml.md)|Simple example illustrating use of ``xml_compare``|
6
+
7
+
8
+ <!-- ########################### end of file ########################### -->
data/FAQ.md ADDED
@@ -0,0 +1,27 @@
1
+ # xqsr3-xml - FAQ <!-- omit in toc -->
2
+
3
+ The FAQ list is under (constant) development. If you post a question on the
4
+ [Issues](https://github.com/synesissoftware/xqsr3-xml/issues) forum
5
+ it will be used to create one.
6
+
7
+
8
+ ## Table of Contents <!-- omit in toc -->
9
+
10
+ - [Q1: "How do I install this library?"](#q1-how-do-i-install-this-library)
11
+
12
+
13
+ # FAQs: <!-- omit in toc -->
14
+
15
+
16
+ ## Q1: "How do I install this library?"
17
+
18
+ Install via **gem**:
19
+
20
+ ```
21
+ gem install xqsr3-xml
22
+ ```
23
+
24
+ See [README.md](./README.md) for usage.
25
+
26
+
27
+ <!-- ########################### end of file ########################### -->
data/INSTALL.md ADDED
@@ -0,0 +1,41 @@
1
+ # xqsr3-xml - Installation and Use <!-- omit in toc -->
2
+
3
+
4
+ ## Table of Contents <!-- omit in toc -->
5
+
6
+ - [Install the gem](#install-the-gem)
7
+ - [From a source checkout](#from-a-source-checkout)
8
+ - [Using the library](#using-the-library)
9
+
10
+
11
+ ## Install the gem
12
+
13
+ ```
14
+ gem install xqsr3-xml
15
+ ```
16
+
17
+ or add to a **Gemfile**:
18
+
19
+ ```Ruby
20
+ gem 'xqsr3-xml'
21
+ ```
22
+
23
+ then `bundle install`.
24
+
25
+
26
+ ## From a source checkout
27
+
28
+ ```
29
+ bundle install
30
+ bundle exec rake test
31
+ ```
32
+
33
+
34
+ ## Using the library
35
+
36
+ ```Ruby
37
+ require 'xqsr3/xml/utilities/compare'
38
+ ```
39
+
40
+
41
+ <!-- ########################### end of file ########################### -->
data/LICENSE CHANGED
@@ -1,29 +1,32 @@
1
- xqsr3-xml
1
+ xqsr3-xml - BSD 3-Clause License
2
2
 
3
- Copyright (c) 2005-2016, Matthew Wilson and Synesis Software
3
+ Copyright (c) 2019-2026, Matthew Wilson and Synesis Information Systems
4
+ Copyright (c) 2005-2019, Matthew Wilson and Synesis Software
4
5
  All rights reserved.
5
6
 
6
7
  Redistribution and use in source and binary forms, with or without
7
8
  modification, are permitted provided that the following conditions are met:
8
9
 
9
- * Redistributions of source code must retain the above copyright notice, this
10
- list of conditions and the following disclaimer.
10
+ 1. Redistributions of source code must retain the above copyright notice,
11
+ this list of conditions and the following disclaimer.
11
12
 
12
- * Redistributions in binary form must reproduce the above copyright notice,
13
- this list of conditions and the following disclaimer in the documentation
14
- and/or other materials provided with the distribution.
13
+ 2. Redistributions in binary form must reproduce the above copyright notice,
14
+ this list of conditions and the following disclaimer in the documentation
15
+ and/or other materials provided with the distribution.
15
16
 
16
- * Neither the names of xqsr3 and xqsr3-xml nor the names of its
17
- contributors may be used to endorse or promote products derived from
18
- this software without specific prior written permission.
17
+ 3. Neither the name of the copyright holder nor the names of its
18
+ contributors may be used to endorse or promote products derived from
19
+ this software without specific prior written permission.
19
20
 
20
21
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
22
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
25
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31
+ POSSIBILITY OF SUCH DAMAGE.
32
+
data/NEWS.md ADDED
@@ -0,0 +1,12 @@
1
+ # xqsr3-xml - News <!-- omit in toc -->
2
+
3
+ | Date | News Item |
4
+ | ---------------- | -------------------------------------------------------------------------------------- |
5
+ | 19th August 2026 | [**xqsr3-xml** 0.1.3](https://github.com/synesissoftware/xqsr3-xml/releases/tag/0.1.3) |
6
+ | 15th August 2026 | [**xqsr3-xml** 0.1.2](https://github.com/synesissoftware/xqsr3-xml/releases/tag/0.1.2) |
7
+ | 11th April 2019 | **xqsr3-xml** 0.1.1 released |
8
+ | 2nd March 2019 | **xqsr3-xml** 0.1.0.1 released |
9
+ | 1st March 2019 | **xqsr3-xml** 0.1.0 released |
10
+
11
+
12
+ <!-- ########################### end of file ########################### -->
data/README.md CHANGED
@@ -1,60 +1,126 @@
1
- # xqsr3-xml
1
+ # xqsr3-xml <!-- omit in toc -->
2
+
2
3
  e**X**tensions by fine **Q**uantum for **S**tandard **R**uby and **3**rd-party libraries, for **XML**
3
4
 
5
+ ![Language](https://img.shields.io/badge/Ruby-CC342D?style=flat&logo=ruby&logoColor=white)
6
+ [![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
4
7
  [![Gem Version](https://badge.fury.io/rb/xqsr3-xml.svg)](https://badge.fury.io/rb/xqsr3-xml)
8
+ [![Last Commit](https://img.shields.io/github/last-commit/synesissoftware/xqsr3-xml)](https://github.com/synesissoftware/xqsr3-xml/commits/master)
9
+ [![Ruby](https://github.com/synesissoftware/xqsr3-xml/actions/workflows/ruby.yml/badge.svg)](https://github.com/synesissoftware/xqsr3-xml/actions/workflows/ruby.yml)
10
+
11
+
12
+ ## Table of Contents <!-- omit in toc -->
13
+
14
+ - [Introduction](#introduction)
15
+ - [Installation](#installation)
16
+ - [Components](#components)
17
+ - [Examples](#examples)
18
+ - [Project Information](#project-information)
19
+ - [Where to get help](#where-to-get-help)
20
+ - [Contribution guidelines](#contribution-guidelines)
21
+ - [Dependencies](#dependencies)
22
+ - [Efferent (fan-out)](#efferent-fan-out)
23
+ - [Runtime Dependencies (aka "Normal Dependencies")](#runtime-dependencies-aka-normal-dependencies)
24
+ - [Development Dependencies](#development-dependencies)
25
+ - [Afferent (fan-in)](#afferent-fan-in)
26
+ - [Runtime dependents](#runtime-dependents)
27
+ - [Development dependents](#development-dependents)
28
+ - [Related projects](#related-projects)
29
+ - [License](#license)
30
+
5
31
 
6
32
  ## Introduction
7
33
 
8
- [**xqsr3**](https://github.com/synesissoftware/xqsr3/) is a lightweight, low-coupling library of assorted extensions to standard ruby and 3rd-party libraries. As of version **0.31** of **xqsr3**, the **XML Utilites** components were moved out into **xqsr3-xml** in order that the core **xqsr** can be independent of any non-standard libraries.
34
+ **xqsr3-xml** provides the XML utilities formerly shipped in [**xqsr3**](https://github.com/synesissoftware/xqsr3/). As of **xqsr3** **0.31**, those components live here so that core **xqsr3** stays independent of any non-standard libraries.
9
35
 
10
- ## Table of Contents
36
+ It depends on **Nokogiri** (and **xqsr3**).
11
37
 
12
- 1. [Introduction](#introduction)
13
- 2. [Installation](#installation)
14
- 3. [Components](#components)
15
- 4. [Project Information](#project-information)
16
38
 
17
39
  ## Installation
18
40
 
19
- Install using `gem install xqsr3-xml` or add it to your `Gemfile`.
41
+ Install via **gem** as in:
42
+
43
+ ```
44
+ gem install xqsr3-xml
45
+ ```
46
+
47
+ or add it to your `Gemfile`.
48
+
49
+ Use is via specific APIs. For example, in order to compare XML you would ``require`` the source file, as in:
50
+
51
+ ```Ruby
52
+ require 'xqsr3/xml/utilities/compare'
53
+ ```
54
+
20
55
 
21
56
  ## Components
22
57
 
23
- **xqsr3** provides components in the following categories:
58
+ **xqsr3-xml** provides components in the following category:
59
+
60
+ * XML Utilities — `Xqsr3::XML::Utilities::Compare` (`xml_compare`) and `Xqsr3::XML::Utilities::Navigation` (`get_descendants`);
61
+
24
62
 
25
- * Array Utilities
26
- * Command-line Utilities
27
- * Containers
28
- * Conversion
29
- * Diagnostics
30
- * Hash Utilities
31
- * IO
32
- * Quality
33
- * String Utilities
63
+ ## Examples
34
64
 
35
- **xqsr3-xml** provides components in the following categories:
65
+ Examples are provided in the ```examples``` directory, along with a markdown description for each. A detailed list TOC of them is provided in [EXAMPLES.md](./EXAMPLES.md).
36
66
 
37
- * XML Utilities
38
67
 
39
68
  ## Project Information
40
69
 
70
+
41
71
  ### Where to get help
42
72
 
43
73
  [GitHub Page](https://github.com/synesissoftware/xqsr3-xml "GitHub Page")
44
74
 
75
+
45
76
  ### Contribution guidelines
46
77
 
47
78
  Defect reports, feature requests, and pull requests are welcome on https://github.com/synesissoftware/xqsr3-xml.
48
79
 
80
+
49
81
  ### Dependencies
50
82
 
51
- * [**Nokogiri**](http://nokogiri.org/)
52
- * [**xqsr3**](https://github.com/synesissoftware/xqsr3/)
83
+
84
+ #### Efferent (fan-out)
85
+
86
+ Libraries upon which **xqsr3-xml** depends:
87
+
88
+
89
+ ##### Runtime Dependencies (aka "Normal Dependencies")
90
+
91
+ * [**Nokogiri**](https://github.com/sparklemotion/nokogiri);
92
+ * [**xqsr3**](https://github.com/synesissoftware/xqsr3);
93
+
94
+
95
+ ##### Development Dependencies
96
+
97
+ * [**rake**](https://rubygems.org/gems/rake);
98
+ * [**test-unit**](https://rubygems.org/gems/test-unit);
99
+
100
+
101
+ #### Afferent (fan-in)
102
+
103
+ Projects that depend on **xqsr3-xml**:
104
+
105
+
106
+ ##### Runtime dependents
107
+
108
+ * \<none>;
109
+
110
+
111
+ ##### Development dependents
112
+
113
+ * \<none>;
114
+
53
115
 
54
116
  ### Related projects
55
117
 
56
- * [**xqsr3**](https://github.com/synesissoftware/xqsr3/)
118
+ * [**xqsr3**](https://github.com/synesissoftware/xqsr3/) — core library from which these XML components were split;
119
+
57
120
 
58
121
  ### License
59
122
 
60
123
  **xqsr3-xml** is released under the 3-clause BSD license. See [LICENSE](./LICENSE) for details.
124
+
125
+
126
+ <!-- ########################### end of file ########################### -->
data/Rakefile ADDED
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Rakefile for xqsr3-xml
4
+
5
+ require 'rake/testtask'
6
+
7
+
8
+ Rake::TestTask.new do |tt|
9
+
10
+ tt.libs << 'lib'
11
+ tt.libs << 'test'
12
+ tt.name = 'test'
13
+ tt.test_files = FileList['test/**/tc_*.rb']
14
+ tt.verbose = true
15
+ end
16
+
17
+
18
+ task :default => :test
19
+
20
+
21
+ # ############################## end of file ############################# #
data/SECURITY.md ADDED
@@ -0,0 +1,23 @@
1
+ # xqsr3-xml - Security <!-- omit in toc -->
2
+
3
+
4
+ ## Table of Contents <!-- omit in toc -->
5
+
6
+ - [Reporting a vulnerability](#reporting-a-vulnerability)
7
+ - [Supported versions](#supported-versions)
8
+
9
+
10
+ ## Reporting a vulnerability
11
+
12
+ Please report security issues privately via GitHub Security Advisories on https://github.com/synesissoftware/xqsr3-xml/security, or by opening an issue if an advisory cannot be filed. Do not attach exploit proofs of concept against third-party systems.
13
+
14
+
15
+ ## Supported versions
16
+
17
+ | Version | Supported |
18
+ | ------- | --------- |
19
+ | 0.1.x | ✅ |
20
+ | < 0.1 | ❌ |
21
+
22
+
23
+ <!-- ########################### end of file ########################### -->
data/TODO.md ADDED
@@ -0,0 +1,23 @@
1
+ # xqsr3-xml - TODO <!-- omit in toc -->
2
+
3
+
4
+ ## Functional improvements
5
+
6
+ * [ ] quiet the assigned-but-unused variable warning in **test/unit/xml/utilities/tc_navigation.rb** (`doc`; Ruby 3.4 `-W` / CI **Warnings** job);>
7
+
8
+
9
+ ## Performance improvements
10
+
11
+ * \<none>
12
+
13
+
14
+ ## Packaging improvements
15
+
16
+ * [x] ~~~updated **run_all_unit_tests.sh** (from **misc-dev-scripts**) to skip `tput` when `$TERM` is unset or stdout is not a TTY~~~;
17
+ * [x] ~~~**Gemfile** `lockfile false`; stop tracking **Gemfile.lock**; CI `bundler-cache: false`~~~;
18
+ * [x] ~~~gemspec polish: README tagline as `spec.summary`, package docs, exclude **Gemfile.lock** / **.ruby-version**~~~;
19
+ * [x] ~~~README canonical structure (tagline before badges; **Dependencies**; CI badge → **ruby.yml**)~~~;
20
+ * [x] ~~~after the packaging/boilerplate/CI baseline: bump **VERSION** and align **CHANGES**/**NEWS**~~~;
21
+
22
+
23
+ <!-- ########################### end of file ########################### -->
@@ -0,0 +1,47 @@
1
+ # xqsr3-xml - Example - **compare_xml**
2
+
3
+ ## Summary
4
+
5
+ Simple example illustrating use of ``xml_compare``.
6
+
7
+ ## Source
8
+
9
+ ```ruby
10
+
11
+ #! /usr/bin/env ruby
12
+
13
+ # examples/compare_xml.rb
14
+
15
+
16
+ require 'xqsr3/xml/utilities/compare'
17
+
18
+
19
+ include Xqsr3::XML::Utilities::Compare
20
+
21
+
22
+ lhs = '<person name="Ada" age="36"/>'
23
+ rhs_same = '<person age="36" name="Ada"/>'
24
+ rhs_diff = '<person name="Ada" age="37"/>'
25
+
26
+ r_same = xml_compare(lhs, rhs_same)
27
+ r_diff = xml_compare(lhs, rhs_diff)
28
+
29
+ puts "attribute-order-insensitive: #{r_same}"
30
+ puts "age mismatch: #{r_diff}"
31
+ ```
32
+
33
+ Two XML fragments that differ only in attribute order are compared (they
34
+ are treated as the same by default). A third fragment with a different
35
+ ``age`` is then compared, which is reported as different.
36
+
37
+ ## Usage
38
+
39
+ When run (with ``lib`` on the load path, or after ``gem install xqsr3-xml``), this produces the following output:
40
+
41
+ ```
42
+ attribute-order-insensitive: same
43
+ age mismatch: different, because: different attributes: lhs-node=<person name="Ada" age="36"/>; rhs-node=<person name="Ada" age="37"/>
44
+ ```
45
+
46
+
47
+ <!-- ########################### end of file ########################### -->
@@ -0,0 +1,20 @@
1
+ #! /usr/bin/env ruby
2
+
3
+ # examples/compare_xml.rb
4
+
5
+
6
+ require 'xqsr3/xml/utilities/compare'
7
+
8
+
9
+ include Xqsr3::XML::Utilities::Compare
10
+
11
+
12
+ lhs = '<person name="Ada" age="36"/>'
13
+ rhs_same = '<person age="36" name="Ada"/>'
14
+ rhs_diff = '<person name="Ada" age="37"/>'
15
+
16
+ r_same = xml_compare(lhs, rhs_same)
17
+ r_diff = xml_compare(lhs, rhs_diff)
18
+
19
+ puts "attribute-order-insensitive: #{r_same}"
20
+ puts "age mismatch: #{r_diff}"