slaw 3.4.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 82626011b387d28e9bdf0228b027fc2fcd643a8644fa0556c03c5ee7461dc7dd
4
- data.tar.gz: f2e8cd8e854a5bcb3cd29b14acb9f7f48fa3461dc0e7627caec70c16d7c7d194
3
+ metadata.gz: feed0253f8ca8bfc11a4b7d8b844a66a4b50caf5ada01ec470cb8fb295f015da
4
+ data.tar.gz: 31d43678f703b65e07e728cee6be876fa0b91d5f921a05147b4ce19c4d696ed2
5
5
  SHA512:
6
- metadata.gz: 5b854023c84d5c07696fdb8ca62c92774afdd9ad52ede40657e40bf6d280683a000c8d4a2d58ad09a8d4c87ef1d8f621050fdfc46d422c45306b0964da284177
7
- data.tar.gz: 5359da9d43cd6ebf8e1351a6004db43eb644fab20b312bc86df47361a9b4e267bc9b43e2eacc0014149e5ee898f75e65ff658ea5cf7f6ddd6e37314aa7f51d54
6
+ metadata.gz: 0c966ce6ba9b80aa2d6de457150a83a6d26fbc0ad14d75ebee0fbb15dd3e9784723845b22222f525da370e3d170208199a723d08078a7640ae578b190296f78e
7
+ data.tar.gz: fa39619402b136aa5f3ef74db739b74b588b2c7a06f790ac4405be6f52e3927c9110400df9e1afeef5fd523012c31222b4e1fd287b0fb5df870ae120ef1d7907
data/README.md CHANGED
@@ -81,6 +81,11 @@ You can create your own grammar by creating a gem that provides these files and
81
81
 
82
82
  ## Changelog
83
83
 
84
+ ### 4.0.0 (29 May 2019)
85
+
86
+ * Preserve whitespace for mixed content nodes
87
+ * Don't pretty-print XML, as this can introduce meaningful whitespace
88
+
84
89
  ### 3.4.0 (20 May 2019)
85
90
 
86
91
  * Restructure subsections to support generic block elements, starting with an inline block element
data/bin/slaw CHANGED
@@ -75,7 +75,7 @@ class SlawCLI < Thor
75
75
  exit 1
76
76
  end
77
77
 
78
- puts act.to_xml(indent: 2)
78
+ puts act.to_xml(save_with: Nokogiri::XML::Node::SaveOptions::AS_XML)
79
79
  end
80
80
 
81
81
  desc "unparse FILE", "Unparse FILE from Akoma Ntoso XML back into text suitable for re-parsing"
@@ -4,7 +4,10 @@
4
4
  exclude-result-prefixes="a">
5
5
 
6
6
  <xsl:output method="text" indent="no" omit-xml-declaration="yes" />
7
+
8
+ <!-- strip whitespace from most elements, but preserve whitespace in inline elements that can contain text -->
7
9
  <xsl:strip-space elements="*"/>
10
+ <xsl:preserve-space elements="a:a a:affectedDocument a:b a:block a:caption a:change a:concept a:courtType a:date a:def a:del a:docCommittee a:docDate a:docIntroducer a:docJurisdiction a:docNumber a:docProponent a:docPurpose a:docStage a:docStatus a:docTitle a:docType a:docketNumber a:entity a:event a:extractText a:fillIn a:from a:heading a:i a:inline a:ins a:judge a:lawyer a:legislature a:li a:listConclusion a:listIntroduction a:location a:mmod a:mod a:mref a:narrative a:neutralCitation a:num a:object a:omissis a:opinion a:organization a:outcome a:p a:party a:person a:placeholder a:process a:quantity a:quotedText a:recordedTime a:ref a:relatedDocument a:remark a:rmod a:role a:rref a:scene a:session a:shortTitle a:signature a:span a:sub a:subheading a:summary a:sup a:term a:tocItem a:u a:vote"/>
8
11
 
9
12
  <!-- adds a backslash to the start of the value param, if necessary -->
10
13
  <xsl:template name="escape">
@@ -274,7 +277,7 @@
274
277
 
275
278
  <!-- for most nodes, just dump their text content -->
276
279
  <xsl:template match="*">
277
- <xsl:text/><xsl:apply-templates /><xsl:text/>
280
+ <xsl:apply-templates />
278
281
  </xsl:template>
279
282
 
280
283
  </xsl:stylesheet>
data/lib/slaw/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Slaw
2
- VERSION = "3.4.0"
2
+ VERSION = "4.0.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slaw
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Kempe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-20 00:00:00.000000000 Z
11
+ date: 2019-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake